Supercapacitors for the Raspberry Pi

As versatile as the Raspberry Pi is, it has a weakness when it needs to be able to shut down properly during a power outage, especially when handling data-sensitive or industrial applications. To solve this problem, [Pavol Sedlacek] has created a supercapacitor-based UPS specifically for the Raspberry Pi that gives it enough time to properly halt its processes and shut down if it detects a power failure.

The device is called the Juice4Halt. It uses a DC-DC converter to provide power to the Pi from the normal power supply and to charge the supercapacitors during normal operation. It is bidirectional, so in the event of a power failure it works in reverse to take power from the capacitors and feed it back to the Pi. A second DC-DC converter handles power from an external power supply.

A side effect of using supercapacitors as a UPS is that they can also help the Pi survive brownouts. The project site has an incredible amount of detail about the functionality of the device, including circuit diagrams and the source code. We’ve seen other supercapacitor-based UPS units before but this particular one is much more robust and would be truly at home in any industrial or other sensitive setting.

45 thoughts on “Supercapacitors for the Raspberry Pi

    1. How about a version with a front-end DC-DC converter for the 44-60VDC range so a simple RJ-45 breakout adapter could enable the assembly to take power from a Power Over Ethernet cable?

      Or does PoE require intelligence at the end device to work properly? In which case, I’d like to see a properly PoE enabled version of the device.

      1. Given that the RPi does not support PoE, I think it would require another hardware (another ethernet port) on the board that supports PoE which would be needed to be interfaced to the RPi. Then you end up with a more power consuming device.

        1. There are really low cost dual RJ45 sockets meant to loop though and pull off PoE. It does clutter things up a little as you then need a very short patch cable from the PSU board to the RPi board.

          1. Or a PoE stripper with a male RJ-45 that can plug directly into the RPi, female RJ-45 to accept the cable bearing PoE voltages, and a twin lead to solder to the PoE voltage compatible supercap UPS board. That was kinda my proposal, which would only be scuttled if PoE requires intelligence at the device end, which the existence of simple, passive RJ-45 to RJ-45 + twin lead PoE power strippers would seem to belie.

            Anyone who read my first post above as describing a scenario where a PoE cable would be plugged directly into the RPi and then magic happens and the power is pulled off the RPi and fed to a PoE-voltage range supercap UPS was not reading very criticly.

    2. Sounds like you want a good UPS. I have an old SmartUPS 1400 behind my PC, it doesn’t have a problem soaking up momentary power hits and will last long enough on battery to do an orderly shutdown.

      The living room just has one of those small 400-watt UPSes that looks like an overgrown power strip. It’s mostly there to protect the equipment from power surges, but with the TV unplugged it can run the cable modem and lights for days.

    3. Batteries are still the way to go. Capacitors are not very good for the money as bulk energy storage. Batteries do fade, so you might need to replace your battery if it’s over three years old. If it was never up to your computer’s needs, you may need to get a UPS with a larger battery.

      Even this “juice4halt” thing can’t keep the power on the Pi going for very long.

      1. I believe the purpose is to give the device enough time to do a safe stop. Just shut the running processes, send a message somewhere to let someone know there’s a problem with the supply and shutdown.

  1. What’s the farad values of these caps? Supercaps can deliver a fatal shock if shorted, they are not the type of component you want on an exposed PCB as an addon for a product that’s sold as a computer for kids.

    1. A fatal shock? No way. Unless you get startled by the sharp sound, fall over and crack open your head on a sharp edge on your table. Please go back to reading Electronics 101 and come back when you know about ohms law.

      1. The two in series could do it. You need to have cut fingers or a good electrolyte at the contact point. A standard 9V cell can kill with a good connection to each hand.

        1. Please find a recorded death attributed to a 9v battery to back up that claim. I hear a lot of “well it COULD kill you” but have never actually seen a report of someone losing their life due to electrocution from a consumer battery.

      1. It’s got a 103A peak @ short circuit which ain’t bad. It’ll probably fix any dry solder joints by itself, and make some pretty sparklers if you’re lucky.

        It won’t kill you unless your acupuncturist is reckless and lets you hack while you’re jammed full of needles.

        1. Are you seriously saying that a capacitor charged to 2.5 volts suddenly increases the voltage because it’s opened? That’s the most stupid thing I read here in several hours.

          1. Sorry John, matseng is right. You must be thinking of an inductor. Capacitors don’t magically increase in voltage; and no theory will state otherwise.

            To a human, a 9V battery will deliver a greater shock than a 2.5V capacitor.

          2. So what is your explanation as to why they ship big capacitors with their terminals connected together? They have spare wire perhaps? Capacitors that are not connected to anything, ie no chance to discharge can develop horrendous charges all on their own particularly in dry (low humidity) climates. It is not likely to happen but that is not the same as doesn’t happen.

          3. John, this has to do with dielectric absorption. As the dielectric material “soaks” up the electric field and “lets it go” again. A 2.5V cap won’t self-charge it to huge voltages though … It’s in the mV range for those.

          4. OK, omitting the case of varactor capacty in diodes, or parametric microwave amplifiers, capacitors DON’T suddenly rise in voltage!
            A ‘supercapacitor will burn you a bit if shorted, no way is 6V gonna kill you, even if you stick it where the sun don’t shine…
            (Er,engineer here,with >35 years commercial experience…)

      1. I realize you’re probably lazy, but it only took clicking the first link to find the value:

        “2x supercapacitors 25F/2.7V/42mW, BCAP0025, HC Series, Maxwell Technologies”

        I’m skeptical about fatal shock, but I think it’s a good idea to have an enclosure anyway.

        It’s not the voltage that kills though, it’s the current. If it’s stopping the heart, that current would have to pass through the heart some how.

        1. Those things can hold a very low voltage, 5 V when in series. Even if they have a massive capacitance behind, 5 V can’t really create a high current through your body. This is way less dangerous than messing with a car battery. Let’s calm down, seriously.

  2. All of the shut down circuits I have seen have the problem of not knowing if the Pi has shut down. The only way I have found to do that is to monitor the video out line, that only disappears once shut down is complete. Any other method runs the risk of removing power before shut down is complete.

    1. If the serial console is enabled in linux it will send a “Power Down” message on the UART pins when it is ready to shut down so you could monitor those pins and wait until the message appears.

    2. You can also monitor the UART TX pin (pin 8 IIRC). That pin goes high on bootup and stays high until the operating system has completed shutdown. I used a microcontroller and a 5v relay to handle Pi shutdown with an IR remote using this method.

    3. No, you have a script running background on the Pi. A GPIO pin signals ‘panic!!!’ ant the script just runs “shutdown -h now”. If script is in /etc/init.rc,it’s rooted,no need for sudo.
      Lookup ‘SleepyPi’ for how to do it.

  3. Don’t forget that the BBB has all the bits in place on board to do this with a small LiPo cell:

    http://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone/blog/2013/08/10/bbb–rechargeable-on-board-battery-system

    All you need to do outside of adding a battery is set up a daemon to poll the PMIC for the current power source and initiate a shutdown when it switches from USB or AC to battery. The PMIC can also be set to sequence power back up once external power is reestablished. The downside is the +5V rail will go down whenever input power drops so if you’re using +5V for a shield or USB device you’ll want to always shutdown when power is lost instead of setting a timeout to let it ride through temporary power loss.

  4. i just HAD to add to the discussion of opening a (supercap) while it is charged.

    it WILL increase in voltage.

    you put 2v in, then WHILE charged increase the distance between “plates”
    and you now have a greatly reduced farad storage. seeing as you can get more farads by decreasing the distance (but it may fail at higher voltage)

    well farads times voltage equals charge. if we reduce farads, voltage goes up.
    its like a transformer.

    and YES you CAN make a mechanical volatge converter using an adjustable capacitor and a fancy contacts andor diodes, dont forget the motor and insulation is important or charge will bleed off quicker then you can move the plates.

    the fact that it is a supercap only means the charge you can start with is, well, super-sized.

    only issue i can see to getting schocked is the air.
    it is the insulator that holds the actual electrons and thus might be dissipated as it is opened to atmosphere? so making it into a transformer would be difficult.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.