A Few Words About How the Circuit Works
Inspired by a recent post about a budget Chinese emergency lamp, I decided to design my own circuit from scratch using the minimum number of components I could find in my scrap box.
The purpose of this circuit is simple: to charge a lithium battery while keeping it within its voltage constraints during daylight and to power an LED (LD4) in the dark, without over-discharging the battery.
Below is the link to the circuit simulation I created on Falstad.com (thank you, Paul!). Feel free to experiment with the values and observe how the circuit operates:
-----
Charging
When the sun shines and the solar panel generates sufficient voltage, the circuit charges the battery (simulated by a capacitor). Refer to the diagram below:
The current passing through the 2.2k resistor (R2) drives the transistor Q1 into saturation. This allows current to flow from the collector to the emitter, charging the battery. Once the battery charges sufficiently and the emitter voltage reaches V_LD3+V_DZ1−VBE, the transistor stops conducting. With an appropriately chosen Zener diode and LED (I had to make some adjustments by selecting the appropriate Zener diode and the correct LED color), this should occur at approximately 4.2V.
It’s important to note that the battery will still be charged slowly through the 47k resistor, but the resulting current is small enough not to damage the battery.
The PNP transistor on the right (Q2) remains in cut-off because its base voltage is always higher than its emitter voltage. This ensures that the main LED (LD4) remains off as long as the solar panel is illuminated.
-----
Discharging
When the sun goes down and the battery is charged, the light will turn on. See the diagram below for reference.
This occurs because the current from the battery flows through the emitter-base junction of the PNP transistor Q2, then across the 2.7k R1 resistor and two LEDs (LD1 and LD2). This drives the transistor Q2 into saturation, allowing current to flow freely through its collector, which powers the white LED (or a chain of LEDs, in my case) that provides the "fairy light" effect. When the battery voltage drops below 3 volts (depending on the components chosen), the voltage divider formed by the 2.2k resistor (R1) and the two LEDs (LD1 and LD2) first drives transistor Q2 into the active region, then into cut-off, reducing the discharge current. Eventually, the battery discharges very slowly through R3, R1, LD1, and LD2, with a current of only a few microamperes.
Along with the simulation, it's useful to test the circuit in real life using a capacitor instead of the battery. This lets you verify the voltage levels and fine-tune the components to suit your specific needs, such as considering battery specifications (min and max voltage), output current requirements (set by R1 and R4), and the characteristics of your solar panel.
My final circuit is the following:
Have fun!
"assembled from scrap parts" 👍