It all started from spontaneous buy of small battery-powered toys that should function as night light. They are not bright, they slowly change color and look really nice. The only trouble are batteries of course. Stupid things are last for few-teen hours at best and then you suppose to get new ones. I recon the maintenance cost of such lights would exceed their original price after week or two, which is seems stupid.
Purpose of this project is to install supercap and charge it once before each night (presumably). Then they should work at least 2 hours. Ideally should be possible to charge them wireless, but for first attempt i'll do simple usb charging and focus on variable voltage-constant current driver
1. I overestimmated capabilities of capacitor i've chosen. Actually with current set at 50mA it is very bright, but for a very short moment of time. Under a minute to be more specific. I increased value of led series resistor 10 times (to 100 Ohms) and respectively current sens
resistor up to 10 ohms to keep current sense circuit work at the same levels. That increaset time few times (i'll explain below why not 10 times). That wasn't enough. Still just few minutes of work. Them once more 10 times bigger resistors - !k and 100 Ohm. Now it runs for 10-20 minutes depending on whether you count very low brightness as on of rather off.
I'm quite happy with the final brightness though, with 50ma set it was way to bright for night lamp.
2. Another design mistake is to think that boost converter would drive LED all the time. In fact to target lower currents LED would want lower voltage that cap has at the beginning on discharce cycle. Thats why boost converter just outputs same voltage that it has on the input, therefore making current sensor circuit to go over target and send back to FB pin much more than targeted 1,25 volts. Effectively at the beginning of discharge cycle only LED series resistor will control current until voltage drops to 2-3 volts (depending on current color), where regulation starts to work. But since cap energy is proportional to voltage squared, this means that most of the collected energy wasted before regultaion occurs. To fix this you would need to use buck/boost converter, but not this time probably
3. Not sure if that is how it suppose to be, but caps take ages to change to full voltage. It chrages quite fast to ~4 volts and then it needs minutes to get full 5 volts from usb. Again, could be just crap caps, i ordered them from seller with no reputation to mention:)
I've decided to skip prototype stage and order first version of pcd immideately. Reason for this is that i've prepared few other projects for pcb manufacturing ang could get this one almoust for free.
PCBs already came few days ago and already i found one design mistake. Two routes got connected unintentionaly. Luckily that one relatively easy to fix, just cut two routes and add one bodge wire.
Soldered myself, all by hand. Took around 30 minutes per piece.
First part is charging circuit. 10 Ohm resistor is limiting current taken from USB power source. Connected in parallel LED should indicate charging process.
Second part is MCP1640 boost converter driven by INA199 current shunt monitor. Here INA199 monitors current through 1R shunt resistor and as voltage from cap drops it sends higher feedback voltage to boost converter to boost it up even more. And this goes until cap is almost dried out (MCP1640 will work down to 0.35 volts on its input)
Few caps are added to keep rainbow led happy. They have internal switching circuits that require relatively stable power source, otherwise they stuck in first color and refuse to change.
Needless to say that this is not yet tested and require some adjustments.
UPD: i've updated schematicas since mistake was found. I put no current regulation resistor in series with LED, with that i effectively bound output of voltage regulator to forward voltage of diode. No regulation is possible.
Also updated some resistor values based on lated schematic updates
I think those rainbow leds have their own current limiting inside the chips that's inside the led. Having a constant current supply means the voltage across the led will fluctuate based on which color(s) are on. They also use PWM, which will make the voltage swing with the frequency of the PWM. That's probably why you need those output caps, to prevent the chip in the led from resetting.
I've tested mine, and red color got blown at around 100mA, now it is green only at ~30mA and not changing. Seems that mine don't have current limiting built-in. As for voltage - thats for sure, they have 1.5-3.3 voltage drop across them depending on color that is on.
I think those rainbow leds have their own current limiting inside the chips that's inside the led. Having a constant current supply means the voltage across the led will fluctuate based on which color(s) are on. They also use PWM, which will make the voltage swing with the frequency of the PWM. That's probably why you need those output caps, to prevent the chip in the led from resetting.