Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: ldr

Postby Sean » Tue May 11, 2010 2:15 pm

Use the LDR and a fixed resistor, R, to form a potential divider circuit between the microcontroller positive supply voltage (Vcc) and 0V. The value of the fixed resistor will depend on the characteristics of the LDR

Connect the common point of the resistor and LDR to an analogue input.

The measured voltage will be:
Vcc x Rldr/(R + Rldr) if the LDR is connected to 0V


Vcc x R/(R + Rldr) if the LDR is connected to Vcc