
That little panel on top of a garden light makes electricity during the day. The light stores some of that energy in a rechargeable battery. After dark, the light runs from the battery until morning or until its stored energy runs low.
How does it know when it’s dark?
Some garden lights use the solar panel itself as the light sensor. While the panel is producing enough voltage, the control circuit keeps the LED off. When the panel’s output falls below a threshold, the circuit switches the LED on. Other lights use a separate sensor.
Why does it go out earlier after a cloudy day?
The battery usually gets less energy from a day with less sunlight. There’s less stored energy to use after dark. Moving the light under a bush can have the same effect, even if the spot looks bright enough to you.
For more on solar panels and batteries, see Basics of Electric Utilities 101.