Home › Lessons › DC circuits › Light sensor (LDR divider)

Light sensor (LDR divider)

DC circuits · Beginner · about 10 minutes · part of Zen’s Electronics Design Mastery

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.

Light sensor (LDR divider): the circuit on the simulator's bench

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

  1. Click the LDR to cover it: the resistance shoots up and V_out drops near 0 V.
  2. Select the LDR and set 10 lux (dim room), then 10 000 lux (daylight).
  3. Change R_fixed to 1 kΩ: the divider now responds most in bright light instead.

Parts on the bench

In the course

Zen’s Electronics Design Mastery, module “Microcontrollers & Embedded”.

More on dc circuits