Sizing Capacitors for a dimmable LED light

Hi,

While i understand the general theory behind how a capacitor works I am not clear on how to calculate the amount of charge a specific capacitor can hold.

For example I have a Strip of 5v Neopixels, that the manufacturer says draws 7.5Watts

When i cut the power to the strip rather than turning off instantly I would like it to fade out over a 10 second period. Same when turning on to have the lights buffered by capacitors so that it fades in.

Fading in is easier as the arduino i will be using can manage that. but turning off will be a power switch so some storage charge will be needed.

So how do i calculate what size Capacitor to use for a given Power draw over for a set period of time?

I am thinking a Capacitor might not be the way to do this, seem would need a very large capacitor, but are there any better methods. I suppose i could use a rechargeable battery.

Problem / Requirements.

Once external power is cut fade down LED strip over ~10-20 seconds using stored energy. System will be cycled 2 or 3 times a day so any charge storage should be happy with multiple charge and discharge cycles. Current draw may be up to 5V / 5amps in final project.

Hi

The capacitor will dischage voltage over time. The time the LED will remain on depends on how much voltage you need to leave it on. If it stops working at, say, 4v, you'd need something like a 15F 8.4v super capacitor module dedicated to the led alone.
Also, it depends on the circuit your led module has.

Surely a battery would be a better way to do it as you can also control it for a while. I can't help you on this though, I never worked with a battery like this.

LEDs do not dim uniformly with voltage, and different colours have different working voltages. Once the voltage drops below the Vf for the LED it will be off completely, which will be different for different colours.

Maybe someone else can fill in the maths for you, it's over 40 years since I did this at college! The relationship you need is that a 1F capacitor charged (or discharged) with 1A will change its voltage by 1V in 1 second. Don't forget that with a purely resistive load the current depends on the resistance and the voltage, and that the voltage is changing.

As an order of magnitude estimate, the energy (Joules) stored in a capacitor is 1/2 C V2 where C is capacitance and V is the charge voltage.

You need something like 7.5 Watts for 10 seconds which is 75 Watt seconds or 75 Joules.

Starting with a 5 volt charge that would imply a 6 Farad capacitor assuming all the energy can be extracted from the capacitor which probably isn't practical for the reasons noted in the previous posts.

Cheers,

Looking at this it is now making a bit more sense, I was thinking there would need to be more circitory to manage the current flow / voltage but what is now very clear is that as the total strip might be pulling up to 8 amps to run for >10 seconds via capacitors alone would be quite a big ask.

So my thought of a controlled discharge of capacitors to do this is not practical. I think what i need is to like tadashimori suggest to use batteries and then detect the power disconnect and use them to keep the arduino running and dim the LED programmatically before halting the arduino itself.

Thank for the input guys appreciate you taking the time

Aaron

Beyond the issues others noted, because neopizels have their own pwm controllers, they cannot be dimmed by slowly lowering voltage - the controller would just suddenly stop doing its thing. Oh, and different colors of led have different forward voltage, and as a result respond differently to the lowering voltage.

But yeah, your new approach seems right. Why even disconnect it from power? (As opposed to a "power button" to which it reacts by turning the LEDs on and off?

Try this for sizing capacitors: Capacitor charge and discharge calculator | MustCalculate Try this for fading. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

DrAzzy:
Beyond the issues others noted, because neopizels have their own pwm controllers, they cannot be dimmed by slowly lowering voltage - the controller would just suddenly stop doing its thing. Oh, and different colors of led have different forward voltage, and as a result respond differently to the lowering voltage.

But yeah, your new approach seems right. Why even disconnect it from power? (As opposed to a "power button" to which it reacts by turning the LEDs on and off?

Only because i wanted to keep the control of the system under the control of the control of the Smart Life app that currently switches the power on and off each day. I actually was thinking of a slower power down than 10 second but that was a figure to start working to.

So i wanted to use the power off as a trigger, and then let the ardunio go though a number of functions before the power goes out completely. So actuly the dropping voltage would not dim the LED the arduio code does that. At the moment it shuts of the lights about 5 minute before the power is cut. This was a thought experiment to think if i could use the power off as the trigger instead.

Becasue of the issue of using Capacitors and not really wanting to use Battries as then need a charging circuit, needing the capacity and the fact they will eventual die, i will probable end up using my existing code, and take it off the Smartlife controller and have the Ardunio (or correctly ESP8266) keeping time via #NTP and just running its own schedule.

So yes using a residual charge would make things easy and consistent, apart from all the issues running in to doing it :slight_smile:

Well, I’m not sure as I’ve never tried this, but wouldn’t it work with a cheap power bank? You power the arduino and the led through the power bank, as you can directly supply it with the usb, and leave it charging.

IT would indeed, I only have one issue with this that the system will be left unattended and A power brick can have issues with charge / discharge cycles causing degradation of the pack and leading to failure.

Lithium batteries are not good when they go, and I don't want to risk a major fire hazard when I wont be near the Device

I know capacitors can have issues as well but not quite as drastic as burning lithium.

I know capacitors can have issues as well but not quite as drastic as burning lithium.

Either:
Seal them in a fire proof box or don't use lithium batteries, use lead acid or Ni-MH. You do need different charging strategies for each.

If mains power is actually available, use mains power.

Note that NeoPixels or similar, have a significant quiescent current (look it up!) so just commanding them to black and leaving them connected to a battery is a bad idea. But a relatively trivial draw on actual mains power.

Paul__B:
If mains power is actually available, use mains power.

Note that NeoPixels or similar, have a significant quiescent current (look it up!) so just commanding them to black and leaving them connected to a battery is a bad idea. But a relatively trivial draw on actual mains power.

This is not not using mains power. this is for a UPS like situation, the mains power gets cut and to shut systems down "gracefully", send some alerts and update etc.

I know i could do this all via Timings and code, and have the controler trip relays to equipment to power them on and off. In fact this is exactly what another system in a different locations does as the Controller always has power.

But in the current case the existing set up the power supply is controlled remotely on a timer, which when trips there is no mains power to "use".

This can of course all be changed a number of options. Here i was just looking at the option of using the timer tripping to initiate a graceful shut down using stored charge. With the ideal situation of once every thing is down power drains from system leaving a complete black out until the power trips back in.

DevilWAH:
Lithium batteries are not good when they go, and I don't want to risk a major fire hazard when I wont be near the Device

Considering the billions of lithium batteries that are being charged every single day across the world, and the world not being on fire, I don't think a lithium battery is a major fire hazard. A poor quality battery connected to an improper charger... that's a whole different story, but then the fault is still not with the lithium battery as such.

Considering the billions of lithium batteries that are being charged every single day across the world, and the world not being on fire, I don't think a lithium battery is a major fire hazard. A poor quality battery connected to an improper charger... that's a whole different story, but then the fault is still not with the lithium battery as such.

In fact battery fires from lithium are quite common. Especially in older batteries that have been through many charge cycles or either been held at high charge or over discharged.

As a Drone enthusiastic fires are quite common even without physical damage to the batteries, often happening during charge cycles and this is why also most people charge batteries with in flame retardant enclosures.

Multiple charging cycles cause both degradation in the charge a battery can hold and cause growth of lithium crystals that eventually can short out the battery and is what generally is the cause of battery fires in cases where no physical damage has happened (this is why we see Tesler's catch fire spontaneously, and phones setting fire in people pockets.

This is also why on all Lithium batteries it states "do not leave unattended while charging or in use"

If i wanted to spend a lot of money on next Gen batteries and high quality charging / monitoring circuits possible. But as this might be running for months in a remote location as Perry says Lead Acid would be a much more suitable choice.

MrMark:
Starting with a 5 volt charge that would imply a 6 Farad capacitor assuming all the energy can be extracted from the capacitor which probably isn't practical for the reasons noted in the previous posts.

You'll probably be able to find a supercap that can handle something like this. A constant current circuit to charge it up on switch on might be good.

However you'll need to arrange that the microcontroller isn't powered up till the Neopixels are upto voltage, or some sort of phantom-powering prevention circuitry is between the microcontroller and neopixels, otherwise your Arduino pin will be trying to charge the supercap through the neopixel input protection diodes...