Skip to content
TR Open free
Ages 14–18

LDR night light circuit

Drag the sun to the left, it gets dark and the LED switches on by itself; drag it right and the LED goes out. This is how street lights know when to come on.

Free, no sign-up. Works on phones and smart boards too.

A night light circuit with an LDR, a 4.7 kΩ resistor, a transistor and an LED

What’s going on

An LDR (light-dependent resistor) gets more resistant as less light falls on it. In bright light its resistance is low; in the dark it is very high.

Here the LDR and a 4.7 kΩ resistor share the battery’s voltage between them; this is a voltage divider. In the dark the LDR’s resistance rises, most of the voltage ends up across it, and the transistor’s base gets enough to switch on.

The transistor works as a switch: a small current into its base lets a much larger current flow from collector to emitter, and the LED lights. Street lights and solar garden lights work on the same idea.

The formula

V_LDR = V × R_LDR / (R₁ + R_LDR)

  • V_LDR: voltage across the LDR (what reaches the transistor’s base)
  • V: battery voltage, 9 V
  • R₁: the top resistor, 4.7 kΩ

Things to try

  1. Drag the sun all the way right (bright). The LED is off: the LDR’s resistance is low and the transistor doesn’t conduct.
  2. Slowly drag the sun to the left. At some point the LED comes on: it is dark enough.
  3. Change the 4.7 kΩ resistor to 10 kΩ. The LED comes on at a different light level: the threshold has moved.
  4. Delete the transistor and connect the LED straight to the LDR. The LED doesn’t light, or only very faintly: without the transistor there isn’t enough current.

Open the experiment →

Questions and answers

Why does an LDR’s resistance go up in the dark?

Light frees charge carriers in the LDR’s material. With less light there are fewer carriers, so the resistance rises.

What does the transistor do in this circuit?

It acts as a switch and an amplifier: the small current on the LDR side turns on a current big enough to light the LED.

What happens if the LDR and the 4.7 kΩ resistor swap places?

It works the other way round: the LED lights in the light and goes out in the dark.

For teachers

  • Ask students to swap the LDR and the resistor to make a “sunrise alarm” that lights up in daylight.
  • Work out a voltage divider with two fixed resistors on the board first, then move to the experiment.

LDR night light circuit

Free, no sign-up. Works on phones and smart boards too.