Power Arduino from Capacitor for 4 Seconds?

Hello,
I have this Arduino Powered LED light strip that uses Adafruit Neopixels. What I would like to have it do is when the power is switched off the lights go out in a fancy way, fading out or reducing the number of LEDs lit to nothing over a short period of time.

Here is my idea, the circuit uses a large capacitor to provide power for around three seconds, while the resistor combination on the right is used to monitor the power. Soon as power off is detected the Adrduino starts an LED shutdown function.

Any opinions? I'm thinking the circuit will be drawing about 400mA with all the LED's lit. How do I calculate the capacitor?

Thanks
Karl.

Is that 6v going to VIN? If so it's not enough as IIRC VIN needs at least 7v and you have 6v - a diode drop.

I don't think you need the diode anyway, the only other discharge path is the resistors and they can be quite large.

Does the 400A include the LEDs?

Graynomad:
Does the 400A include the LEDs?

I hope that includes the entire block!

Yes you can calculate the value of the capacitor if you know the things that GRAYnomad asks, but the answer you will get will be an unfeasibly large capacitor. So much so that it will take out the power supply when you first switch it on and get that huge current surge.

The minimum size of capacitor to hold enough current to power your system at 400mA for four seconds is easy enough to calculate.
Q = VC
Where Q is the charge in coulombs, V is the voltage in volts and C is the capacitance in farads.
An amp is a charge of one coulomb flowing per second.
Therefore .4A for 4 seconds is 1.6 coulombs. Assuming this needs to be at 5V then the capacitance you need is
1.6 / 5 = 0.32 F

But that is only the total charge you need, the snag is you need a certain minimum voltage to keep the system going. And that has to sit on top of that charge. So the real figure will be much higher.

While you can get capacitors that large you can't get them that will be able to produce the current density required.

Hello
Thanks for the replies. I'm using an Arduino Pro Mini 328 - 5V/16MHz so the power is OK, I have this working already with a normal on/off switch, I'm looking to add a fancy off sequence.

It also looks like I've badly underestimated the power use, the Adafruit web page says the LED's use about 2A/m with the LED's full on (but still less than 400A :-)).

I'll abandon that, I was looking at super-capacitors, around 10F, but they must be for keeping low power stuff going, like clocks.

Instead I'll look at a soft power switch, something like this: EEVblog #262 – World’s Simplest Soft Latching Power Switch Circuit – EEVblog

Thanks.
Karl.

Instead I'll look at a soft power switch, something like this: EEVblog #262 – World’s Simplest Soft Latching Power Switch Circuit – EEVblog

For normal power-down (not power loss) that's a better concept. Think about how a Windows computer shuts-down... The power switch doesn't directly turn-off power, it starts a shut-down sequence.

I'll abandon that, I was looking at super-capacitors, around 10F, but they must be for keeping low power stuff going, like clocks.

Yeah, I think those are low-current (high internal series resistance) because they seem to be used in those applications. But, I've never used one or looked into their characteristics. A r-chargeable battery might be better if you need more current.

One trick to making a capacitor last longer is to charge it to a higher voltage (on the input-side of the voltage regulator).

They do make [u]"real" 1F capacitors[/u] but they are large and expensive and like Mike says, you'll temporarily "short out" your power supply while it charges-up (although there are ways of reducing the charging current).