Back to projects
Tier 1 · First SparkseasyAge 9+30 min

Night-Light

A light that turns on automatically when the room gets dark.

What you’ll learn

  • What an LDR (light-dependent resistor) does.
  • How a sensor changes a circuit’s behaviour without you touching it.
  • A gentle introduction to threshold-style automation.

What you need

ItemQty~CostWhere to buy
9V battery + snap clip1GHS 23.00
Any supermarket or hardware store.
220 Ω resistor1GHS 0.75
Electronics shop or online (Amazon, Adafruit).
Look for red-red-brown stripes.
Red 5 mm LED1GHS 1.50
Electronics shop or online.
Any colour works; red is brightest.
Half-size breadboard1GHS 23.00
Online (Amazon, Adafruit, AliExpress).
Jumper wires4GHS 30.00
Online — usually sold in packs of 30.
LDR / photoresistor1GHS 7.50
Online — search "GL5528 photoresistor".
10 kΩ resistor1GHS 0.75
Electronics shop or online.
Brown-black-orange stripes.
Total~GHS 86.50

Build it step by step

  1. Build the basic LED loop

    Battery, 220 Ω resistor, LED. Same as Project 1.

  2. Drop the LDR in series

    Insert the LDR between the + rail and the 220 Ω resistor. In bright light it’s low resistance; in the dark it’s high.

  3. Test in light

    Snap on the battery. In a bright room the LED glows dimly — the LDR isn’t adding much resistance.

  4. Cover the LDR

    Cup your hand over it. The LED brightens noticeably as the LDR’s resistance drops away.

  5. Hmm — backwards?

    Right — this simple version brightens in light. To flip it, you need a transistor switch or comparator. Try Project 9 once you’re ready.

How it works

An LDR is a resistor whose value changes with light. In a dark room it can hit 1 MΩ; in bright sunlight it drops to a few hundred ohms. Wired in series with an LED, more light = lower resistance = more current = brighter LED. To make it work the other way (LED brightens in the dark), you add a transistor or comparator that flips the signal — the next-tier projects show how.

If something’s not working

LED is always on, never changes
  • · LDR is wired in parallel instead of series — current flows around it.
No change between dark and light
  • · LDR is shaded by your hand even in "bright" mode. Test with a flashlight beam vs covered.

Try this next

Swap the 220 Ω for a 100 Ω resistor — see how that changes the brightness range.

Tape a piece of clear plastic over the LDR. Does it still respond?