I’ve had the original 900 mAh PiSugar UPS backup battery for the Raspberry Pi Zero for several years now and it’s an absolute game changer. With the wireless capabilities of the Raspberry Pi you have a completely portable and networked computer available that is extremely tiny. It’s much more capable than hooking it up to a power brick and is actually designed for the Raspberry Pi!
In this article I’ll cover how to set up a full UPS battery backup with several hours of available power using the the PiSugar as well as the PiSugar 2 and some of the shortcomings in the first version the 2nd revision fixes. Let’s get started!
The PiSugar 2 Portable is a full UPS system for the Raspberry Pi Zero W/WH. When power is lost the battery takes over seamlessly. A web interface and access to the UPS board is available to read the battery % and other stats from the device.
The thinnest version of the PiSugar (900 mAh) for Raspberry Pi Zero W/WH but has several critical limitations (read limitations section). Listings are combined with the 1200 mAh PiSugar 1 battery so be careful and don’t get the 1200 mAh PiSugar 1 since there is already a 1200 mAh PiSugar 2! May be available in some countries the PiSugar 2 isn’t available.
Installation / Usage (Pi Zero W/WH)
The PiSugar powers your Pi through two small pins on the back of the board. This is excellent because it leaves all of your USB ports completely open. This lets you fit the Pi into much tinier places than you would be if you had to attach it to a power brick.
Installing the board is as simple as attaching the PiSugar’s control board to the bottom of your Pi with 4 nylon screws.
Here you can see the Pi on the bottom, the PiSugar control board with the power port as well as the power switch to the left of the power port. One press turns on and two presses turns off. There are four nylon screws attaching the control board to the Pi with 4 nuts securing the end of the screws. Here’s what the other side of the board looks like with the battery detached (Pi is now underneath in this shot):
You can see the large silver rectangle on the PiSugar’s control board. That is a very powerful magnet that strongly holds the battery to the PiSugar. This is useful if you need to slightly adjust the battery as you can “slide” it on the magnet with a little bit of force. You can also detach the battery from the magnet altogether like the picture above and have a small bit of slack to work with if you wanted to place the battery in a different part of a case or enclosure. The magnet is powerful enough that you can use it to attach the Pi to other metal surfaces as well!
No soldering is required despite how the wires may look. Everything will come already soldiered together from the factory and is exactly how it came. Once you attach the slim PiSugar board with the 4 screws you’re finished with the build and are now ready to connect the power!
The PiSugar has it’s own USB power port and to start charging the battery you will plug your power source into this port.
The Pi will power on and you will see indicators light up. The PiSugar 900 mAh has 4 LED indicators for 25%, 50%, 75% and 100%. This is a really useful touch as you have a visual indicator at any moment if you are running your Pi off the UPS of how much power is remaining.
One cool touch of the board is that your green activity light will light up your screw and nut like the picture above. It’s really easy to see your Pi’s activity indicator which can be difficult otherwise when you start attaching cases and accessories.
PiSugar 1 Limitations vs PiSugar 2 (Important!)
I purchased my original 900 mAh PiSugar before the PiSugar 2 existed. It has several serious limitations you should be aware of that were fixed in the PiSugar 2 devices.
The first limitation with the PiSugar 1 is when you connect or disconnect the power cable your Pi reboots. When the power is cut you reboot and then when the power is restored you reboot again! That is obviously a devastating and almost laughably pathetic limitation for a device that is supposed to act as a UPS and it was not long before a new board was designed and announced to address this. This is a deal breaker if you are actually wanting the UPS functionality to protect your data or running processes. If you are just trying to use it as a mobile battery to run your Pi for hours wherever you want (I’ll be honest, for me it’s 90% this) then it’s not as big of a deal but is still annoying when you plug it in to recharge and it still reboots on you despite no actual loss in power (just a switch in the circuitry so the battery begins to charge).
The second limitation is that the PiSugar 1 has no way to interface with the Pi at all. That means you can’t get the battery level % through any applications or scripts because it doesn’t “talk” to the Pi. Sure it has the visual indicators, but what if you are using it remotely? This is also clearly not good and was also fixed in the PiSugar 2 which not only provides a way to interact with the control board through scripts to do things like safely shut down when the battery is low but even includes a fancy built in web interface!
So why on earth would anyone ever want a PiSugar1? There’s only one reason. To get the ultra-thin 900mAh battery you must get the PiSugar 1 as it was never made with the PiSugar 2 board. The 900mAh is getting difficult to find so make absolutely sure to triple check all listings if you absolutely have to have that particular one. Here’s a side by side:
I’ll try my best to link to 900mAh versions but the listings are often combined or “dual listings” between 900mAh/1200mAh so actually quadruple check as the links change constantly when different sellers list stock of each available. There is also a 1200 mAh PiSugar 1 but nobody should ever buy it (it’s not cheaper either) because there’s already a 1200mAh PiSugar 2 that doesn’t have any of the problems I just mentioned.
The PiSugar 2 1200 mAh is my recommendation for the Pi Zero W/WH unless you absolutely need to have the thinner battery to fit in the space you want or you just have to have the thin one and don’t care about the above limitations!
Installation / Usage (Raspberry Pi 3B/3B+/4B)
There’s only one size of PiSugar that fits the larger Raspberry Pis and that is the PiSugar 2 Pro with a whopping 5000mAh battery! That is more capacity than most cell phone batteries contain with the Samsung Galaxy S20 having a 4000 mAh capacity battery in comparison.
Installation is pretty much as easy as with the Pi Zero model. Screw the four screws and attach the PiSugar board to your device and connect the power to the PiSugar control board’s USB port.
Here’s what it looks like:
To install the PiSugar2 power management scripts/dependencies:
curl http://cdn.pisugar.com/release/Pisugar-power-manager.sh | sudo bash
The script will ask you to select which model of PiSugar2 you have and then finish. After that you can start accessing the PiSugar2’s web interface. It will tell you the address at the end of the script like this:
Clean up Now navigate to http://192.168.0.3:8421 on your browser to see PiSugar power management If you have any question,please feel free to contact us. The PiSugar Team https://www.pisugar.com
Next we need to enable I2C so that we can communicate with the PiSugar2 board. Type/paste:
Navigate to the ‘Interfacing Options’ -> ‘I2C’ -> ‘Yes’ and then exit raspi-config.
The nice thing about this web interface is you can access it from any device on your network. You don’t have to only access it from the Pi!
The PiSugar is more than just a UPS backup. It can be used to make the Pi more akin to a cellular phone where you can take it anywhere and have hours of stable power. I could see combining this with a solar setup and so many other uses where power might be available sometimes but not all of the time. It’s also great for critical systems where you may be writing critical data and can’t afford to risk a power loss interrupting that.
One word of caution: most of the negative reviews I see for the PiSugar devices are that the battery didn’t last as long as they thought it would. It depends on what the device is doing, whether you’ve overclocked etc. but don’t expect much more to 2.5-4 hours even highly tuned just to keep expectations in line. If you’re expecting 6+ hours that is very unlikely without taking extreme measures but it’s still an incredibly useful device and can be easily supplemented with an additional larger power brick plugged into the charge port or even potentially a solar kit.
The best part of this type of a setup is that it gives you the freedom to not worry about power fluctuations or taking the Pi somewhere that power isn’t easily accessible. That is it’s true value!
I would consider it an essential for every Pi owner because it really expands where and how you can use the device. It unlocks a whole new class of project possibilities and many of the most exciting projects require some sort of mobile power and this is a great way to get going with projects like that!