Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Power & Batteries
  4. ›Battery UPS HATs and Shields

Component guide · Intermediate · 3 min read

Battery UPS HATs and Shields

Waveshare UPS HAT E, DFRobot Pi 5 UPS, 16340, PowerBoost)

By Geekobot Learning Team · Updated 29 Oct 2026

On this page
Short answerWhat the Battery UPS HAT and shield isBattery UPS HAT and shield pinoutWiring the Battery UPS HAT and shieldExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

UPS HATs and battery shields keep a Raspberry Pi or Arduino running from lithium cells when mains power fails, and charge the cells when it returns. The Waveshare UPS HAT (E) holds four 21700 cells for a Pi 5, DFRobot's UPS HAT uses 18650 cells, and the 16340 shield suits small projects. The MCP73871 and MP2636 boards are charge-and-boost cores for custom builds.

Key specs at a glance

Waveshare UPS HAT (E)
4 x 21700, 5 V 5 A, USB-C PD input, I2C monitor
DFRobot Pi 5 UPS
18650 cells, 5.1 V 5 A
16340 shield
1 x 16340, 5 V and 3.3 V out
MCP73871
Load sharing USB/solar charger
MP2636
5 V 2.5 A boost with charger
Monitoring
I2C voltage/current on HATs
!Safety: Lithium cells need care

A shorted, over-charged or damaged lithium cell can get very hot and catch fire. Use a protection board or BMS, never short the terminals, charge on a non-flammable surface and do not leave a charging pack alone. Throw away cells that are swollen or dented.

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1Waveshare UPS HAT (E) 4 × 21700₹3,785
  • Option 216340 Battery Shield for Arduino and Raspberry Pi₹350
  • Option 3DFRobot Raspberry Pi 5 18650 Battery UPS HAT (5.1V 5A)₹6,735
  • Option 4MCP73871 USB / Solar LiPo Charger Board (5V PowerBoost)₹746
  • Option 5DFRobot MP2636 Power Booster & Charger Module – 5V 2.5A Output₹1,039
01

What the Battery UPS HAT and shield is

A battery UPS HAT or shield keeps a Raspberry Pi or Arduino running from lithium cells when the main supply fails, and recharges them when power returns.

Read battery status over I2C and shut the Pi down cleanly at low battery to avoid SD card corruption.

Cells are often not included; buy matched, quality cells and insert with the right polarity.

02

Battery UPS HAT and shield pinout

The pins on the Battery UPS HAT and shield and what each one does.

PinFunction
40-pin headerPi power and I2C
Battery holdersCells
USB-CCharging input
Pogo pinsPower to Pi (some HATs)
PinFunction
40-pin header
Pi power and I2C
Battery holders
Cells
USB-C
Charging input
Pogo pins
Power to Pi (some HATs)
03

Wiring the Battery UPS HAT and shield

Connect the Battery UPS HAT and shield like this.

Battery UPS HAT and shield pinRaspberry PiArduino / small boards
HATStacks on Pi 40-pin or pogo pinsShield stacks on Uno
InputUSB-C PD chargerMicro USB 5 V
HAT
Raspberry Pi:
Stacks on Pi 40-pin or pogo pins
Arduino / small boards:
Shield stacks on Uno
Input
Raspberry Pi:
USB-C PD charger
Arduino / small boards:
Micro USB 5 V
04

Example code

Address and thresholds depend on the HAT; use the maker's sample code.

Safe shutdown at low battery (Raspberry Pi, INA219 on the HAT) · MicroPython
from ina219 import INA219
import os, time

ina = INA219(0.01, address=0x41)
ina.configure()

while True:
    if ina.voltage() < 6.4:       # 2S pack near empty (check your HAT)
        os.system("sudo shutdown -h now")
    time.sleep(30)
05

Setup and tuning

Use protected, matched cells

fit quality cells of the size the board takes (21700, 18650 or 16340) with the right polarity.

Enough input power

a Pi 5 UPS needs a USB-C PD supply that can charge the cells and run the Pi together.

Safe shutdown

read the battery level over I2C and shut the Pi down cleanly before the cells run flat.

First charge

charge the cells fully before relying on the UPS.

Ventilation

keep the cells away from hot parts and do not seal the board in a box with no airflow.

06

What you need

Shop this list7 of 7 found in our store · ₹47,05,913

  • Waveshare UPS HAT (E) 4 × 21700: the part this guide coversWaveshare UPS HAT (E) 4 × 21700₹3,785
  • 16340 Battery Shield for Arduino and Raspberry Pi: another version this guide covers16340 Battery Shield for Arduino and Raspberry Pi₹350Closest match, check the specs
  • DFRobot Raspberry Pi 5 18650 Battery UPS HAT (5.1V 5A): another version this guide coversDFRobot Raspberry Pi 5 18650 Battery UPS HAT (5.1V 5A)₹6,735
  • MCP73871 USB / Solar LiPo Charger Board (5V PowerBoost): another version this guide coversMCP73871 USB / Solar LiPo Charger Board (5V PowerBoost)₹746
  • DFRobot MP2636 Power Booster & Charger Module – 5V 2.5A Output: another version this guide coversDFRobot MP2636 Power Booster & Charger Module – 5V 2.5A Output₹1,039
  • 18650 Li-ion rechargeable cell: the cell to charge or protect18650 Li-ion Rechargeable Cell₹119Closest match, check the specs
  • Digital multimeter: to check supply and signal voltagesDigital Multimeter₹177
07

Alternatives and when to choose them

  • ✓Raspberry Pi power supplies.
  • ✓Power bank modules.
  • ✓Battery fuel gauge modules.
08

Common mistakes to avoid

  • !Inserting a cell backwards, which can damage the board or the cell.
  • !Mixing old and new cells in one UPS.
  • !Letting the Pi run until the cells are flat with no clean shutdown.
  • !Using a weak supply that cannot charge and run the Pi together.
09

Frequently asked questions

How long will a UPS HAT run my Pi 5?

It depends on load and cells. Four 21700 cells can run a lightly loaded Pi 5 for a few hours.

Can I use unprotected 18650 cells?

Use good quality cells of the right size and polarity. Some boards include protection, but never use damaged or mixed cells.

Will the Pi shut down safely when the battery is low?

Only if you run the maker's script or your own code that reads the level and calls shutdown.

Can I power the UPS from a solar panel?

Some boards, such as the MCP73871 charger, support solar input. Check the input range first.

Why does my Pi show undervoltage on battery?

The UPS output or cables cannot supply the Pi's peak current. Use the board's rated output and short leads.

Parts for this guide

  • Waveshare UPS HAT (E) 4 × 21700
    ₹3,785View
  • 16340 Battery Shield for Arduino and Raspberry Pi
    ₹350View
  • DFRobot Raspberry Pi 5 18650 Battery UPS HAT (5.1V 5A)
    ₹6,735View
  • MCP73871 USB / Solar LiPo Charger Board (5V PowerBoost)
    ₹746View
  • DFRobot MP2636 Power Booster & Charger Module – 5V 2.5A Output
    ₹1,039View
  • 18650 Li-ion Rechargeable Cell
    ₹119View
  • Digital Multimeter
    ₹177View
Shop Chargers & BMSShop Battery Monitoring & Fuel Gauge ModulesShop Solar

Keep learning

Buying guideBeginnerRaspberry Pi Power Supplies and CablesPower a Raspberry Pi correctly: 5 V 5 A for Pi 5, 5 V 3 A for Pi 4, USB-C PD, cables with switches, undervoltage warnings, 18650 holders and UPS options.3 min read · Boards & MicrocontrollersComponent guideBeginnerLi-ion, 18650 and LiPo BatteriesLithium-ion cells, including 18650s and flat LiPo packs, store about 3.6 to 3.7 V nominal, charge to exactly 4.2 V and should not be discharged below about 3.0 V.4 min read · Power & BatteriesComponent guideIntermediateBattery Monitors and Fuel GaugesBattery percentage is hard to guess from voltage alone because it changes with load and temperature.3 min read · Power & Batteries

Sources

  • Waveshare UPS HAT (E) wiki
  • DFRobot UPS HAT wiki

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the Battery UPS HAT and shield isBattery UPS HAT and shield pinoutWiring the Battery UPS HAT and shieldExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide3 items · ₹10,697

Waveshare UPS HAT (E) 4 × 21700 · DFRobot Raspberry Pi 5 18650 Battery UPS HAT (5.1V 5A) · Digital Multimeter

Run itChange the inputs and watch the output

Checks every 30 s. Below 6.4 V on the 2S pack it shuts the Pi down cleanly.

Pack7.60 V
Shell
 

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question