Component guide · Intermediate · 3 min read
Battery Monitors and Fuel Gauges
Coulomb Counters, UPS HATs and Charger Modules
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
Battery percentage is hard to guess from voltage alone because it changes with load and temperature. A coulomb counter such as the LTC2941 adds up the current in and out for a much better state-of-charge estimate. For projects, pick a charger or UPS module that matches your cell type, then read battery voltage or the gauge over I2C and calibrate on a full charge.
Key specs at a glance
- Coulomb counter
- Grove LTC2941 module, I2C, 3.3 to 5 V
- UPS HAT
- DFRobot Raspberry Pi 5 18650 UPS HAT, 5.1 V 5 A
- Charger boards
- TP4056X 50/200/500 mA, MP2636 charger with 5 V boost
- Solar charger
- DFRobot solar LiPo charger 500 mA
- Readout
- I2C registers or ADC voltage
- Cells
- Single Li-ion and LiPo, 18650
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.
Why voltage alone is not enough
Lithium cell voltage drops under load and rises when the load is removed, and the curve is flat in the middle. A voltage-only gauge jumps around and misreads at low temperature. See the Li-ion SoC calculator for typical voltage-to-percent values, and treat them as rough.
Ways to estimate charge
Choose by accuracy needed.
| Method | Accuracy | Notes |
|---|---|---|
| Voltage only | Rough | Cheap; read with an ADC or divider |
| Coulomb counting (LTC2941) | Good | Needs a known starting point and a sense resistor |
| Fuel-gauge IC with model | Best | Learns the cell's behaviour over cycles |
| UPS HAT with fuel gauge | Good | Often reports voltage and current to the host |
- Voltage only
- Accuracy:
- Rough
- Notes:
- Cheap; read with an ADC or divider
- Coulomb counting (LTC2941)
- Accuracy:
- Good
- Notes:
- Needs a known starting point and a sense resistor
- Fuel-gauge IC with model
- Accuracy:
- Best
- Notes:
- Learns the cell's behaviour over cycles
- UPS HAT with fuel gauge
- Accuracy:
- Good
- Notes:
- Often reports voltage and current to the host
Charger and UPS modules
The DFRobot TP4056X board charges a single cell with selectable current, the MP2636 module charges and boosts to 5 V for Raspberry Pi-style loads, and the solar LiPo charger harvests small panels. The Raspberry Pi 5 18650 UPS HAT keeps the Pi running through power cuts. Match the module to your cells and read TP4056 charger, solar power and Pi power supplies.
Reading a gauge over I2C
- 1Connect SDA, SCL, power and ground; see I2C.
- 2Install the library and set the sense resistor and battery capacity.
- 3Charge the battery fully and set the gauge to 100%.
- 4Read the charge register during use and display a percentage.
- 5Recalibrate when the cell ages or capacity changes.
Safety
Protect cells with a protection circuit or BMS; see BMS boards and lithium batteries. Never charge below 0 °C. Use fuses on high-current lines.
Try it: Li ion soc calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Trusting a voltage-only percentage under load.
- Forgetting to set the gauge to 100% after a full charge.
- Charging a cell with a module rated for another chemistry.
- Ignoring cell protection.
- Using the wrong sense resistor value.
Frequently asked questions
What is a coulomb counter?
A chip that adds up current flowing in and out of the battery.
Why does my battery percentage jump?
Voltage changes with load. Average the readings or use a gauge IC.
Can I use a TP4056 for a power bank?
It charges one cell, but needs a boost converter and protection for a complete power bank.
What does an UPS HAT do?
It keeps the Pi powered from batteries when mains power fails.
Do I need a sense resistor?
Yes, for current-based gauges.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 1 step-by-step build in our project library uses parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.





