UPS for Raspberry Pi (Zero W)

As I've experienced a couple of power outages where I live recently, I was wondering if anyone here has experience with a UPS solution for the RPI. I've been googling and came across a number of options such as PiJuice etc, but I'd rather hear some real life experience and reviews. (FWIW, I run a Pi Zero W with a copper heatsink on the processor, height is approx 48mm)

Thanks in advance for your input!

I put all the network equipment on a full size UPS. If the router is down on power loss the Pi-hole is effectively down whether it has power or not.

Router, modem, switches, Pi-holes, NAS and home automation hub on the UPS.

You could use a simple powerbank

A simple powerbank isn't fit for the job: The RPi would just drain the initial load from it before failing, and it may never wake up or go into a loop of short periods of activity and outages afterwards.
You'd need at least a charge-through model that's capable of both charging itself and supply the RPi at the same time. In additon, some powerbanks may not even provide power at all to low amp devices like a Zero.

Also, jfb is right: In the actual event of a local power outage at your house, it's of little use to have just Pi-hole as the last device standing all by its own.

And a powerbank would still lack another feature of a proper UPS solution: Custom circuitry like PiJuice comes with the added advantage of allowing the RPi to shutdown gracefully before the battery expires.

Similar should be possible with regular UPS equipment, provided you find Linux support for your specific UPS, e.g. http://www.apcupsd.org/wordpress/about/.

Thanks for the replies so far!

Correct, the goal I had in mind is to avoid sudden supply outages negatively affecting the SD card. I can live with not having a working network for a bit tbh.
A charge-through device would then be the minimum of requirements if this would exist, with the capability to supply the low currents drawn by the RPI0W for a period of say 30 min - so say 0,4 Wh would be sufficient. The additional possibility of having a 'graceful' shutdown would then probably not even be needed, but why not.

Any experiences with a PiJuice?

$75 for a PiJuice puts it more expensive than many full UPS. Ouch.

A 1350 VA UPS is $85 US on sale.

That is what in my understand a powerbank is able to do. Charging & suppying at the same time.

Most powerbanks won't support charge-through, which is not surprising given the usage scenario they've been designed for:
They are meant to charge a portable device in the absence of power sockets.
When a power socket is available, you wouldn't need the powerbank - you could charge your mobile device straight from that one.

Even for those models that support charge-through, I doubt that they are meant to be operated under continuous load. I'd expect battery lifetime to suffer if they are.

Well, a graceful shutdown is the only reliable way to avoid that, and you won't get that with a powerbank solution.
Besides, you will get quite a few sd cards for the price of either UPS purpose gadget.

If you're really keen on this, I'd research available RPi-specific UPS solutions instead. They may not even be that much more expensive than a powerbank, and some may even offer additional benefits like a graceful shutdown power button. Cheaper models like Waveshare's UPS HAT may focus purely on UPS.
I have zero experience with those myself, but I recall German ct magazine has done a feature article on UPSs some years ago. Maybe that's still available. :wink:

Im using an 12 Volt inverter a $5 car battery and charger.
Did a test today it lasted over 30 mins to approx state of charge 50% of battery.

1 Like

I like your setup @smokingwheels

What inverter are you using and where could you get a decent battery for $5?

The inverter, was about $35 off ebay.
The Battery, I put a wanted ad on local buy and sell on Facebook for old car batteries.
The charger, is a pulse repair one approx $35 off ebay.

I looked into this question extensively after the pihole I deployed at my brother's had its microSD card corrupted by a power outage. I don't have this problem because I keep my networking equipment on commercial UPSes meant to run computers as others have mentioned. With networking gear attached even a relatively inexpensive one runs a very long time.

The short answer and easiest way to do what you want is to just buy a power bank that has "pass-through" charging, meaning it can charge itself and charge something else simultaneously. Sure it won't have automated shutdowns but that's a lot more work and due to the low draw of a pi it'll have a pretty long runtime which will surf out 99% of power outages. This power bank here is thus a $20 solution:
https://smile.amazon.com/Portable-10000mAh-AUKEY-Smallest-Delivery/dp/B08H8KKW5Q

If you want to really do a proper UPS for the PI here are a bunch of articles you might be able to replicate or purchase if the hardware is still available:

Probably the best one Raspberry Pi UPS by using a USB power bank

and here's a power bank sold for this USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs ID: 1566 - $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Note that some battery packs turn off with low draw. I have one that always turns off if I put a low-draw device (for example a bluetooth headset), but I have another one that claims to have a mode to prevent that problem (I haven't ever wound up testing that however). Not sure if you can find a pass-through unit that also has the low-current capability but it seems likely. Another solution is Battery Pack Load

Good luck!

I've in the mean time found a powerbank which supports passthrough charging (and has sufficient capacity at more than 10000 mAh to support the Pi Zero for a bit). That should at least cover short outages and protect the SD-card in those cases.

Excellent info, thanks! Will follow it, and that should cover for longer outages. Thanks!

One of the coolest things I had happened upon was a USB wall wart that also had a couple secondary batteries in it. So I guess that pretty much combined the power bank function into the regular PS for the Pi.... seemed like a cool idea but I didn't bookmark it because it was unavailable and didn't seem like it might ever again become available. It does appear that there are some products like that on Amazon but they are aiming to replace your laptop PS as well as USB power bank. Definitely different packaging and marketing than what I'd found before. Would probably work just as well although comparative overkill on the AC-DC conversion side.