14. Solar: the light runs off-grid
Step 14 of the automatic light: The adapter is replaced by PV1 (20 W) → U5 charge controller → BAT1 12 Ah, and the light runs from the controller’s LOAD output through D1 and SW1 as before. A 9 W lamp for a total of a couple of hours of motion a night is a few Wh; one sunny day of a 20 W panel is about 80 Wh. Component 14 of 14: the solar panel, charge controller and battery. A solar panel makes current in proportion to the sunlight; it is a current source with a voltage that sits near 17–18 V when loaded. A charge controller turns that into the right charge for the battery and stops it overcharging; its LOAD output disconnects the load before the battery runs flat. A LiFePO4 battery stores the day’s energy for the night.

Build it in the labGuided build, test sheet and fault finding, free in your browser.
Parts list
- Solar panel
- Solar charge controller
- LiFePO4 battery
- Schottky diode
- 2 × Toggle switch
- 2 × Electrolytic capacitor
- 10 × Resistor
- LED
- 7805 regulator
- 3 × Ceramic capacitor
- Photoresistor (LDR)
- 4 × NPN transistor
- LM339 quad comparator
- Potentiometer
- PIR motion sensor
- 555 timer
- Active buzzer
- Relay
- Rectifier diode
- 12 V DC LED bulb
Test procedure
Each test has an expected value and a pass range, like a factory test sheet:
- Daytime: the panel charges the battery
- Night, movement: lamp on from the battery
How it works
The solar panel, charge controller and battery. A solar panel makes current in proportion to the sunlight; it is a current source with a voltage that sits near 17–18 V when loaded. A charge controller turns that into the right charge for the battery and stops it overcharging; its LOAD output disconnects the load before the battery runs flat. A LiFePO4 battery stores the day’s energy for the night.
Reading it. Panel: W, Voc (open-circuit voltage) and Isc (short-circuit current) on the back label. Controller: rated amps and the battery type it is set for (LiFePO4 here). Battery: V and Ah; 12.8 V × 12 Ah ≈ 150 Wh.
Testing it. Panel in sun, unloaded: Voc on the meter (about 21 V for a “12 V” panel). Battery at rest: 13.0–13.4 V when charged. Always connect the battery to the controller first, then the panel.
In the build. The adapter is replaced by PV1 (20 W) → U5 charge controller → BAT1 12 Ah, and the light runs from the controller’s LOAD output through D1 and SW1 as before. A 9 W lamp for a total of a couple of hours of motion a night is a few Wh; one sunny day of a 20 W panel is about 80 Wh.
Builds on lesson 13: everything from before is still there.
Things to try
- Set the panel’s sunlight to 0 and to 850 W/m² and watch the controller.
- Lower the battery’s charge to 10 % and see the controller cut the LOAD output.
Background
One circuit, built up one part at a time: by lesson 14 it is a solar-powered, dusk-sensing, motion-triggered timed lamp with an alarm.