Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Batteries & Power

Battery Fuel Gauge: Monitor Remaining Capacity with Arduino

Battery Fuel Gauge: Monitor Remaining Capacity with Arduino

April 1, 2026 /Posted by / 0
Table of Contents

  1. Voltage Alone Is Unreliable
  2. Coulomb Counting Explained
  3. INA219 Current and Voltage Sensor
  4. Arduino Fuel Gauge Circuit
  5. Arduino Code for Fuel Gauge
  6. Displaying Battery Percentage
  7. Pre-Built Indicator Modules

Knowing exactly how much charge remains in your battery is essential for reliable portable projects. A battery fuel gauge does more than just read voltage – it tracks coulombs in and out, accounting for discharge rate and temperature. This guide covers building an accurate fuel gauge with Arduino using the INA219 module.

Voltage Alone Is Unreliable

A lithium-ion cell’s voltage-to-capacity relationship is non-linear and changes with discharge rate, temperature, and cell age. A cell at 3.7V might be at 50% capacity under light load but only 30% under heavy load. The voltage also rebounds when load is removed, making instantaneous voltage readings misleading. This is why smartphones use dedicated fuel gauge ICs rather than simple voltage measurement.

Coulomb Counting Explained

Coulomb counting integrates current over time to track energy entering and leaving the battery. If the battery starts at 100% and you measure 500mA flowing out for 2 hours, you have used 1000mAh. Subtract that from the cell’s known capacity to get remaining percentage. The INA219 module provides both voltage and current measurements over I2C, making it ideal for this purpose.

CJMCU-219 INA219 I2C Bi-directional Current/Power Monitor
Price: ₹86
Precise I2C current/voltage sensor for fuel gauge projects
Buy on Zbotic.in
1S 18650 Lithium Battery Capacity Indicator Module
Price: ₹69
1S LED battery indicator – simple plug-and-play
Buy on Zbotic.in

INA219 Current and Voltage Sensor

The INA219 is a bi-directional current and voltage monitor that communicates via I2C. It measures voltage (0-26V) and current (up to ±3.2A in default configuration) with 12-bit resolution. With a 0.1-ohm shunt resistor on the module, it can detect currents as small as 0.1mA while handling up to 3.2A.

Arduino Fuel Gauge Circuit

Connect the INA219 in the high-side (positive path) of your battery circuit:

  1. Battery positive → INA219 VIN+ → INA219 VIN- → Load positive
  2. Battery negative → Load negative
  3. INA219 SDA → Arduino A4, INA219 SCL → Arduino A5
  4. INA219 VCC → Arduino 5V (or 3.3V), GND → Arduino GND

Arduino Code for Fuel Gauge

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;
float batteryCapacity_mAh = 2200.0; // Your cell's rated capacity
float consumedMah = 0;
unsigned long prevTime;

void setup() {
  Serial.begin(9600);
  ina219.begin();
  prevTime = millis();
}

void loop() {
  float voltage = ina219.getBusVoltage_V();
  float current = ina219.getCurrent_mA();
  unsigned long now = millis();

  float hours = (now - prevTime) / 3600000.0;
  consumedMah += current * hours;
  prevTime = now;

  float remaining = batteryCapacity_mAh - consumedMah;
  float percent = (remaining / batteryCapacity_mAh) * 100.0;
  percent = constrain(percent, 0, 100);

  Serial.print(voltage, 2); Serial.print("V  ");
  Serial.print(current, 1); Serial.print("mA  ");
  Serial.print(percent, 1); Serial.println("%");

  delay(500);
}
11.1-12.6V 3S Lithium Battery Capacity Indicator
Price: ₹71
3S battery indicator for 11.1V-12.6V packs
Buy on Zbotic.in
1S to 8S Battery Level Indicator Module
Price: ₹54
Universal 1S-8S indicator for any pack configuration
Buy on Zbotic.in

Displaying Battery Percentage

For visual feedback, connect an OLED display or LED bar graph. A simple 4-LED indicator can show: Green (75-100%), Yellow-Green (50-75%), Orange (25-50%), Red (0-25%). For OLED, display voltage, current draw, percentage, and estimated remaining runtime (remaining mAh / current draw).

Pre-Built Indicator Modules

If you prefer a ready-made solution, LED battery capacity indicator modules are available that simply connect in parallel with your battery and show charge level using LEDs:

Frequently Asked Questions

How accurate is coulomb counting?

With an INA219 and well-calibrated battery capacity value, accuracy is within 5-10%. Errors accumulate over time due to self-discharge and measurement drift. Reset to 100% when you detect the charging voltage (4.2V with near-zero current) and to 0% at the cutoff voltage.

Can I use a simple voltage divider instead of INA219?

A voltage divider can only measure voltage, not current. You get a rough charge estimate but cannot account for load-dependent voltage sag. The INA219 at ₹86 is well worth the investment for accurate fuel gauging.

What about dedicated fuel gauge ICs like MAX17043?

The MAX17043 uses a model-based approach (ModelGauge) that estimates capacity from voltage patterns rather than coulomb counting. It is more accurate for specific cell types but harder to source in India and requires no shunt resistor.

Ready to Power Your Next Project?

Browse our complete range of batteries, power supply modules, and charging accessories at Zbotic.in

Shop Batteries & Power Supply

Tags: Batteries, Batteries Power, India, Power
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
PCB Header Pin: Male Female Ri...
blog pcb header pin male female right angle options 614163
blog waveshare 7 5 inch e paper large dashboard display 614174
Waveshare 7.5-Inch E-Paper: La...

Related posts

Svg%3E
Read more

Power Electronics Lab: Equipment List for Students

April 1, 2026 0
Setting up a power electronics lab for students and hobbyists requires the right equipment to safely work with batteries, converters,... Continue reading
Svg%3E
Read more

Battery Recycling Process: Extract Materials Safely

April 1, 2026 0
Understanding the battery recycling process is essential as lithium-ion batteries reach end of life in growing numbers. India generates an... Continue reading
Svg%3E
Read more

Battery Formation: First Charge Process Explained

April 1, 2026 0
The battery formation process is the critical first charge cycle that transforms raw electrode materials into a functional lithium-ion battery... Continue reading
Svg%3E
Read more

Islanding Detection: Safety for Grid-Connected Solar

April 1, 2026 0
Islanding detection is the critical safety mechanism that prevents solar inverters from energising dead grid lines during a power outage.... Continue reading
Svg%3E
Read more

Grid Tied Inverter: Feed Solar Power to Grid India

April 1, 2026 0
A grid tied inverter converts DC solar power into AC electricity synchronised with the utility grid, allowing you to feed... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now