I have a project where I need to first detect that the main power source have disconnected (I'm thinking of using a relay or similar) and then do some final tasks. In the first version this will only take a second or two but later I might need up to a minute. I don't want to use a battery because of the extra cost and complexity (and I don't need that much extra power). I'm thinking that a capacitor might be able to handle this but I'm not fully sure on how to connect it or if it will work. Anyone that can help me with a few tips?
Here is a circuit we propose to do this:
http://ruggedcircuits.com/html/circuit__13.html
--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Great, that is exactly what I am after!
Keep in mind that if cost (or extreme temperature) is a factor, supercaps aren't always the best route.
For example, Sparkfun sells a 5F Supercap for $5. Except that it is only 2.5V. So you'd need two of them to get to 5V. As with most capacitor technologies, you should have some headroom on voltage. So get three. Now you are up to $15 and down to 1.7F.
Maybe it is still cheaper than a small battery and charging circuit, but still worth considering.
OK you have a possible 'hold power for a little while' method/circuit. But I still haven't seen how you are going to detect that normal power is starting to go bye bye, so as to take advantage of the power holding circuit?
Lefty
I was wondering that, but I am guessing if you run "normal power" through a Schottky diode (to minimize voltage drop) and then the "normal" side of that diode goes to an Arduino pin. If the power goes off that pin goes low, but the board is still powered by the capacitor on the other side of the diode. An interrupt could take it from there, or just check in the main loop.
Rugged Circuits states a method of detecting the power out with no external components which should work.
Alternatively as Nick says, organize an input from "upstream" of the diode.
Rob
This video I just made shows how you can power an Arduino for over 30 minutes with a couple of ultracapacitors. Of course, charging them up takes time. But this could keep something going through a fairly lengthy power outage. The demo program "Game of Life" probably uses more power than a lot of applications, being LED-based.
An hour later it is still running, and has gone down to 4.6V (from a start of 4.9V).
The other thing you could do is put one of these between the capacitor and the board:
http://shop.moderndevice.com/products/jeelabs-aa-power-board
You could just wire the cap up to the battery terminals. There is a 5V version, which claims to work down to 0.5V, which would squeeze the last bit of juice from the capacitor. It says "The maximum output current is 60..150 mA, depending on input voltage.".
So depending on your application, that could be adequate to keep the thing running for hours. Combine this with the suggested charging circuit from Rugged Circuits, and the thing could self-charge (this might take a long time) but then when the power fails you are ready.
(edit) Still running two hours after it started. Voltage down to 4.4V.
(edit) Still running three hours after. Voltage down to 4.25V.
(edit) Still running after four hours. Voltage down to 4.1V.
Can you theory gurus clarify something for me?
According to the Rugged Circuits link:
The 100 ohm resistor limits the charging current of the 0.47F capacitor. It will take about 4 minutes of operating power to fully charge the capacitor, however.
I was trying to work out how long my 1300F capacitor would take to charge at 50mA charging rate (ie. 5V through the 100 ohm resistor) and using the formula given by Afrotechmods of:
I / C = dv/dt
thus:
0.05 mA / 1300 F = 0.000038461538462
so:
5V / 0.000038461538462 = 130000 seconds (36.11 hours).
But applying the same formula to the 470mF capacitor gives:
0.05 mA / 0.470 F = 0.106382978723404
so:
5V / 0.106382978723404 = 47 seconds
That isn't "about 4 minutes".
So I thought, ah well, back to the drawing board for me ...
But I checked here:
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capchg.html
Substituting in the caculator box for "Capacitor Charge Calculation" they also predict 47 seconds.
So am I doing something wrong, or is the Rugged Circuits page out by a factor of 5?
Formula t = RC gives you time to charge capacitor up to 63 % only,
5V x 0.63 = 3.15 V , that is not enough.
To charge it up to 90 % ( 4.5 V and above) will take more time,
wiki shows different coefficients:
like 1.4 (80%) or 2.2 (90%).
IMHO if someone multiply by 5 , it's just mean he wait till voltage hits ~95%.
Oh I see. So it slows down as it gets more charged. So typing in 5 RC on that page gave me a time of 235 seconds, which is 3.92 minutes. That makes sense now.
So my ultracapacitors will take 650000 seconds to charge to 95% which is about 7.5 days. Well that's nice to know. ![]()
Just for interest, 5 hours after I started the sketch is still running. The power is down to 3.9V.
So as a proof of concept, it appears that a couple of ultracapacitors can keep your sketch running for 5 hours. This particular sketch spends all its time lighting up LEDs, which is probably a bit of a torture test, comparing to monitoring temperatures etc.
The two capacitors I used cost me $US 32 (for both).
Whilst they take a while to charge, I think this is acceptable. After all, you put charged batteries in as a battery backup don't you, not discharged ones. Either you could organize a more sophisticated charging circuit, or just pre-charge them.
Something like this could keep a security system running for hours, even during a power outage. And if you double the number of capacitors, you double the time they will keep running. Coupled with the suggested power board, with its DC to DC converter, you could probably squeeze something like 8 or more hours of performance out of them (or 16 if you use 4 capacitors).
So what size cap is this?
Rob
2 x 2600 Farad caps in series.
Bloody heck, why not just use a truck battery ![]()
The question I would have is how does this compare to a more traditional back-up using batteries as far as initial costs, volume (size) used, and recharge time, etc. Most batteries have a pretty flat voltage discharge curve while the super cap would need some kind of boost voltage regulator to match battery voltage Vs time performance, which might be critical to some applications such as using analog input values where a changing reference voltage would hurt calibration accuracy.
So while super caps are interesting I haven't yet seem an application where a properly sized battery doesn't perform as well or better for less costs and space requirements. Super caps have been around for quite a while now, but I've seen few pratical applications for them, and I don't count the auto stereo installations where I think the visual appeal is more important then what they actual add to the systems performance. But then maybe I'm being too pessimistic? Show me the math. ![]()
Lefty
Capacitors are nice, I love them.
They have no substitute for supply a high current in short time-frame.
It's like a taser gun, or inductive cannon they try to build in NAVY.
Laser cannon is also based on capacitors discharge.
Unfortunately all this stuff is military game oriented.