IoT based Battery SoC (%) Monitoring System with ESP32
IoT based Battery SoC (%) Monitoring System ESP32 with PCB & low Power Mode ESP with Battery Charging & Discharging with ADC curve
- Suitable forB.Tech/Diploma ESP32/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this post, we will learn how to build an
IoT Based Battery SoC (%) Monitoring System using ESP32.
The
ESP32 module
from Espressif is a powerful microcontroller with integrated Wi-Fi and Bluetooth, making it ideal for connected and battery-powered applications.
This project is based on a
DIY ESP32 Battery Powered IoT Board
with a built-in
Battery Management and Charging System
. The board can charge any single-cell Lithium-Ion or Lithium-Polymer battery using a
BQ24092D charging IC
, while a
TPS63020 buck-boost converter
provides a stable 3.3 V supply to the ESP32. A simple
battery sensing circuit
connected to the ESP32 ADC pin allows accurate measurement of the battery voltage, from which the
State of Charge (SoC %)
can be calculated.
Since the battery is the primary power source, constant monitoring is essential to prevent
overcharging, deep discharging, or failure
. The charging IC ensures safe charging with auto cut-off, while the ESP32 continuously measures the battery status. Unlike older systems where battery management was limited to LED indicators, the integration of IoT allows users to monitor the battery remotely from a
ThingSpeak dashboard
on a computer or smartphone.
Our design incorporates several important features:
A
buck-boost converter (TPS63020)
for stable 3.3 V operation.
A
Li-ion charging IC (BQ24092D)
for safe USB charging and battery management.
A
battery sensing network
for measuring voltage and calculating SoC.
IoT integration via ESP32 Wi-Fi
for sending real-time battery data to ThingSpeak.
An
optional OLED display
for local monitoring without Wi-Fi.
Circuit Design & Schematic
Let’s walk through the hardware design of IoT based Battery SoC (%) Monitoring System with ESP32 in detail.
Fig: Schematic for IoT based Battery SoC (%) Monitoring System with ESP32
The board is powered and charged through a
USB Type-C port.
Charging is handled by the
BQ24092D IC.
It supports CC/CV charging, pre-conditioning, and auto cut-off. A small
LED
indicates charging status. A
JST-PH connector
is used to connect a
3.7 V Li-ion/LiPo battery
. A
slide switch
is added to turn the system on or off.
The regulated supply is provided by the
TPS63020 buck-boost converter.
It ensures a stable
3.3 V output
across the entire battery range (3.0–4.2 V). This keeps the ESP32 powered even at low battery levels.
Battery voltage is measured using a simple
resistor divider
(R11 = 100 kΩ, R12 = 100 kΩ). A small capacitor (C11 ≈ 100 nF) is added as a filter. The divided voltage is fed to
ADC pin IO34
of the ESP32. In software, this value is converted back to the real battery voltage and percentage.
Programming is done through the
PROG header
using an
FTDI adapter
. Two transistors, Q1 and Q2, handle the
auto-reset and auto-boot.
This means no buttons are needed during code upload.
Extra
GPIO pins
are broken out for sensors and modules.
IO4 (SDA)
and
IO5 (SCL)
provide an
I²C interface
for connecting an
OLED display.
This allows battery voltage and percentage to be viewed locally without Wi-Fi.
Download:
Schematic PDF
Download:
Bill of Materials (BOM)
Download:
Pick & Place File
BQ24092D Battery Management & Charging IC
Since the device is powered by a Lithium-Ion cell, safe charging and management are critical. This is handled by the
BQ24092D IC
, a highly integrated
linear charger and power-path management controller
from Texas Instruments.
Fig: BQ24092D Battery Charger Schematic
The
BQ24092D
is designed for portable applications and supports a
constant-current / constant-voltage (CC/CV) charging algorithm.
It automatically manages
preconditioning, fast charging
, and
charge termination.
The IC can seamlessly provide power to the system while charging the battery, thanks to its
dynamic power-path management
feature.
Key Technical Features
Input Voltage Range:
4.35 V to 6.4 V (USB or adapter input)
Charge Current:
Programmable up to 1 A (set by external resistor)
Power-Path Management:
Allows simultaneous battery charging and system powering
Preconditioning:
Automatic low-current charging for deeply discharged cells (< 3.0 V)
Fast-Charge:
Supplies constant current until battery approaches 4.2 V
Termination:
Automatic charge termination when the current falls below a preset threshold
Recharge:
Automatically restarts charging if battery voltage drops below ~4.05 V
Status Indication:
Open-drain outputs for charge status (charging, done, fault)
Safety Protections:
Thermal regulation (reduces charge current if IC overheats)
Input current limiting (protects USB ports from overdraw)
Over-voltage protection (protects battery and circuit)
Short-circuit and reverse current protection
Why BQ24092D in This Board?
By using the BQ24092D, the ESP32 IoT board achieves
reliable, safe, and efficient charging
. It ensures the battery is never overcharged or overheated, while still delivering stable
3.3 V
to the ESP32 and peripherals through the
buck-boost converter (TPS63020)
. The status LED makes it easy to check charging conditions at a glance.
This IC is especially useful for
IoT devices that run continuously
. Even when the battery is empty, the system can run from USB power without interruptions.
Battery Voltage Sensing with ESP32 ADC
To monitor the battery level, the ESP32 uses one of its
ADC pins (IO34)
. Since the battery voltage of a single-cell Li-ion/LiPo ranges from
3.0 V (discharged)
up to
4.2 V (fully charged)
, it cannot be fed directly into the ADC without scaling. The ESP32 ADC input range (with 11 dB attenuation) supports about
0–3.9 V
, so a
voltage divider network
is required.
Fig: ESP32 Battery Sensing Circuit
In this design, two
100 kΩ resistors (R11 and R12)
are used as a divider. This reduces the battery voltage by half before feeding it to the ADC pin:
V
sense
= (R12 / (R11 + R12)) × V
bat
With
R11 = R12 = 100 kΩ
, the divider ratio is
1:2
, meaning:
V
sense
= 0.5 × V
bat
So when the battery is at 4.2 V, the ADC pin only sees about
2.1 V
, which is safe.
Noise Filtering
To improve measurement stability, a small
capacitor (C11 ≈ 100 nF)
is added across R12. This forms an
RC filter
that smooths out switching noise from the buck-boost converter and charger IC.
ADC Reading & Conversion
The ESP32 reads the divided voltage as
Vsense
In software, the actual battery voltage is calculated as:
V
bat
= V
sense
× 2
From this voltage, the
State of Charge (SoC %)
is estimated using a
lookup table or interpolation
based on Li-ion discharge curves.
Design Considerations
High-value resistors (100 kΩ each) are used to minimize current drain from the battery (<20 µA).
A calibration offset is applied in software since ESP32 ADCs are
not perfectly linear
IO34 is an
input-only ADC pin
, so it’s ideal for sensing applications.
Project PCB Design, Gerber File & PCB Ordering Online
The schematic of the
IoT Battery SoC Monitoring System with ESP32
was created in
EasyEDA
, and from there it was converted into a compact PCB layout.
Fig: PCB Layout of ESP32 Battery Monitoring System
The board is designed with mostly
SMD components
to keep the size small. Resistors and capacitors are in the 0603 package, while the main ICs, such as the
TPS63020 buck-boost converter a
nd the
BQ24092D battery charger,
are also in SMD form.
Fig: Front Side of PCB
All of the critical components, including the ESP32-WROOM module, are placed on the
front side of the PCB
, which makes assembly easier and more reliable.
Fig: Backside of PCB
The
Gerber files
for this board are available and can be used to place an order directly with
ALLPCB
. They offer PCB prototyping services at very low cost, and new users get extra benefits.
👉
Download:
ESP32 Battery Monitoring System Gerber File
Ordering is straightforward: go to the
ALLPCB Official Website
. Then upload the Gerber files using the
Quote Now
option, and choose your board parameters like material, dimensions, thickness, quantity, and solder mask color.
Currently,
ALLPCB
pr
In this post, we will learn how to build an
IoT Based Battery SoC (%) Monitoring System using ESP32.
The
ESP32 module
from Espressif is a powerful microcontroller with integrated Wi-Fi and Bluetooth, making it ideal for connected and battery-powered applications.
This project is based on a
DIY ESP32 Battery Powered IoT Board
with a built-in
Battery Management and Charging System
. The board can charge any single-cell Lithium-Ion or Lithium-Polymer battery using a
BQ24092D charging IC
, while a
TPS63020 buck-boost converter
provides a stable 3.3 V supply to the ESP32. A simple
battery sensing circuit
connected to the ESP32 ADC pin allows accurate measurement of the battery voltage, from which the
State of Charge (SoC %)
can be calculated.
Since the battery is the primary power source, constant monitoring is essential to prevent
overcharging, deep discharging, or failure
. The charging IC ensures safe charging with auto cut-off, while the ESP32 continuously measures the battery status. Unlike older systems where battery management was limited to LED indicators, the integration of IoT allows users to monitor the battery remotely from a
ThingSpeak dashboard
on a computer or smartphone.
Our design incorporates several important features:
A
buck-boost converter (TPS63020)
for stable 3.3 V operation.
A
Li-ion charging IC (BQ24092D)
for safe USB charging and battery management.
A
battery sensing network
for measuring voltage and calculating SoC.
IoT integration via ESP32 Wi-Fi
for sending real-time battery data to ThingSpeak.
An
optional OLED display
for local monitoring without Wi-Fi.
Circuit Design & Schematic
Let’s walk through the hardware design of IoT based Battery SoC (%) Monitoring System with ESP32 in detail.
Fig: Schematic for IoT based Battery SoC (%) Monitoring System with ESP32
The board is powered and charged through a
USB Type-C port.
Charging is handled by the
BQ24092D IC.
It supports CC/CV charging, pre-conditioning, and auto cut-off. A small
LED
indicates charging status. A
JST-PH connector
is used to connect a
3.7 V Li-ion/LiPo battery
. A
slide switch
is added to turn the system on or off.
The regulated supply is provided by the
TPS63020 buck-boost converter.
It ensures a stable
3.3 V output
across the entire battery range (3.0–4.2 V). This keeps the ESP32 powered even at low battery levels.
Battery voltage is measured using a simple
resistor divider
(R11 = 100 kΩ, R12 = 100 kΩ). A small capacitor (C11 ≈ 100 nF) is added as a filter. The divided voltage is fed to
ADC pin IO34
of the ESP32. In software, this value is converted back to the real battery voltage and percentage.
Programming is done through the
PROG header
using an
FTDI adapter
. Two transistors, Q1 and Q2, handle the
auto-reset and auto-boot.
This means no buttons are needed during code upload.
Extra
GPIO pins
are broken out for sensors and modules.
IO4 (SDA)
and
IO5 (SCL)
provide an
I²C interface
for connecting an
OLED display.
This allows battery voltage and percentage to be viewed locally without Wi-Fi.
Download:
Schematic PDF
Download:
Bill of Materials (BOM)
Download:
Pick & Place File
BQ24092D Battery Management & Charging IC
Since the device is powered by a Lithium-Ion cell, safe charging and management are critical. This is handled by the
BQ24092D IC
, a highly integrated
linear charger and power-path management controller
from Texas Instruments.
Fig: BQ24092D Battery Charger Schematic
The
BQ24092D
is designed for portable applications and supports a
constant-current / constant-voltage (CC/CV) charging algorithm.
It automatically manages
preconditioning, fast charging
, and
charge termination.
The IC can seamlessly provide power to the system while charging the battery, thanks to its
dynamic power-path management
feature.
Key Technical Features
Input Voltage Range:
4.35 V to 6.4 V (USB or adapter input)
Charge Current:
Programmable up to 1 A (set by external resistor)
Power-Path Management:
Allows simultaneous battery charging and system powering
Preconditioning:
Automatic low-current charging for deeply discharged cells (< 3.0 V)
Fast-Charge:
Supplies constant current until battery approaches 4.2 V
Termination:
Automatic charge termination when the current falls below a preset threshold
Recharge:
Automatically restarts charging if battery voltage drops below ~4.05 V
Status Indication:
Open-drain outputs for charge status (charging, done, fault)
Safety Protections:
Thermal regulation (reduces charge current if IC overheats)
Input current limiting (protects USB ports from overdraw)
Over-voltage protection (protects battery and circuit)
Short-circuit and reverse current protection
Why BQ24092D in This Board?
By using the BQ24092D, the ESP32 IoT board achieves
reliable, safe, and efficient charging
. It ensures the battery is never overcharged or overheated, while still delivering stable
3.3 V
to the ESP32 and peripherals through the
buck-boost converter (TPS63020)
. The status LED makes it easy to check charging conditions at a glance.
This IC is especially useful for
IoT devices that run continuously
. Even when the battery is empty, the system can run from USB power without interruptions.
Battery Voltage Sensing with ESP32 ADC
To monitor the battery level, the ESP32 uses one of its
ADC pins (IO34)
. Since the battery voltage of a single-cell Li-ion/LiPo ranges from
3.0 V (discharged)
up to
4.2 V (fully charged)
, it cannot be fed directly into the ADC without scaling. The ESP32 ADC input range (with 11 dB attenuation) supports about
0–3.9 V
, so a
voltage divider network
is required.
Fig: ESP32 Battery Sensing Circuit
In this design, two
100 kΩ resistors (R11 and R12)
are used as a divider. This reduces the battery voltage by half before feeding it to the ADC pin:
V
sense
= (R12 / (R11 + R12)) × V
bat
With
R11 = R12 = 100 kΩ
, the divider ratio is
1:2
, meaning:
V
sense
= 0.5 × V
bat
So when the battery is at 4.2 V, the ADC pin only sees about
2.1 V
, which is safe.
Noise Filtering
To improve measurement stability, a small
capacitor (C11 ≈ 100 nF)
is added across R12. This forms an
RC filter
that smooths out switching noise from the buck-boost converter and charger IC.
ADC Reading & Conversion
The ESP32 reads the divided voltage as
Vsense
In software, the actual battery voltage is calculated as:
V
bat
= V
sense
× 2
From this voltage, the
State of Charge (SoC %)
is estimated using a
lookup table or interpolation
based on Li-ion discharge curves.
Design Considerations
High-value resistors (100 kΩ each) are used to minimize current drain from the battery (<20 µA).
A calibration offset is applied in software since ESP32 ADCs are
not perfectly linear
IO34 is an
input-only ADC pin
, so it’s ideal for sensing applications.
Project PCB Design, Gerber File & PCB Ordering Online
The schematic of the
IoT Battery SoC Monitoring System with ESP32
was created in
EasyEDA
, and from there it was converted into a compact PCB layout.
Fig: PCB Layout of ESP32 Battery Monitoring System
The board is designed with mostly
SMD components
to keep the size small. Resistors and capacitors are in the 0603 package, while the main ICs, such as the
TPS63020 buck-boost converter a
nd the
BQ24092D battery charger,
are also in SMD form.
Fig: Front Side of PCB
All of the critical components, including the ESP32-WROOM module, are placed on the
front side of the PCB
, which makes assembly easier and more reliable.
Fig: Backside of PCB
The
Gerber files
for this board are available and can be used to place an order directly with
ALLPCB
. They offer PCB prototyping services at very low cost, and new users get extra benefits.
👉
Download:
ESP32 Battery Monitoring System Gerber File
Ordering is straightforward: go to the
ALLPCB Official Website
. Then upload the Gerber files using the
Quote Now
option, and choose your board parameters like material, dimensions, thickness, quantity, and solder mask color.
Currently,
ALLPCB
pr
Technologies used
Hardware components
- ESP32
- OLED
Software & tools
- ThingSpeak
- EasyEDA
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.