UPS for Raspberry Pi: 18650 or LiPo HAT Comparison
Power outages are a real challenge in India, making a reliable UPS for Raspberry Pi using an 18650 HAT almost essential for any always-on project. Whether you are running a home automation controller, a local NAS server, a network Pi-hole, or an IoT sensor hub, unexpected power cuts can corrupt your SD card or interrupt critical tasks. This comparison guide covers the two main DIY UPS approaches — 18650-based HATs and LiPo HATs — to help you pick the right solution for your Pi project in India.
Why Your Raspberry Pi Needs a UPS in India
India’s power infrastructure, while improving, still delivers frequent voltage fluctuations and outages in many regions — particularly in tier-2 and tier-3 cities and rural areas. Even in metros, brief outages of 10–60 seconds are common during monsoon season and summer peak demand. For a Raspberry Pi running a critical service, even a 2-second power interruption can:
- Corrupt the SD card (most common Pi failure mode)
- Interrupt a database write, causing data loss or table corruption
- Drop active network connections, requiring manual reconnection
- Trigger alarms or incorrect states in home automation scripts
- Interrupt a time-lapse, timelapse, or long-running computation
A Pi UPS — whether a HAT-style board that stacks directly on the Pi’s GPIO header or an external UPS box — solves all of these problems. Beyond protection, a good UPS HAT also provides battery-level monitoring, graceful shutdown triggering via GPIO, and a real-time power path switch so there is no gap in power during mains failure.
The two dominant DIY approaches in 2026 are 18650-based HATs and LiPo HATs. Both work, but they suit different scenarios. Let us compare them in detail.
18650-Based UPS HATs: How They Work
An 18650-based UPS HAT uses one or more standard 18650 lithium-ion cells (usually 1–3 cells) as the backup power source. The HAT sits on top of the Raspberry Pi’s 40-pin GPIO header and includes:
- A charging circuit (usually TP4056-style or a multi-cell variant)
- A boost converter to step the 3.7V cell voltage up to 5V for the Pi
- A power path controller that switches seamlessly from mains to battery
- Battery level indicators (LEDs or a display)
- GPIO pins for battery monitoring and shutdown signalling (on better boards)
Advantages of 18650 UPS HATs:
- Replaceable cells: When a cell degrades after 200–400 cycles, you simply swap in new 18650 cells — no need to replace the entire HAT. This is a significant advantage for long-term deployments.
- Cell availability: 18650 cells are widely available across India at electronics markets and online stores.
- Scalable capacity: Some HATs support 2 or 3 parallel cells, and some support series-parallel combinations. Adding more cells extends runtime.
- Lower cost per mAh: 18650 cells provide high energy density at reasonable cost.
Disadvantages of 18650 UPS HATs:
- More complex charging circuitry for multi-cell configurations
- Some budget HATs have poor power path switching, causing a brief blink during mains failure
- The boost converter efficiency (typically 85–90%) means some energy is lost in conversion
- Taller profile when cells are installed vertically — may not fit in compact enclosures
1 x 18650 Battery Holder with 18.4MM Bore Diameter – Pack of 4
Quality 18650 holders compatible with most Raspberry Pi UPS HAT designs. The 18.4mm bore fits genuine full-diameter cells securely — important for maintaining reliable electrical contact in a HAT stack.
LiPo HAT UPS Solutions
LiPo HATs use a flat lithium polymer pouch cell — the same chemistry as 18650 but in a different form factor. The pouch cell is typically glued or mounted under or beside the HAT board. Popular examples include the Pimoroni LiPo HAT, the UPS-Lite, the Waveshare UPS HAT (B), and various Chinese-made HATs available in India.
Advantages of LiPo HATs:
- Lower profile: LiPo pouch cells are flat and can be tucked under the HAT or in a slim enclosure. Ideal for space-constrained builds like Pi-in-a-picture-frame or wall-mounted sensor nodes.
- Integrated design: Many LiPo HATs come with the battery pre-attached or included, simplifying assembly.
- Better power path circuits: Some premium LiPo HATs (e.g., Pimoroni) use power path ICs that provide zero-interruption switchover and true coulomb counting for accurate battery percentage.
- Monitoring via I2C: Higher-end LiPo HATs expose battery voltage, current, and state-of-charge over I2C, enabling software-based monitoring and graceful shutdown scripting.
Disadvantages of LiPo HATs:
- Non-replaceable battery (usually): When the LiPo cell degrades (typically after 300–500 cycles), you often need to buy a new HAT or desolder and replace the cell yourself.
- Limited capacity options: Common LiPo HATs ship with 1,000–3,000 mAh cells — usually fixed by the board design.
- Cell sourcing: Replacement LiPo pouch cells in the specific dimensions of your HAT may be harder to source in India than standard 18650 cells.
- Heat sensitivity: LiPo pouch cells are more sensitive to heat than 18650 cylindrical cells. Mounting a LiPo under a Pi running intensive tasks in an enclosure can reduce cell life significantly in Indian summers.
18650 5V 1A/2A Lithium Battery Digital Display and Charging Module, Dual USB Output
A versatile 18650-based 5V boost module with integrated charging and digital display — can be used as the power supply heart of a DIY Pi UPS build alongside your own switch and voltage monitoring circuit.
Side-by-Side Comparison
| Feature | 18650 UPS HAT | LiPo HAT |
|---|---|---|
| Cell replacement | Easy — standard 18650 cells | Difficult — custom size pouch cell |
| Profile/height | Tall (cells vertical) | Low profile |
| Capacity options | Flexible (1–3 cells) | Fixed by board design |
| Monitoring features | Basic (LEDs) on budget boards | Advanced I2C on premium boards |
| Power path switching | May have brief blink (budget) | Zero-interrupt on quality boards |
| Cost (India 2026) | ₹400–₹1,200 + cell cost | ₹800–₹2,500 (with battery) |
| Long-term cost | Lower (just replace cells) | Higher (replace whole HAT) |
| Indian summer suitability | Good (cylindrical cells tolerate heat better) | Fair (pouch cells more heat-sensitive) |
Calculating Runtime for Your Project
Knowing your expected runtime on battery prevents unpleasant surprises. Here is how to calculate it:
Step 1 — Measure Pi power consumption: A Raspberry Pi 4 Model B at idle draws approximately 600–700 mA at 5V. Under load, it can draw 1,000–1,200 mA. With attached peripherals (display, USB devices), add accordingly. Use a USB power meter to measure your specific setup’s actual current draw.
Step 2 — Account for conversion losses: An 18650-based UPS HAT steps 3.7V up to 5V. Boost converter efficiency is typically 85–90%. So your effective capacity is: Cell mAh × Cell Voltage / Output Voltage × Efficiency. For a single 2,600 mAh 18650 cell: 2,600 × 3.7 / 5.0 × 0.88 = approximately 1,695 mAh available at 5V.
Step 3 — Calculate runtime: Runtime (hours) = Available mAh / Pi current draw. For the example above with a Pi 4 at 700 mA idle: 1,695 / 700 = 2.4 hours. Two parallel 18650 cells doubles this to approximately 4.8 hours — enough for most Indian power outage durations.
Step 4 — Add graceful shutdown margin: Set your shutdown script to trigger when battery drops to 20% (approximately 3.6V per cell). This preserves the cells and ensures the Pi has time to write any pending data and shut down cleanly — typically 5–10 minutes of runtime at idle.
Recommended Builds for Different Use Cases
Pi-hole / DNS server (always-on, minimal compute):
Use an 18650 HAT with two parallel 3,000 mAh cells (Samsung 30Q or similar). Expected runtime: 6–8 hours. This covers the vast majority of Indian residential power outages. Enable I2C monitoring and use a Python script to issue graceful shutdown at 3.5V/cell.
Home automation hub (Raspberry Pi running Home Assistant):
Use a LiPo HAT with I2C monitoring (Waveshare UPS HAT B or similar). Home Assistant has built-in UPS integration that can trigger automations (send alerts, save state) on power failure. The I2C SOC monitoring is valuable here. Runtime of 2–4 hours is usually sufficient; pair with a whole-home inverter for extended outages.
Outdoor weather station / sensor node:
Use an 18650 HAT with a single quality cell. The Pi runs intermittent sensing tasks at low current, giving 12–24+ hours of runtime. This setup also works as a primary power source (no mains connection at all) when combined with a small solar panel and appropriate charge controller.
Raspberry Pi Compute Module industrial deployment:
Use a dedicated single-board UPS with the CM4 carrier board — not a GPIO HAT. The PiJuice HAT is designed for industrial use cases and provides accurate state-of-charge reporting and scheduled wake/sleep functionality suitable for edge computing nodes.
1S 18650 Li-ion Lithium Battery BMS Charger Protection Board for 3.7V Battery
Add a BMS protection layer to your DIY Pi UPS build. This 1S board handles overcharge, over-discharge, and short circuit protection for single-cell 18650 deployments — essential for unattended always-on Pi installations.
Installation and Safety Tips
GPIO header clearance: Some Raspberry Pi cases do not have enough vertical clearance for a HAT with tall 18650 cells. Measure your enclosure before buying. An 18650 cell is 65mm tall — when installed vertically in a HAT, the total height above the PCB is 70mm+. Use a spacer between the Pi and HAT if needed.
Shutdown script: A UPS HAT without a software shutdown script is only half a solution. Write a Python or Bash script that polls the battery voltage pin (or reads the I2C register), logs the battery level, and calls sudo shutdown -h now when voltage drops to the threshold. Several ready-made scripts exist for popular HATs on GitHub.
Ventilation in Indian climate: If deploying in an enclosure during summer, ensure airflow around the battery. A small 5V fan controlled by the Pi’s GPIO (turned on when CPU temperature exceeds 60°C) can significantly extend both cell and Pi lifetime.
Use quality cells: The difference between a genuine Samsung or LG cell and an unbranded clone is significant in a UPS application — you need the capacity to be reliable and consistent. An unbranded cell claiming 3,000 mAh that actually delivers 1,800 mAh will give you 40% less runtime than calculated, which could mean the Pi doesn’t shut down cleanly before battery exhaustion.
TP4056 1A Li-Ion Battery Charging Board Micro USB with Current Protection
The TP4056 charging board is the foundation of many DIY Pi UPS designs. It provides reliable CC/CV charging at up to 1A with built-in protection — perfect for the charging stage of a custom single-cell UPS build.
Frequently Asked Questions
Q1: Will any 18650 UPS HAT work with Raspberry Pi 4, Pi 5, and Pi Zero?
Most 18650 UPS HATs are designed for the standard 40-pin GPIO header present on all modern Pi models (Pi 2/3/4/5/Zero). Verify two things: (1) current output — the Pi 4 and Pi 5 can draw up to 5A under load, and cheap HATs limited to 2–2.5A will throttle the Pi. (2) physical clearance — the Pi 5 has a taller component profile than earlier models. Check the HAT’s specifications against your specific Pi model.
Q2: Can I use a 2S or 3S 18650 pack with a Pi UPS HAT?
Standard Pi UPS HATs are designed for single-cell (1S) 18650 operation with a boost converter to 5V. Multi-cell (2S = 7.4V, 3S = 11.1V) configurations would require a buck converter instead of a boost converter and a different BMS. Some advanced UPS HATs support 2S operation, but check the specific product — do not mix a 2S pack with a 1S HAT.
Q3: How do I prevent SD card corruption when power fails?
Three-layer approach: (1) Use a high-quality SD card (Samsung Endurance, SanDisk Max Endurance) designed for continuous read/write. (2) Use a UPS HAT with graceful shutdown scripting. (3) Consider running the OS from an SSD or NVMe drive (via USB 3.0 or Pi 5 PCIe) which is far more resilient to unexpected power loss than SD cards.
Q4: Is it safe to leave a 18650 Pi UPS charging continuously (topping off mode)?
Quality UPS HATs use a proper power path circuit — when mains power is present, the Pi runs directly from mains while the HAT maintains cells at full charge. This is different from constantly cycling the cell through charge-discharge, which would wear it out. The cells in a good HAT should last 2–5 years of continuous standby use. Check your HAT’s datasheet to confirm it uses a power path circuit rather than a simple pass-through.
Q5: What is the best ready-made Pi UPS module available in India in 2026?
The Waveshare UPS HAT (B) and the UPS-Lite V1.3 are well-regarded for their I2C monitoring capability and clean power path design. For pure simplicity and cell replaceability, the X728 and X735 HATs from Geekworm are popular in the Indian maker community. All of these can be ordered online and delivered within India. Pair any of these with quality Samsung or LG 18650 cells from a reputable source for the best long-term reliability.
Build a Reliable Pi UPS with Components from Zbotic
Zbotic stocks the essential building blocks for your Raspberry Pi UPS project — 18650 holders, TP4056 charging modules, BMS protection boards, and boost converter modules. Get everything you need with fast delivery across India.
Add comment