- This topic has 2 replies, 3 voices, and was last updated 10 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › ldr sensing
i need help in sensing the resistance change of LDR (light dependant resistor) sensor using ATMEGA8 or ATMEGA16.
i am not much familiar with the coding for Micro controller and hence need help in this regard.
thank you
Hi Rick,
Connect one end of LDR to ground and the other end to positive through a resistor not less than 1K.
Connect the common point of LDR and the resistor to one of the ADC pin of the ATMEGA.
Here is an example of how to use the ADC of ATMEGA16.
http://www.engineersgarage.com/embedded/avr-microcontroller-projects/adc-circuit
to read the LDR resistance value using AVR built in ADC please go through AVR ADC interfacing tutorial on this site
also to display value on LCD or 7 segment refer LCD interfacing tutorial or 7 segment interfacing tutorial.