Raspberry PI UPS

From Electriki
Revision as of 13:20, 26 October 2013 by Jan Goofy (talk | contribs) (Version 0.1 of page - work in progress)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

UPS for Raspberry PI

The concept

If you have a Raspberry PI running as a server, or just like it to keep running during power-outs/burn-outs, you will need some kind of battery backup.

Now the easy solution would be to just plug in the mains adapter into a ordinary UPS, if you already have such a device keeping other hardware safe, all good, but if not this would not be an ideal thing to do. The Raspberry PI use very little power, less than 5 W. an UPS will quite easy use that in idle, thus double your costs of running it. I know, I know, 5 W 24x7 is 43.8 kWh / year, depending on prices around the world, it is about one visit to BurgerKing with sideorders. but still, why should it cost 2 times that? :)


The solution

If not doing the backup on mains, but directly on the 5 V USB, we will save quite a lot (relatively..) on switching losses from mains -> 5 Vdc One aproach would be to just whip up some batteries, a charger circuit and interface circuit to the USB input on Raspberry PI, a so-called on-the-line UPS. This means that the mains->USB charger is connected to your battery-bank that in turn is connected to the Raspberry PI. When mains goes away, the batteries will keep everything running.

Losses is of course still a "problem" but they can be made to be much less, it will be whatever your interface circuit needs to operate and regulate a 5 Vdc output and what your charger circuit needs to keep the batteries charged ( Trikel-charge(tm) ).

Searching for ideas for the circuits, I stumbled oppon this beauty: The Romoss Sofun 1 - this device is meant as a on-the-road extra battery pack for your phone, mp3-player, tablet or other device that runs of 5 Vdc. Found one on ebay for 6.29 UKP. not bad, assuming batteries are not made of wet cardboard and vinegar.

After only 10 days, the package was in my hands, lets connect this baby up! the connectors even fit directly, unplug charger from Raspberry PI, connect that to Sofun, connect cable that came with sofun from sofun to Raspberry PI, how easy.

The problem

Surely, I was naive to think this would go so easy. And yes, there was a problem:

When disconnecting the USB cable from charger to simulate a power-loss, the sofun takes a few mSec to switch over to batteries, enough for the Raspberry pi to reboot due to low voltage...

Right boys and gals! its electronics time!

First up: measure the drop-out time and how long the Raspberry PI can run of the on-board 220 uF on the 5 V rail.

As