Some time ago I had the idea of building a LED lamp that was solar powered, harvesting the Sun during the day and charging the battery, while at night deliver some light. The idea was to extend the hours of light of my peppers during the winter, once the vase was inside the house.
For the initial design I wanted to use two old Ni-Cd batteries and for this supply voltage I would need to use a low voltage oscillator circuit as the minimum voltage would be around 2.0V. The converter would be a boost converter since the Luxeon K2 I had were rated for minimum 2.79V. I started by using a general Boost converter design procedure, and then simulate the circuit in gEDA/SPICE/ngspice.
I stumbled in two problems:
- after some tries with simple transistor oscillator circuits, low voltage comparators, and PWM modulators I decided to use a micro-controller. The biggest problem was the low voltage, even the low voltage circuits shut-down at 3.0V. Then I decided to use a low-voltage micro like the ATTiny45U capable of operating from 1.8V.
-The booster wasn't working, the LED was conducting slightly when the oscillator was off, a known problem with boosters, if the load consumes power at the input voltage minus a diode drop the circuit is always draining the battery.
Finally I decided to redesign the circuit using a 3 element battery, this time a scrap battery from a mobilephone Li-Mh with 3.7V, this would ease the micro selection (Attiny15L that I used before) and I had to change the type of converter to a SEPIC, that allows the use of a battery with a voltage close to the LED conduction voltage. The circuit has the advantage of being capable of boosting or dropping the input voltage, this application note and this one are quite useful for the design phase. Since the load is an LED I allowed a bigger fluctuation in the inductor currents and of the output current, then I chose the operating frequency function of inductors I had available.
Again, after calculating the circuit components I drew a circuit in gEDA and simulated the circuit. As a general design procedure the circuit I use to simulate is very different from the one that I'll build in the breadboard/PCB.
I placed some components inside green boxes to simulate real inductors with series resistance and real capacitors with series resistance. The voltage sources with zero voltage in some branches allow measurement of the current in the branch. I could not find the correct MOSFET (IRLD024) model, instead I used the model (IRFD024) of a similar one but with a different Gate Threshold Voltage. Also as a common procedure to minimize size of the files and speed up processing, I create a smaller library file, containing only the models used. I wanted to show a waveform but since I updated my OpenSuse install to 11.2 I'm unable to print ngspice plots...
After verifying that the circuit worked, I designed the final schematic with the micro-controller and the voltage dividers of the various analog inputs.
The software was straight forward, start the high speed oscillator, start the PWM generator, read voltages, take decisions and increase/decrease PWM output. One note worth mentioning is that the ATTiny85 and the ATTiny15 have two input ports exchanged (Port PB4/PB3 - Pins 2/3) although the ADC inputs are the same!
Here is a couple of pictures of the circuit, the first charging and the second working.