UPS HAT for Raspberry Pi
Battery backup HAT keeping a Pi running through power loss.
An uninterruptible power supply HAT that seamlessly switches a Raspberry Pi to battery power during outages, common in always-on home servers. It sits between the main power source and the Pi's power input, continuously trickle-charging an onboard Li-ion/LiPo battery while mains power is present, and instantly switching over to battery when power is lost — keeping projects like home automation hubs, network-attached storage, or security camera servers running through brief outages, or at least allowing a graceful shutdown before the battery depletes.
Specifications
| Form factor | Raspberry Pi HAT — mounts directly on the 40-pin GPIO header, matching standard Pi board dimensions |
| Input power | 5V via micro-USB or USB-C, or direct DC barrel input depending on model |
| Output power | Regulated 5V to the Raspberry Pi via the GPIO header pins (bypassing the Pi's own USB power input) |
| Battery | Single or dual-cell Li-ion/LiPo (18650 cells are common), charge-managed onboard |
| Switchover behavior | Automatic, near-instantaneous switch to battery power on mains loss with no reboot of the Pi |
| Monitoring | Many models expose battery voltage/percentage over I2C so software running on the Pi can log status or trigger a graceful shutdown before battery depletion |
| Backup runtime | Model and battery-capacity dependent, commonly tens of minutes to a few hours depending on Pi model and attached peripherals |
Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | 40-pin GPIO header (pass-through) | Mounts on and passes through the Pi's GPIO header, supplying regulated 5V power while typically leaving GPIO pins available for other HATs/wires |
| 2 | Battery terminals | Connection points for the onboard Li-ion/LiPo cell(s), usually via a JST connector or solder pads |
| 3 | Power input (micro-USB/USB-C/barrel) | Main 5V power input from the wall adapter |
| 4 | I2C (SDA/SCL, via GPIO pass-through) | Used by many UPS HATs to report battery voltage/capacity to software running on the Pi |
Because most UPS HATs deliver power through the GPIO header rather than the Pi's normal USB/barrel power input, they typically require running the Pi's official low-voltage warning to be disabled or reconfigured, and it's worth checking whether the specific HAT model leaves the rest of the 40-pin header accessible for stacking other HATs. Battery status is usually read over I2C so a background script can trigger a clean shutdown before the battery is fully drained.
Variants
A dual-cell UPS HAT is worth the extra cost for genuinely important always-on projects (NAS, security recording) where longer backup runtime and software-visible battery monitoring matter. For a quick, low-effort backup solution without GPIO integration, a basic pass-through-charging USB power bank is a simpler (if less elegant) fallback.
| Variant | Temp range | Hum range | Accuracy | Protocol | Price |
|---|---|---|---|---|---|
| Single-cell 18650 UPS HAT | ~$10-20 | ||||
| Dual-cell 18650 UPS HAT | ~$15-30 | ||||
| Standalone USB power bank (pass-through charging) | ~$10-25 |