The emergency light that turns on when the power dies
Three white LEDs that switch on from a battery the moment the wall adapter loses power, and charge it while it's plugged in.

Free build sheet
The parts, every wire with its length and bend points, a bend guide, both sides of the board and checkboxes to track your progress. Print it or keep it open at the bench.
Open the build sheetWhat you need
14 parts on a perfboard 15 × 27 holes, plus hookup wire.
| Qty | Part | Where to buy |
|---|---|---|
| 2 | Diode (axial)1N4001 D1, D2 | |
| 2 | Power Input (2-pin) J1, J2 | |
| 3 | LEDWhite LED1, LED2, LED3 | Buy LED on Amazon |
| 1 | PNP Transistor (TO-92) Q1 | |
| 1 | Resistor (axial)150 R1 | Buy Resistor (axial) on Amazon |
| 1 | Resistor (axial)330 R2 | Buy Resistor (axial) on Amazon |
| 1 | Resistor (axial)1k R3 | Buy Resistor (axial) on Amazon |
| 3 | Resistor (axial)100 R4, R5, R6 | Buy Resistor (axial) on Amazon |
Check every pin against the datasheet of the exact part in your hands before wiring.
As an Amazon Associate I earn from qualifying purchases.
Cut list
5 wires, 152 mm (6.0 in) in total, in the order the build sheet cuts them. Wire numbers match the build sheet. Each length includes 5 mm per end to go through the hole.
| Wire | Colour and net | Length | ||
|---|---|---|---|---|
| 5 | BlueGND M12 → L25 | M12 → L25 | 46mm | 38mm (90°) |
| 4 | GreenGND L3 → F3 | L3 → F3 | 25mm | Straight |
| 1 | RedBAT C6 → J6 | C6 → J6 | 28mm | Straight |
| 3 | WhiteGND L11 → L5 | L11 → L5 | 25mm | Straight |
| 2 | YellowLAMP K16 → K9 | K16 → K9 | 28mm | Straight |
About this build
An emergency light that turns on when the power dies. While a regulated 9V DC wall adapter is plugged in, it trickle charges four NiMH cells through a 150 ohm resistor and keeps the light off. Pull the adapter and three white LEDs light from the battery, for about forty hours.
The switch is one 2N3906 PNP transistor. With the adapter present, a divider holds the transistor's base above the battery voltage, so it stays off. When the adapter dies, the base falls to ground, the transistor saturates and the LEDs come on. Two 1N4001 diodes stop the battery from feeding back into the dead adapter.
It's low voltage DC only: the 9V adapter and four NiMH cells, with no mains voltage anywhere on the board. Each LED has its own 100 ohm resistor, and it all fits on a 15 by 27 perfboard.
More builds
See all builds
VideoThis lights an LED from a dead battery
One transistor and a hand wound coil that light a white LED from a nearly dead 1V cell. Six parts.
6 parts · 9 wires
LightsPower
VideoOne knob dims a 12V LED strip. No code.
One knob dims a 12V LED strip. A 555 timer makes the PWM and a MOSFET switches the strip. No microcontroller, no code.
12 parts · 22 wires
LightsPower
VideoThe Stranger Things light wall, from two chips
Six coloured LEDs light one at a time in a loop, like the Christmas light wall in Stranger Things. A 555 timer and a counter.
13 parts · 28 wires
LightsTimers and logic