interface an LDR with atmega16

Status
Not open for further replies.

ppatel23

Newbie level 5
Joined
Jul 24, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,357
Hello,
i want to interface an LDR with atmega16,..I need to control n measure the light intensity and obtaining the logic 0 or 1 at any pin of port A when ever the light intensity falls below certain level..help me with the circuit n programming ...
Thanks..
 

This is also very easy. Make a potential divider using a resistor and LDR. Either one of the pins of LDR is connected to +5V or GND. The voltage across the LDR should not exceed 5v. When there is sufficient light (bright) the LDR o/p voltage should be 5V and when there is not sufficient light (dark) the voltage must be less than 2.5V. Connect the o/p of LDR to any port pin configured as digital input.
 

thank you for ur advice , it means that it is to be just connect an pot between the supply and one of the LDR terminals and adjust the pot to vary the light intensity levels....whenever the light falls below some level it would give +5V to the port connected..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…