A reliable UPS for Raspberry Pi 5 requires delivering a stable 5V at 5A (25W peak) per node via USB-C Power Delivery, or 12V stepped down via a high-efficiency buck converter. For a 4-node cluster drawing 100W total, you need a 12V 20Ah LiFePO4 battery, a 20A BMS, and a 150W pure sine wave inverter (or a 12V-to-5V DC-DC step-down module) to achieve a 2-hour runtime. This accounts for inverter conversion losses, depth-of-discharge (DoD) limits, and the Pi 5's transient boot surges.
Off-the-shelf Pi UPS HATs are fine for single-board graceful shutdowns, but they fail catastrophically when tasked with sustaining multi-node clusters during prolonged grid outages. Building a custom 12V DC power architecture gives you vastly superior runtime, lower heat dissipation, and true uninterruptible operation. Here is the exact engineering math and component selection required to build one.
The Power Chain: Source to Load Block Description
To design a robust uninterruptible power supply, you must map the exact flow of energy from the grid to the silicon. A custom Pi cluster UPS follows this specific block architecture:
- AC Mains / Solar Source: 120V/240V AC grid or a DC-coupled solar array.
- AC-DC Charger / MPPT Controller: Converts source power to 14.6V DC to charge the battery bank. Must support a specific LiFePO4 charge profile (CC/CV with no equalization stage).
- Battery Bank & BMS: The energy buffer. A 4-series (4S) LiFePO4 pack providing 12.8V nominal. The Battery Management System (BMS) sits inline on the negative lead, monitoring cell voltages and temperature.
- Power Conversion Stage: Either a 12V-to-120V AC Pure Sine Wave Inverter (to use standard Pi USB-C wall warts) OR a 12V-to-5V DC-DC USB-C PD buck converter (for direct DC coupling).
- Load: Raspberry Pi 5 nodes, network switches, and NVMe SSDs.
Inverter and Charger Sizing
Sizing the inverter and charger requires accounting for the Pi 5's inrush current. While a Pi 5 idles around 3W, it can spike to 12W-15W during heavy CPU loads or peripheral enumeration. A 4-node cluster plus a managed PoE switch can easily pull 80W continuous, with transient spikes hitting 120W.
Inverter Sizing: Never size an inverter to the exact continuous load. Inverters lose efficiency at low loads and can trip their internal over-current protection on transient spikes. For a 100W continuous load, specify a 150W to 200W pure sine wave inverter. Modified sine wave inverters will cause the Pi's internal switching regulators to run hotter and less efficiently, potentially triggering thermal throttling.
Charger Sizing: Your charger must replenish the bank faster than your average daily outage duration. For a 20Ah battery, a 10A charger provides a 0.5C charge rate, fully recharging the bank in roughly 2.5 hours. Ensure the charger has a selectable 'Lithium' or 'LiFePO4' mode; standard lead-acid AGM chargers will push the absorption voltage too high and trigger the BMS over-voltage disconnect.
Battery Chemistry, C-Rates, and Sizing Math
When selecting cells for an embedded UPS, you are choosing between high-density Li-ion (NMC) and high-stability LiFePO4 (LFP). For a stationary Pi cluster, LiFePO4 is the mandatory choice due to its flat discharge curve and thermal stability.
| Parameter | 18650 Li-ion (NMC) | Prismatic LiFePO4 (LFP) | Sealed Lead Acid (AGM) |
|---|---|---|---|
| Nominal Voltage (per cell) | 3.6V - 3.7V | 3.2V | 2.0V |
| Max Continuous C-Rate | 1C to 3C (varies by model) | 0.5C to 1C (standard) | 0.2C (optimal) |
| Recommended DoD | 80% | 80% - 90% | 50% |
| Peukert Exponent (k) | ~1.05 | ~1.05 | 1.30 - 1.40 |
| Cycle Life (to 80% capacity) | 500 - 800 | 3,000 - 5,000 | 300 - 500 |
| Thermal Runaway Risk | High (requires strict monitoring) | Very Low | None (off-gasses H2 instead) |
Series vs. Parallel: Consequences for V and Ah
To build a 12V nominal pack, you must wire cells in series. Series wiring increases voltage while Amp-hours (Ah) remain constant. Four 3.2V 20Ah LiFePO4 cells in series (4S1P) yields 12.8V at 20Ah (256Wh). Parallel wiring increases capacity while voltage remains constant. Four cells in parallel (1S4P) yields 3.2V at 80Ah.
For a Pi UPS, a 4S configuration is vastly superior. Running a 3.2V system requires massive gauge wire to handle the high current (80A for a 256W load) and requires boosting the voltage to 5V, which introduces severe switching losses. A 12.8V system keeps the current low (~8A for 100W), allowing you to use standard 14 AWG silicone wire.
Critical Warning: Never parallel mismatched cells. If you parallel cells of different ages, capacities, or internal resistances without a robust BMS balancing every individual parallel group, the stronger cells will force high cross-currents into the weaker cells during charge and discharge, leading to localized heating and venting.
Sizing Math: Peukert's Law and Efficiency Derating
Peukert's Law calculates how a battery's usable capacity decreases as the discharge current increases. The formula is:
t = H × (C / (I × H))^k
Where t is runtime, H is the rated discharge time (usually 20h), C is rated capacity, I is actual current, and k is the Peukert exponent. For lead-acid, k is around 1.3, meaning high loads brutally slash your runtime. Fortunately, lithium chemistries have a k value very close to 1.05. Therefore, the Peukert penalty on a LiFePO4 Pi UPS is negligible.
Instead of Peukert losses, your sizing math must account for Inverter Efficiency and Depth of Discharge (DoD).
Worked Example: You have a 4-node Pi cluster drawing 80W continuous. You are using a 12.8V 20Ah LiFePO4 battery (256Wh total) and a DC-DC buck converter with 92% efficiency. You limit DoD to 80% to preserve cycle life.
- Usable Battery Energy = 256Wh × 0.80 (DoD) = 204.8Wh
- Energy Delivered to Load = 204.8Wh × 0.92 (Converter Efficiency) = 188.4Wh
- Runtime = 188.4Wh / 80W = 2.35 hours
If you used an AC inverter (85% efficiency) instead of a DC-DC buck converter, your delivered energy drops to 174Wh, reducing runtime to 2.17 hours. Over a 5-year lifespan, that 7% efficiency gap translates to significant wasted energy and excess heat inside your server rack.
Charge/Discharge Limits and Fire Safety
Lithium cells do not tolerate voltage abuse. Operating outside the manufacturer's specified charge and discharge limits will degrade the electrolyte, cause copper shunt dissolution, and trigger thermal runaway.
LiFePO4 cells are significantly safer than NMC Li-ion, but a short circuit or BMS failure can still cause venting and fire. Never parallel mismatched cells. Always use a BMS with over-current, short-circuit, and passive cell-balancing capabilities. Mount your battery bank in a fire-retardant enclosure (such as a steel ammo can or specialized LiPo safe bag) and install a localized smoke detector. If a lithium cell enters thermal runaway, it generates its own oxygen; standard ABC extinguishers will not stop the chemical reaction. Copious amounts of water are required to cool the cells and halt propagation, but prevention via strict voltage limits and a quality BMS is your only reliable defense.
Exact Voltage Limits for 4S LiFePO4
When configuring your AC-DC charger or solar MPPT controller, you must input the exact voltage thresholds for a 4-series LiFePO4 pack. Do not use the default 'Lithium Ion' settings, which are calibrated for 3S or 4S NMC cells.
- Bulk/Absorption Charge Limit: 14.2V to 14.6V (3.55V - 3.65V per cell). Charging above 14.6V will trip the BMS high-voltage cutoff and halt charging entirely.
- Float Voltage: 13.5V to 13.6V. LiFePO4 does not require a high float; keeping it at 14.6V continuously will cause lithium plating on the anode.
- Low Voltage Disconnect (LVD): 10.0V to 11.0V (2.5V - 2.75V per cell). Discharging below 2.5V causes irreversible structural damage to the cathode. Set your BMS LVD to 11.0V to provide a safe buffer.
Decision Tree: Inverter vs. DC-DC Buck Converter
The final architectural decision for your Raspberry Pi UPS is how to step the 12V battery bank down to the 5V USB-C PD required by the Pi 5. You have two paths, each with distinct trade-offs regarding efficiency, cost, and wiring complexity.
| Criteria | Path A: 12V to 120V Inverter + Official Pi PSU | Path B: 12V to 5V DC-DC USB-C PD Buck Module |
|---|---|---|
| Conversion Efficiency | 80% - 88% (Double conversion: DC-AC-DC) | 92% - 96% (Single conversion: DC-DC) |
| Component Cost | $40 (Inverter) + $48 (4x Official PSUs) = $88 | $35 (High-quality 100W PD Buck Module) |
| Wiring Complexity | Low (Standard AC IEC cables to PSUs) | Medium (Requires custom DC barrel/USB-C pigtails) |
| Heat Dissipation | High (Inverter fan noise + PSU heat in rack) | Low (Buck module requires only a small heatsink) |
| Best Use Case | Temporary setups, mixed AC/DC loads | Permanent server racks, off-grid/solar deployments |
Executing Path B: The DC-DC Build
For a permanent 2026 cluster build, Path B is the superior engineering choice. To execute this, source a 12V-to-5V USB-C PD诱骗 (trigger) buck converter module rated for at least 30W per port. Modules based on the IP2721 or STDP4320 PD controller chips are widely available and reliably negotiate the 5V/5A contract with the Pi 5's internal power management IC.
Wire the 12V input of the buck module directly to the load terminals of your BMS, bypassing the inverter entirely. Use 12 AWG wire for the main bus from the battery to a fused distribution block, and 16 AWG wire from the distribution block to the individual buck modules. Install an inline 15A ATC automotive fuse on the main positive lead, placed within 6 inches of the battery positive terminal. This ensures that if a buck module fails short, the fuse clears the fault before the battery wiring can melt, satisfying the core tenets of lithium safety best practices.
By eliminating the AC inverter stage, you reclaim roughly 15% of your battery capacity, eliminate the acoustic noise of an inverter cooling fan, and drop the ambient temperature inside your server enclosure by several degrees. The result is a silent, highly efficient UPS capable of keeping your edge-computing cluster online through multi-hour grid failures.






