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
Any general or miscellaneous queries that do not fit into the other forum catagories
3 posts • Page 1 of 1