Battery Management System with IOT using Kalman Filter

Published Nov 29, 2025
 6 hours to build
 Intermediate

Voltage,Current and SOC Estimation using Kalman Filter integrated with IOT for remote monitoring

display image

Components Used

ESP32-C6-DevKitM-1-N4
Multiprotocol Development Tools ESP32-C6 general-purpose development board, based on ESP32-C6-MINI-1. It has all the ESP32-C6 pins exposed and is easy to connect and use. Most of the I/O pins are broken out to the pin headers on both sides for easy interfacing. Developers can eithe
1
Lithium Ion Battery 3.7V 2500mAh 18650
Consumer Battery & Photo Battery 3.7V 2500mAh
1
Mini Push Button Switch - 5-6mm
Mini Push Button Switch - 5-6mm
1
Breadboard
Breadboard
1
18650 Battery Holder with Switch
Seeed Studio Accessories 18650 Battery Holder--2 18650 (with Switch)
1
Connecting Wire Jumper Wires
Connecting Wire Breadboard wires
1
TP4056 Battery charging Module
Power Management IC Development Tools Lithium Battery Charger
1
INA260
voltage and current measurment sensor
1
LED with resistor(330ohms)
As load for constant resistance and works under variable input voltage of cell(3.7-4.2v)
1
Description

 

 

Smart Battery Monitoring System Using ESP32-C6 & Blynk IoT

Modern electronics projects rely heavily on battery power — but most students  do not have professional tools to measure important battery parameters like real-time voltage, current, SoC (State of Charge), or health.
As a result:

  • We never know how much capacity the cell actually has
  • We don’t know how fast a project drains the battery
  • Projects often fail unexpectedly because the battery dies without warning

To solve this real problem, I built a Smart BMS (Battery Monitoring System) using:

  • ESP32-C6 (Wi-Fi + IoT)
  • INA260 precision current/voltage sensor
  • Kalman filtering for noise reduction
  • Hybrid SOC estimation (Coulomb Counting + OCV Fusion)
  • Blynk IoT dashboard for live monitoring

The result is a low-cost, accurate, real-time battery analyzer that works with any lithium cell.

What This Project Does

This Smart BMS continuously measures:

  • Voltage and current of the battery
  • State of Charge (%)
  • Live performance graphs through Blynk IoT

This system updates values every second, and shows them on a mobile dashboard, allowing users to monitor a cell from anywhere.

It solves 3 real problems makers commonly face:

(1) No accurate way to measure true battery capacity
Using Coulomb counting, the system can calculate mAh used during a discharge cycle.

(2) No stable readings due to sensor noise
Kalman filtering smoothens voltage & current data.

(3) No way to see battery status remotely
Blynk dashboard shows V, I, SOC in real time.

 

Pin Out and Connections

 

INA 260 
cc5v from es32 c6
GNDgnd of esp32 c6
SCLIO 8 
SDAIO 9
TP4056 
B++ve of cell
B--ve of cell
OUT+in+ of INA260
OUT--ve of push button

How the System Works

1. INA260 Sensor Measures the Battery

  • The INA260 provides millivolt-accurate voltage
  • And milliamp-accurate current (both directions)
  • ESP32-C6 reads these values through I²C pins (SDA=9, SCL=8)

These raw readings tend to be noisy, especially with small loads — that’s where filtering helps.

 

2. Noise Reduction Using a 2-State Kalman Filter

The code includes a lightweight bias-aware Kalman filter:

  • Removes electrical noise
  • Corrects drift
  • Stabilises millivolt-level readings

So the dashboard always shows smooth, realistic data.

 

3. SOC Calculation Using Two Methods

To get accurate battery percentage, the system blends:

-Coulomb Counting

Measures current over time (Ah = ∫I dt)
→ Tracks how much charge is consumed

-OCV Estimation (Open Circuit Voltage)

A lookup table maps voltage to SOC based on 18650 cell characteristics.

-Fusion Algorithm

SOC = 97% Coulomb Counting + 3% OCV
This prevents drift and keeps percentage realistic.

 

4. IoT Dashboard Using Blynk

The ESP32-C6 connects to Wi-Fi and updates:

  • Voltage → V0
  • Current → V1
  • SOC → V2

Data is sent once per second so the cloud stays stable.

The dashboard shows:

  • Gauges for Voltage, Current, SOC
  • Real-time streaming
  • Works from any location

 

 

 Key Features of the Code

- Stable 1-second updates (cloud-safe)

- I²C protection + fast sampling

INA260 configured for reliability:

  • 64-sample averaging
  • 1.1ms conversion time

- Kalman filters for V & I :Smooths out micro-fluctuations.

- Hybrid SOC algorithm :Much more accurate than using only voltage.

- Remote monitoring :Fully functional IoT BMS using your phone.

 

Conclusion

This Smart BMS transforms a regular 18650 cell into a fully monitored IoT power source.
With precise sensing, noise filtering, battery modelling, and cloud connectivity,
this project brings professional-grade battery analytics into the hands of students and hobbyists.

It is simple to build, inexpensive, and extremely practical —
and solves a very real problem:

 

“We all use batteries in our projects, but we rarely understand them.
This project finally makes battery health measurable, visible, and smart.”

 

 

DigiKey MyList- https://www.digikey.in/en/mylists/list/RVAA12S7JW

 

 

Codes

Downloads

BMS_IOT Images and Video Download
DigiKey MyList Download
Comments
Ad