Light sensor (LDR divider)
A photoresistor’s resistance falls as light increases, from megohms in the dark to about a kilohm in daylight. Put it in a voltage divider and light becomes a voltage that a comparator, transistor or microcontroller can read.

Open this lesson in the labFree, in your browser, no account needed.
How it works
At 300 lux, the GL5528 is about 1.82 kΩ (≈ 10–20 kΩ at 10 lux, falling as light rises)
Vout = Vs · Rfixed / (Rfixed + RLDR) = 4.232 V
With the LDR on top, the output rises with light. Swap the two parts and it rises in the dark: that is the input of a night light. Pick Rfixed near the LDR’s resistance at the light level you care about, so the output swings the most there.
Try it on the bench
- Click the LDR to cover it: the resistance shoots up and V_out drops near 0 V.
- Select the LDR and set 10 lux (dim room), then 10 000 lux (daylight).
- Change R_fixed to 1 kΩ: the divider now responds most in bright light instead.
Parts on the bench
- Bench power supply
- Photoresistor (LDR)
- Resistor
- Digital multimeter
In the course
Zen’s Electronics Design Mastery, module “Microcontrollers & Embedded”.