Skip to content
Open access

AI-Enhanced Battery Management System with Real-Time SOC/SOH Estimation and IoT-Based Autonomous Load Control: Hardware Implementation on ESP32 with MQTT and ML Inference

Aug 2026 · International journal of computer information systems and industrial management applications · 0 citations

Abstract

This paper presents an AI-driven Battery Management System (BMS) with complete hardware implementation for real-time State of Charge (SOC) and State of Health (SOH) estimation in 3S lithium -ion battery packs (ICR-18650, 2500mAh, 11.1V nominal). Three machine learning models — Random Forest, XGBoost, and LSTM — are trained and evaluated on the NASABattery Dataset (9,742 records, 80/20 train/test split, random seed=42). Random Forest (n estimators=100) achieved the highestpredictive accuracy (R2=0.976, lowest MAE and RMSE across all targets) and was successfully deployed on an ESP32microcontroller (240 MHz, dual-core, WiFi-enabled) for embedded real-time inference. The hardware prototype integrates twoINA219 I2C current sensors (0x40, 0x41) with 0.1Ω shunt resistors for dual-load current measurement, a 2-channel active-low relaymodule (GPIO26, GPIO27) for autonomous load switching, and a JHD 16×2 LCD display for local monitoring. Battery voltageand current measurements are acquired at 500ms intervals and published over MQTT (broker.emqx.io:1883) at 2 -second intervalsacross 13 dedicated topics. Remote real-time monitoring and relay control is offered by a Flask-SocketIO web dashboard and aTkinter desktop interface. The trained Random Forest classifier (V Load Decision: 4 classes) is run on -device using a hybrid SOCalgorithm with Coulomb counting (60% weight) and voltage-based mapping (40% weight). System operation was confirmed usinglive readings: V=9.87V, SoC=39.4%, SoH=100%, Cycle=0; and the autonomous LOW VOLTAGE warning was triggered andRelay 1 was in control of the primary load at 0.061A / 0.60W. A staged protection logic offers progressive action: alert at less than10 V, load shedding at less than 9 V, and emergency shut down at less than 8 V. The feature importance analysis shows that the current (weight=0.53) and cycle count (0.30) are the main predictors of degradation. This article presents the ESP32 -based, IoT- assisted, ML-controlled BMS prototype that is proven on a real lithium-ion device, the transition between AI-based battery studies and real-world embedded implementation.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.