Raspberry Pi UPS: SunFounder PiPower 5 Review on the Pi 5
A power outage can do more than interrupt a Raspberry Pi: if the power drops while it’s writing, the file system on the SD card or NVMe drive can get corrupted. A small Raspberry Pi UPS (uninterruptible power supply) with a battery bridges the outage and shuts the Pi down in time. We tested the SunFounder PiPower 5 on a Raspberry Pi 5, covering a power outage, shutdown on low battery, automatic restart and push notifications to a phone.
Full disclosure: SunFounder sent us the PiPower 5 free of charge for testing. The manufacturer had no say in the content, and all measurements come from our own setup.
In short
The PiPower 5 keeps a Raspberry Pi 5 running when the power goes out, shuts it down properly and starts it again. In our test it did all that cleanly, but only after three changes.
- You need: the PiPower 5 with its battery, a Raspberry Pi 5 and a powerful enough USB-C power supply with Power Delivery.
- Required: update the firmware to 2.0.12, enable “Full power off”, set
auto_shutdown=0for the driver, and leave the Default On jumper on ON. - Bonus: two small files make the Pi send a push notification when the power goes out and when it shuts down.
The PiPower 5: a UPS on a HAT
The PiPower 5 is a HAT with a battery pack made of two lithium-ion cells. The power supply plugs into its USB-C input; the PiPower feeds the Pi through the 5 V pins of the GPIO header and charges the battery at the same time. If the power fails, the battery takes over without interruption. It talks to the Pi over I²C, and a kernel driver reads the battery level, voltages and events.
| Feature | PiPower 5 |
|---|---|
| Battery | 2 cells in series, 7.4 V, 2000 mAh |
| Input | USB-C with Power Delivery, 5–15 V |
| Output | 5 V, up to 5 A, via the GPIO header; plus USB-A |
| Charging power | 5, 10, 15 or 20 W, set with the “Charge Sel” DIP switch |
| Interface | I²C, address 0x5C, kernel driver pipower5 |
| Extras | buzzer, four battery LEDs, power button, “Default On” and “SDSIG” jumpers |
For a Pi 5, SunFounder recommends a USB-C power supply with Power Delivery and at least 32 W; otherwise there may not be enough power left to charge the battery under heavy load. A weaker supply works, but the charging power has to be set low. We used the official 27 W Pi 5 adapter, which supplies 15 V to the PiPower.
How the PiPower 5 is meant to be mounted
Normally the PiPower 5 sits on top of the Raspberry Pi on standoffs like any other HAT, with its header socket plugged onto the Pi’s GPIO header. You can stack another board on top, because the PiPower passes all 40 pins through. It uses I²C and the ID pins that HATs use to identify themselves.
Our setup is different: the Pi lives in a Pironman 5 MAX, and the PiPower connects to the GPIO header that the case exposes on its side, with a second HAT carrying a radio module in between. It works, but it’s a special case.
Either way, the power supply plugs into the PiPower, not the Pi or the case. That’s the only way it can detect an outage and switch to battery.
Other UPS options for the Raspberry Pi 5
The best-known alternatives for the Pi 5 don’t sit on top as a HAT. They mount underneath the Pi like a shield and connect through spring-loaded pogo pins, which leaves the GPIO header free. The details come from the manufacturers’ documentation:
| Feature | PiPower 5 | Geekworm X1200 / X1202 | Waveshare UPS HAT (E) |
|---|---|---|---|
| Mounting | HAT on top of the Pi | under the Pi, pogo pins | under the Pi, pogo pins |
| Batteries | 2000 mAh pack, included | 2 or 4 × 18650, not included | 4 × 21700, not included |
| Output to the Pi | 5 V, up to 5 A | 5.1 V, up to 5 A | 5 V, 6 A rated |
| Input | USB-C with PD up to 15 V | USB-C 5 V/5 A; X1202 also DC 6–18 V | USB-C with PD up to 40 W |
| Software | kernel driver, dashboard, CLI | sample scripts | Python sample over I²C |
| Restart after an outage | yes (Default On jumper) | yes | yes (register, on by default) |
The Geekworm X1200* and the four-cell X1202* with its wide DC input are a good fit if you need the GPIO header free and don’t mind buying the cells yourself; Geekworm specifies cells without a built-in protection circuit, because one would limit the discharge current.
For shutdown, Geekworm only provides sample scripts, with no ready-made service or dashboard, and the Pi has to power off fully after shutting down there too (“Full power off”, explained below).
Despite its name, the Waveshare UPS HAT (E)* also mounts underneath the Pi. It takes four larger 21700 cells and charges via USB-C PD at up to 40 W, but only with a matching fast charger, according to Waveshare.
One SunFounder product to skip: the PiPower Pro isn’t an option for the Pi 5, since according to the manufacturer it only supplies 5 V at 3 A.
What you need
- SunFounder PiPower 5* with its battery pack
- Raspberry Pi 5* running Raspberry Pi OS
- A USB-C power supply with Power Delivery, at least 32 W according to SunFounder, such as the official 45 W power supply*. The official 27 W power supply* is below that recommendation, but it worked for us with the charging power set low. Help choosing one: power supply buying guide
- Optional: a case that exposes the GPIO header, such as the Pironman 5 MAX*
- For push notifications: a phone with the ntfy app
The PiPower comes with plenty of standoffs and screws in various lengths; we didn’t have to buy anything extra for our setup.
Mounting and jumpers
The PiPower has two jumpers and a small DIP switch to check before fitting it:
- SDSIG on PI3V3: keep the jumper here for a Pi 4 or Pi 5. The PiPower uses it to detect that the Pi has finished shutting down, because the 3.3 V rail drops. According to SunFounder, the “Pin 26” position is for the Pi 3 and Zero and uses GPIO 26.
- Default On = ON: when power returns after a shutdown, the PiPower switches the Pi back on by itself. That applies after an outage: if you shut the Pi down with
sudo poweroffwhile the adapter is still connected, it stays off until you press the button on the PiPower. - Charge Sel to match your power supply: the two switches set the charging power: both off = 5 W, only switch 1 on = 10 W, only switch 2 on = 15 W, both on = 20 W. SunFounder’s rule of thumb budgets 20 to 25 W for the Pi 5 itself, and whatever is left over goes to charging. For a 30 W supply, SunFounder suggests 5 or 10 W. With 45 W or more, 20 W is fine. With the 27 W supply, leave both switches off.

With the jumpers and switches set, fit the PiPower:
- Connect the battery to the PiPower.
- Fit the PiPower onto the GPIO header of the powered-off Pi and screw it down. Make sure all 40 pins are fully seated: with two boards stacked in our setup, the Pi’s status LED glowed a faint orange and the Pi wouldn’t boot until we pressed the boards firmly together.
- Plug the power supply into the PiPower’s USB-C input. If the Pi doesn’t start by itself, give the button on the PiPower one short press.
On our PiPower both Charge Sel switches were off out of the box, which means 5 W. Even so, at the start of charging it reported around 18 W of charging power and drew 28 W from the 27 W supply, more than it’s rated to deliver continuously. Once the software is installed, check the “Input” card in the dashboard; if the input power stays above your supply’s rating, use a stronger one.
Installing the software
SunFounder offers two ways to install: a separate script for the PiPower on its own, and the Pironman case installer with the --pipower5 option. Both set up the kernel driver, the pipower5 command-line tool, the dashboard on port 34001 and the service that acts on shutdown requests. Skip the “driver only” and “driver plus Python library” options from the README, since they leave out that service.
Without a Pironman case (the usual setup)
If the PiPower sits directly on the Pi, use the install script from the PiPower 5 software docs. The service is then called pipower5:
git clone https://github.com/sunfounder/pipower5
cd pipower5
sudo python3 install.py
With a Pironman case
If the Pi lives in a Pironman case, install the case and PiPower software in one go. The service is then called pironman5:
curl -sSL "https://raw.githubusercontent.com/sunfounder/pironman5/v1/install.sh" | sudo bash -s -- --pipower5
The installer asks which case you have: Pironman 5, 5 Max, 5 Pro Max, 5 Mini or 5 UPS. Pick your model; we chose “Pironman 5 Max”. “Pironman 5 UPS” is the case with a built-in UPS, not the PiPower 5. On our Pi the installer took about three minutes and added two device tree overlays to /boot/firmware/config.txt: dtoverlay=sunfounder-pironman5 for the case and dtoverlay=sunfounder-pipower5 for the PiPower.
Reboot the Pi once after installing so the driver and overlays get loaded. sudo pipower5 -fv shows which firmware your PiPower is running.
Getting the UPS to shut the Pi down cleanly
The shutdown threshold is the battery level at which the PiPower has the Pi shut down when wall power is gone. The firmware update makes sure that threshold applies; “Full power off” and the driver option make sure the Pi shuts down cleanly and starts again afterwards.
1. Update the firmware to 2.0.12
Our PiPower came with firmware 2.0.9. According to SunFounder, that version ignores the configured threshold and shuts down at a fixed battery voltage of 6.5 V (the changelog says “previously around 33%”). On our unit the Pi went off at a displayed 27%. Firmware 2.0.12 derives the cut-off from the configured threshold and recalibrates the percentage scale.
The update runs over I²C with the pipower5_update_tools utility. Keep the power supply connected while you do it:
git clone https://github.com/sunfounder/pipower5_update_tools.git --depth 1
sudo apt install python3-blessed python3-smbus2
sudo systemctl stop pironman5 # without a Pironman case: sudo systemctl stop pipower5
sudo modprobe -r pipower5
cd pipower5_update_tools
python3 run.py
SunFounder’s guide installs the Python packages blessed and smbus2 with pip; on Raspberry Pi OS, use the system packages instead so pip doesn’t clash with the system Python. Stopping the service keeps it from talking to the PiPower during the update. modprobe -r pipower5 isn’t in the guide, but you need it too. Otherwise the kernel driver keeps the PiPower’s I²C address busy and polls it every second. The firmware files are in the tool’s firmware folder.
Pick “Update Firmware” in the menu. The PiPower switches to boot mode; then select pipower5-firmware-iap-2.0.12.bin and confirm with Enter. After about twelve seconds the tool reports “burn success” and “verifying … OK”. In case an update goes wrong, the tool also has a “Restore Factory Firmware” menu entry.
Finally it asks whether to restart the PiPower; the new firmware only runs after that restart. Expect the Pi to lose power briefly at that point: ours turned off without shutting down and then rebooted by itself, so before you confirm, run sync in a second terminal to make sure everything is written to disk. According to SunFounder, only the 2.0.13 pre-release stops a PiPower restart from cutting power to the Pi; for everyday use 2.0.12 is enough. When the Pi boots again, it reloads the driver and service. If it stays on instead, reboot it with sudo reboot so the driver and service reload.
2. Enable “Full power off”
Out of the box, a Pi 5 stays in a low-power standby state after shutting down, with the 3.3 V rail still powered. The PiPower then can’t tell that the Pi is off, doesn’t cut the power, and so can’t switch it back on when wall power returns. SunFounder’s software docs require this setting for the Pi 4 and Pi 5. In raspi-config you’ll find it under Advanced Options → Shutdown Behaviour → “B1 Full power off”; without the menu, use:
sudo raspi-config nonint do_power_off_on_halt "B1 Full power off"
This writes POWER_OFF_ON_HALT=1 and WAKE_ON_GPIO=0 to the bootloader configuration, which takes effect on the next boot. Without it, the PiPower keeps waiting for the 3.3 V rail to drop after the shutdown, and two of its battery LEDs blink. Every time you start the Pi with the button, it shuts down again after about 15 seconds. The troubleshooting section explains how to get out of that.
3. Turn off the driver’s automatic shutdown (auto_shutdown=0)
When the PiPower reports that the shutdown threshold has been reached, version 2.1.5 of its kernel driver calls kernel_power_off() directly. That powers the Pi off from inside the kernel and skips the normal shutdown: services aren’t stopped, the system journal isn’t closed and file systems aren’t unmounted properly. On the next boot the system reports “uncleanly shut down”. The bug has been reported to SunFounder (GitHub issue 21).
With the driver option auto_shutdown=0, the driver ignores the request, and SunFounder’s service (pironman5 or pipower5) shuts the Pi down the normal way with systemctl poweroff:
echo "options pipower5 auto_shutdown=0" | sudo tee -a /etc/modprobe.d/pipower5.conf
echo 0 | sudo tee /sys/module/pipower5/parameters/auto_shutdown
The first line applies from the next boot, the second one right away; tee -a appends because the pipower5 tool writes to the same file. At the threshold the kernel log (journalctl -k) then shows “SHUTDOWN ignored (auto_shutdown=0)”, followed by a regular shutdown. Without the service running, nothing shuts the Pi down with this option set.
Dashboard and command line
Open the dashboard in a browser at http://<Pi-IP-address>:34001. The PiPower adds three cards: “Input” shows voltage and power at the adapter input, “Battery” shows battery voltage, charge or discharge current and percentage, and “Raspberry Pi Power” shows what reaches the Pi.
The settings also include email alerts, the buzzer and a “Power Failure Simulation”: it disconnects the input for one minute, the Pi runs on battery, and at the end you get a report with the power consumption and the estimated runtime until the shutdown threshold. The PiPower switches the input back on by itself afterwards. On the command line, sudo pipower5 -pfs 20 does the same for 20 seconds; the driver allows up to 600 seconds.
sudo pipower5 status shows all values at once. The tool doesn’t show the remaining runtime, but the driver calculates it. The value is in seconds, counting down to the configured threshold rather than to an empty battery. This command converts it to minutes:
echo "$(( $(cat /sys/devices/virtual/pipower5/pipower5/estimated_runtime) / 60 )) min"
Close to the threshold, the estimate was one to two minutes too optimistic in our test (firmware 2.0.9); leave yourself some margin.
Choosing the shutdown threshold
The default threshold is 10%. Change it in the dashboard under Settings → “Shutdown Strategy”. When we set it from the command line (pipower5 -sp), the value only reached the PiPower’s controller and the dashboard kept showing the old one. Set it in the dashboard so both match.
With firmware 2.0.12 the PiPower shuts down exactly at the threshold. For a lightly loaded Pi like ours, the default 10% is therefore enough. We’d still suggest 15 to 20%, since the battery loses capacity as it ages. For systems drawing more than 3 A (about 15 W on the “Raspberry Pi Power” card), SunFounder recommends 100% instead: the Pi then shuts down as soon as power is lost, and the PiPower is only there to make that shutdown clean.
Real-world test: how the UPS handles a power outage
Our test setup: a Raspberry Pi 5 with 4 GB of RAM and an NVMe SSD in the Pironman 5 MAX, with the case service, Wi-Fi and the second HAT with its radio module running, and no other load. The Pi drew 4 to 5.5 W from the PiPower. We switched off the input in software, and a script logged voltages and battery level every 30 seconds. We ran the test twice from a full battery to shutdown, once with the old and once with the new firmware:
| Measurement | Firmware 2.0.9 | Firmware 2.0.12 |
|---|---|---|
| Runtime from 100% | 2 h 55 min | 2 h 58 min |
| Shutdown triggered by | fixed voltage cut-off | 10% threshold |
| Displayed level at shutdown | 27% | 10% |
| Battery voltage at shutdown | 6.52 V | 6.44 V |
| Shutdown | not clean (without auto_shutdown=0) | clean (with auto_shutdown=0) |
Runtime is almost the same with both versions, because the cut-off voltage is around 6.5 V either way. What the new firmware changes is the percentage scale: the Pi now shuts down at the 10% you configured instead of at a displayed 27%.
With all three changes in place and the Default On jumper on ON, this is what happens: wall power drops, the PiPower beeps and the Pi keeps running without a hiccup. At the threshold it shuts down normally, and the PiPower cuts power as soon as the Pi is off. When power comes back, the Pi starts by itself after about a minute.
To check your own setup:
- In the dashboard, temporarily set the threshold just below the current battery level.
- Unplug the power supply: the PiPower beeps and the dashboard shows the source switching to battery.
- Wait for the Pi to shut down at the threshold.
- Plug the power supply back in; the Pi should be running again by itself after about a minute.
- Set the threshold back.
Push notifications to your phone with ntfy
For notifications, SunFounder only offers email through your own SMTP server. ntfy is simpler: the app is free, needs no account, and the Pi sends the messages with curl, which comes with Raspberry Pi OS.
First pick a long, random topic name and subscribe to it in the app with the plus button. Topics on ntfy.sh are public: anyone who knows the name can read along and send messages too. Below, we use the placeholder pipower5-YOUR-RANDOM-NAME. You’ll create two files with sudo nano: a udev rule and a systemd unit.
A udev rule for power loss and restore
The driver reports a power outage and the return of power as system events. A rule in /etc/udev/rules.d/99-pipower5-ntfy.rules reacts to them:
ACTION=="change", SUBSYSTEM=="pipower5", ENV{PIPOWER5_EVENT}=="power_disconnected|power_restored", RUN+="/usr/bin/systemd-run --no-block --collect /usr/bin/curl -s -H 'Title: PiPower 5' -d '$env{PIPOWER5_EVENT}' https://ntfy.sh/pipower5-YOUR-RANDOM-NAME"
The detour through systemd-run is needed because programs started from udev rules have no network access. Now reload the rules and test them with a short simulation; “power_disconnected” arrives after a second or two, “power_restored” once it’s over:
sudo udevadm control --reload
sudo pipower5 -pfs 20
A systemd unit for the shutdown message
With auto_shutdown=0 there’s no usable event for the shutdown itself any more. So the Pi sends the message itself while it shuts down, as long as the network is still up. A small unit in /etc/systemd/system/pipower5-ntfy-shutdown.service handles it:
[Unit]
Description=PiPower 5: ntfy push when the Pi shuts down
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
# $$ and %% are systemd escapes for a literal $ and %
ExecStop=/bin/sh -c 'P=/sys/devices/virtual/pipower5/pipower5; /usr/bin/curl -s -m 10 -H "Title: PiPower 5" -H "Priority: high" -d "Pi shutting down (battery $$(cat $$P/battery_percentage) %%, $$(cat $$P/battery_voltage) mV, source $$(cat $$P/power_source))" https://ntfy.sh/pipower5-YOUR-RANDOM-NAME'
[Install]
WantedBy=multi-user.target
Enable the unit and test it. Restarting the unit sends the message without shutting the Pi down:
sudo systemctl daemon-reload
sudo systemctl enable --now pipower5-ntfy-shutdown.service
sudo systemctl restart pipower5-ntfy-shutdown.service
The unit fires on every shutdown, including when you shut the Pi down manually. “source 1” means the Pi is running on battery, “source 0” means it’s on the power supply.

Troubleshooting
The Pi doesn’t come back after a shutdown and two battery LEDs blink: “Full power off” is missing (see step 2). To break the loop:
- Unplug the adapter from the PiPower and take the PiPower off.
- Plug the adapter straight into the Pi (or the case), boot the Pi and enable “Full power off”.
- Shut down, refit the PiPower and plug the adapter back into it.
- If the LEDs still blink, hold the PiPower button for more than five seconds, then give it one short press.
- The Pi won’t start even though the PiPower is fitted: if the power supply is still plugged into the Pi or the case, move it to the PiPower.
- “Permission denied” under
/sys/class/pipower5: with driver 2.1.5 the directory is missing its execute permission; the 2.1.6 pre-release fixes this. Until then, read the values via/sys/devices/virtual/pipower5/pipower5/or usesudo. - The fourth battery LED flickers when the battery is nearly full: a display bug in firmware 2.0.9, fixed in 2.0.12.
- “Failed to send email: SMTP email or server is not set” in
journalctl -t pipower5: harmless as long as you haven’t set up email. SunFounder’s rule tries to send an email on every event.
Frequently asked questions
In our test, just under three hours: a Raspberry Pi 5 with an NVMe SSD at idle ran for 2 hours 58 minutes from a full battery down to the 10% shutdown threshold. A heavily loaded Pi (above 3 A) gets much less; SunFounder recommends letting it shut down as soon as the power goes out.
Yes, if the Default On jumper is set to ON and Full power off is enabled on the Pi. The PiPower cuts power once the Pi has shut down and switches it back on when the power supply delivers power again. In our test the Pi was back online after about a minute.
No. Without a Pironman case, the PiPower 5 sits directly on the Pi and you install the software with its own install script from SunFounder’s docs. You only need the Pironman 5 installer with the PiPower option if you have a Pironman case.
Not in software. Neither the pipower5 tool nor the driver has a setting for the LEDs. You can only adjust the buzzer volume and choose which events make it beep.
Out of the box only by email through your own SMTP server. A simpler option is a udev rule that sends a push notification to ntfy with curl on each event, plus a small systemd unit for the shutdown message.
Verdict
Our PiPower 5 unit takes over without a glitch and exposes all its readings in the dashboard and through the driver. If you want a ready-made UPS for the Pi 5 with battery, dashboard and driver, it’s a good choice; after the three changes it works cleanly. If you’d rather keep the GPIO header completely free or want more battery cells, one of the shields in the table is the better fit. With close to three hours at idle, it rides out many short power outages completely; for longer outages or heavy loads, think of it as a clean-shutdown helper rather than a replacement for wall power.








