Skip to content

⚡ Electricity

Transistor night-light

Use a light sensor (LDR) and a transistor to build a light that switches itself on when it gets dark.

⏱️ 50 min🎂 Ages 13–15📈 hard
  • Problem solving
  • Creativity
  • Computational thinking

🧰 You will need

  • 1 × NPN transistor (BC547 or 2N2222)
  • 1 × Light-dependent resistor (LDR)
  • 1 × Resistor assortment (100 Ω to 100 kΩ)
  • 1 × LED (5mm, any colour)
  • 1 × 9V battery
  • 1 × 9V battery clip with wires
  • 1 × Solderless breadboard
  • 8 × Jumper wires
  • 1 × Digital multimeter

🌙 A circuit that decides for itself

Street lights switch on at dusk without anyone pressing a button. Inside is a sensor that measures light, and a transistor: an electronic switch that a tiny current can turn on and off.

🎮 Try it on the screen

Drag the light level down to “dark” and watch the base voltage and the LED. Then change the top resistor to adjust the sensitivity.

+9 V0 V10 kΩLDR 7.9 kΩbase 0.75 VLEDNPN

Dark enough: the base is above 0.7 V, so the transistor switches the LED ON. 💡

🛠️ Build it for real

  1. Check the LDR with the meter on Ω: cover it, then shine a light. Its resistance swings from about 1 MΩ (dark) to about 1 kΩ (bright).
  2. Voltage divider: 9 V + → 10 kΩ → a node → LDR → 9 V −. The middle node goes to the transistor’s base through a 1 kΩ resistor.
  3. Transistor: emitter (E) → 9 V −. Collector (C) → LED cathode (short leg).
  4. LED anode (long leg) → 470 Ω → 9 V +.
  5. Connect the battery and cover the LDR with your hand: the LED turns on! Uncover it: off.
  6. Measure the base voltage in light and dark. Does it cross about 0.7 V when the LED switches?

Tip: BC547 and 2N2222 have different pin orders. Look up your transistor’s pinout first.

💡 What happened?

The 10 kΩ and the LDR share the 9 V like a seesaw. In the light, the LDR’s resistance is low, so the middle node is near 0 V. In the dark, its resistance is high, so the node voltage rises. Once the base reaches about 0.7 V, a small base current flows, and the transistor lets a much bigger current flow from collector to emitter, through the LED. That’s amplification: a small signal controlling a larger one.

🏆 Challenge

Swap the 10 kΩ for a 47 kΩ, or a variable resistor (potentiometer), to make the light turn on at exactly the right darkness. Then work through the design challenge sheet and package your night-light in a box!

Did it work?

🖨️ Printables for this experiment