Arduino-Free Dark-Activated Lamp
Beginner25 minA night light with no Arduino and no code, built from just a 9V battery, a BC547 transistor, an LDR and a potentiometer: when it gets dark the LED lights by itself, and it goes out when the light comes back. With the potentiometer you set how dark it must be. It teaches three cornerstones of basic electronics: the voltage divider (the potentiometer and the LDR), the transistor as a switch that turns a large current on and off with a small base current, and limiting an LED's current with a resistor. You see how these parts, used in Arduino projects all the time, work without one.
Build it step by step in the appWhat you need
1 × Breadboard 830 Points (MB-102)
1 × 9V Alkaline Battery (6LR61)
1 × BC547 NPN Transistor
1 × LDR Light Sensor (5 mm)
1 × 10K Potentiometer
1 × LED - Red (5mm)
1 × Resistor 47 kΩ (1/4W)
1 × Resistor 470 Ω (1/4W)
6 × Jumper Wire - Male/Male
Wiring steps
- 1
Plug in the potentiometer and wire its ends

There is no Arduino in this project: the whole circuit is built in the bottom half of the breadboard and on the bottom power rails, and the battery goes on last. Plug the potentiometer's three legs into row E of the bottom half: left leg in column 4, middle leg in 5, right leg in 6. The legs may not sit firmly, so press them in well. Connect column 4 to the bottom blue (−) rail with a short black wire and column 6 to the bottom red (+) rail with a short red wire. The potentiometer now divides the 9V: as you turn the shaft, the middle leg's voltage moves between 0 and 9V.
- potentiometer left leg → column 4, bottom half
- potentiometer middle leg → column 5, bottom half
- potentiometer right leg → column 6, bottom half
- column 4, bottom half → the bottom blue (−) rail (black wire)
- column 6, bottom half → the bottom red (+) rail (red wire)
- 2
Add the 47 kΩ resistor

Lay the 47 kΩ resistor (yellow - violet - orange - gold) flat in row C of the bottom half: one end in column 5 (the potentiometer's middle leg), the other in column 9. Column 9 is about to be the transistor's base. This resistor limits the current going to the base, and with the LDR it sets the base's voltage.
- 47 kΩ resistor → columns 5 and 9, bottom half
- 3
Plug in the BC547 transistor

Hold the BC547 with its flat face (the side with the writing) towards you and plug its three legs into row E of the bottom half: the left leg, C (collector), in column 8, the middle one, B (base), in 9, and the right one, E (emitter), in 10. Connect column 10 to the bottom (−) rail with a short black wire. The transistor is a switch here: a small current into its base lets a much larger current flow from collector to emitter. Plugged in back to front the circuit does not work, so make sure the flat face looks at you.
- BC547 transistor C (collector) leg → column 8, bottom half
- BC547 transistor B (base) leg → column 9, bottom half
- BC547 transistor E (emitter) leg → column 10, bottom half
- column 10, bottom half → the bottom blue (−) rail (black wire)
- 4
Plug in the LDR

Plug one of the LDR's legs into row A of column 9 (the base) in the bottom half and the other into the bottom blue (−) rail, bending the legs a little to reach. An LDR has no direction; either leg can go either way. Its resistance falls as more light reaches it: in the light it draws the base's current to ground and keeps the transistor off, and in the dark its resistance climbs and the current goes to the base.
- LDR other leg → the bottom blue (−) rail
- LDR one leg → column 9, bottom half
- 5
Add the LED and the 470 Ω resistor

Plug the red LED's long leg (+) into column 17 in row E of the bottom half and its short leg (−) into column 16. Put the 470 Ω resistor (yellow - violet - brown - gold) from row A of column 17 to the bottom (+) rail. Connect column 8 (the transistor's collector) to column 16 (the LED's short leg) with a blue wire. The current flows from the battery through the resistor and the LED, then through the transistor from collector to emitter, and to ground. With 9V the 470 Ω lets about 15 mA through the LED: it shines brightly and comes to no harm.
- red LED long leg (+) → column 17, bottom half
- red LED short leg (−) → column 16, bottom half
- 470 Ω resistor (leg 1) → column 17, bottom half
- 470 Ω resistor (leg 2) → the bottom red (+) rail
- column 16, bottom half → column 8, bottom half (blue wire)
- 6
Connect the battery and set the threshold

Connect the battery last, once the circuit is built. Snap a battery clip with wires onto the 9V battery; most are sold with one, otherwise it is a separate purchase. Plug the clip's red wire into the bottom (+) rail and its black wire into the bottom (−) rail; if the wires are short or will not go into the breadboard, extend them with male-male wires. Now set the threshold: in the room's normal light, turn the potentiometer's shaft until the LED just goes out. Then cover the LDR with your hand: the LED should light. Left on through a night the battery lasts about a day; unclip it when you are done, as the circuit draws a little current even with the LED off.
- the bottom red (+) rail → 9V battery + lead (red wire)
- the bottom blue (−) rail → 9V battery − lead (black wire)
Arduino sketch
// No Arduino and no code in this
// project: the circuit runs by itself
// on a 9V battery.
//
// How does it work?
// The potentiometer divides the 9V: its
// middle leg carries 0 to 9V. That goes
// through the 47 kΩ to the transistor's
// base. The LDR joins the base to
// ground (−).
//
// In the light the LDR's resistance is
// low: it draws the current to ground,
// none is left for the base. The
// transistor is off, the LED is dark.
//
// In the dark the LDR's resistance
// climbs: the current goes to the base.
// That small base current switches the
// transistor on, a much larger current
// flows from collector to emitter, and
// the LED lights.
//
// Turning the potentiometer moves the
// point where it switches: you choose
// how dark it must be for the light.
What you will see
Once the battery is connected, the LED is either on or off depending on the room's light; find the point where it just goes out with the potentiometer. Cover the LDR with your hand or turn the light off and the LED lights by itself; it goes out when the light returns. If it gets dark slowly, the LED brightens slowly too: a transistor can also work between fully on and fully off. Turned one way the potentiometer makes the lamp light earlier, while it is still fairly bright; turned the other way, only once it is quite dark. If the LED never lights, first check that the transistor's flat face looks at you (C-B-E) and that the LED's long leg is in column 17, then check the battery clip and the battery. If the LED stays on all the time, turn the potentiometer the other way or make sure the LDR is not in shadow. Safety: never let the 9V battery's two terminals touch each other or a piece of metal; a shorted battery gets hot.
In the app, tick off every wire, match the parts to your inventory and pick up where you left off.
Build it step by step in the app