TwiddleLab / Physics / Circuits You Can Build
Project: Smart Night Light
What you will learn
- An LED needs a series resistor: R = (V_battery - 2 V) ÷ current.
- An LDR at the bottom of a divider gives a voltage that rises in the dark; the fixed resistor sets when it switches.
- Battery life = capacity ÷ current: 2000 mAh at 20 mA is 100 hours.
How the lesson goes
Build a night light that knows when it's dark. Here is your friend's attempt. Run a day.
First the light itself: an LED on a 9 V battery, at most 20 mA.
Drag a resistor into the slot.
Exactly which resistor gives the LED 20 mA from 9 V? It uses 2 V.
Series: the resistor gets 9 - 2 = 7 V. Ohm's law: R = 7 V ÷ 0.02 A = 350 Ω.
Now the brain: place the LDR and the 25 kΩ resistor so the voltage RISES in the dark.
The night light switches on above 3 V. Test with the light dial.
It is sunset (30% light). Pick the top resistor so the output is right at 3 V now.
Fix your friend's night light from the start.
Tap a part to take it out, then put it in the right holder. Test with the light dial.
Game: 24-hour test. On all night, off all day, and the battery must last a week.
A 1500 mAh battery for 7 nights allows about 10.5 h of light a night at 20 mA.
Challenge: a stair light with a switch at the bottom and at the top. Make both work.
Draw two wires between the switches, then flip each switch to test.
Each two-way switch connects its middle to one of two contacts. With the two pairs of contacts joined, the loop is closed when both switches point the same way and open when they differ, so any single flip changes the light.
Code: sort the four switch positions of your stair light into light on and light off.
Both switches start up, with the light on.
You want the night light to come on a little earlier, while it is still a bit brighter. Tap the part to change.
The switch point is where R_LDR = R_top. A smaller R_top is reached by the LDR at a brighter light, so the light switches on earlier in the evening.
Your LED draws 20 mA for 10 hours a night. How many nights from a 2000 mAh battery?
Battery capacity in mAh is current × hours: 2000 mAh ÷ 20 mA = 100 h, and 100 h ÷ 10 h = 10 nights.
Your night light against your friend's: one day side by side.
Previous lesson: Sensors: Resistance That Changes · Part of the course: Circuits You Can Build
Lessons are interactive and need JavaScript. Turn it on to play them.