Image by Jeremy Cook
Lights that turn on automatically at night are increasingly popular and often contain their own energy capture and energy storage capabilities. Landscape lights, yard decorations, and security lighting can all fall into this category — anywhere you’d want light without running wires.
A solar panel typically charges a battery that powers an LED light. A charge controller ensures the solar panel properly charges the battery, and a DC-DC LED driver circuit connects the battery to the light. An ambient light sensor alerts the system when it’s dark enough to turn the light on, and to turn it back off again as the sun comes up.
Advancements in solar panel energy capture, battery storage, and LED efficacy, combined with cost reductions across all three, enable increasingly capable and cost-effective versions of these products. Whereas solar-powered lights once dimly lit a pathway for a few hours, they can now fully illuminate it for the entire night.
As supercapacitors’ energy storage has increased and costs have decreased, we are seeing them used as valid alternatives to batteries in certain applications (primarily fast/high discharge applications). They offer benefits in maintaining storage capacity over charge/discharge cycles and can charge and discharge faster than many battery technologies. This article demonstrates these concepts on a small scale by building a solar-powered supercapacitor ATtiny microcontroller lighting circuit that activates when it is dark.
From this small demo, one could branch into IoT systems. It would be possible to substitute an ESP32 or other wireless-capable device for the ATtiny45V used here, potentially using additional components like a charge controller or DC-DC LED driver. These additions could enable basic IoT functionality for a user interface, color coordination and scene setting, or to set lights to come on automatically.
Solar supercapacitor energy storage acts as a dark-on switch
![0923-ATtiny45-and-LED-circuit-activated-under-supercapacitor-power](/-/media/arrow/images/miscellaneous/0923-attiny45-and-led-circuit-activated-under-supercapacitor-power.jpg)
Image by Jeremy Cook
In this previous article, we explored using an LDR to sense external light. With the addition of a diode and a PNP BJT transistor, a solar panel can charge supercapacitors (or a battery) or be used as a switch for an LED or microcontroller. Landscape and security lighting use this type of charge/switch setup.
The circuit diagrammed below uses a photovoltaic cell (PV) — ideally rated for 5.5V, though this can vary — to send power to a bank of two identical 10F, 2.7V supercapacitors via a diode. These series-connected supercapacitors have a combined potential of 5.4V and a capacitance of 5F. The diode means that current can only flow to the capacitors from the PV but can exit the capacitors through the transistor to power the ATtiny/LED circuit.
![0923-Supercapacitor-solar-ATtiny45-lighting-circuit](/-/media/arrow/images/miscellaneous/0923-supercapacitor-solar-attiny45-lighting-circuit.jpg)
When the panel voltage (and thus, light level) reaches a maximum, it charges the supercapacitor battery to this maximum, minus the voltage drop of the diode. When the panel output then dips below the system’s voltage threshold, the supercapacitors (and emitter) are sufficiently positive with respect to the panels (and base), allowing current to flow from the base and switch on the transistor.
With the transistor activated, current can also flow from the emitter to the collector and thus power the ATtiny45 and LEDs. The solar cell, in conjunction with the supercapacitors, diode, and (2N3906) PNP transistor, acts as both a sensor and charging apparatus.
The project code is found here. More information on programming the ATtiny is available via this tutorial, though it uses the Arduino 1.x IDE. If using the newer 2.x IDE, you’ll want to select the ATtiny45 as your processor and Upload Using Programmer, as shown below.
![0923-Programming-ATtiny45-with-ArduinoIDE](/-/media/arrow/images/miscellaneous/0923-programming-attiny45-with-arduinoide.jpg)
Efficient design with supercapacitors
Unlike LiPo batteries, supercapacitors can be charged at practically any rate and discharged fully without issue. There is no need for battery charge management circuitry and the corresponding losses. Efficiency is especially important for solar power applications. Cutting down on a few components in this simple application can mean sizable monetary and efficiency savings on a percentage basis.
The ATtiny45V, for its part, can operate between 1.8V and 5.5V, which is almost perfect for the range of voltages provided by the supercapacitors. As seen in figure 22-4 in the ATtiny25/45/85 datasheet, current usage varies depending on the input voltage level, but this will be under a single milliamp for the majority of the time the LEDs are active. As LEDs consume somewhere in the 20mA range, using the ATtiny45V to blink them on and off should actually save power versus having LEDs on at all times.
What’s presented here is a prototype, and its operation could be further optimized. You might consider using a P-channel MOSFET instead of a PNP BJT transistor or modifying the resistor values used in the circuit. PWM could be used to dim the brightness of each LED, potentially even compensating for different charge levels. Finally, various low-power methodologies could be implemented on the ATtiny45 to save power.
Taking supercapacitor energy storage further
As a real-world example of remote power via solar, the We Care Solar Suitcase provides power for lighting and phone charging for remote clinics in a portable package. This type of portable power package could also act as a wireless hotspot, allowing for communication with remote medical personnel and even device telemetry monitoring (e.g., battery life, tool status, supplies usage). A dashboard could also show the status and location of solar suitcases in the area, allowing for enhanced distribution of resources during an emergency.
While small-scale solar isn’t appropriate for every situation, it does have a wide range of practical uses. It’s also a very approachable technology, allowing designers to experiment with generating power from the sky and energy storage. Add in wireless connectivity and IoT concepts, and the sky is the limit!