ESP32 Smart Battery Dashboard V2

Wiring Schematic

View full-size circuit ↗
LT

YOUR PROJECT LEARNING PATH

Build it with confidence.

Progress saves on this device
01

Project overview

Know what you’re building before you start wiring.

Build an advanced battery-monitoring system using an ESP32 and a rechargeable 18650 Li-ion battery with TP4056 charging hardware. It measures voltage and tracks battery behaviour through a responsive wireless dashboard for electronics learning.

The dashboard displays estimated battery percentage, voltage history, minimum and maximum voltage, average readings, session runtime, event logs, trends, and charger-input detection. Readings update automatically while the history and session analytics remain temporary.

Before you power up

Keep both divider outputs within safe ESP32 ADC limits. The dashboard's charger indicator detects input power, not confirmed active charging.

PROJECT ROADMAP3 project stages
✓
Prepare your kitConfirm the components and tools
⌁
Assemble the circuitFollow the build steps in order
⌘
Upload and testCheck the output and resolve issues
Start the build
02

Components required

Gather these parts before you begin.

ESP32 Development BoardReads battery and charger-supply voltages, then serves the browser dashboard.× 1
18650 Li-ion BatterySupplies the single-cell rechargeable voltage monitored by the system.× 1
TP4056 Charging ModuleCharges a single-cell Li-ion battery; protection features vary between module versions.× 1
2kΩ ResistorForms the upper arm of the charger-input voltage divider.× 1
1kΩ ResistorForms the battery divider and charger-input divider lower arms.× 3
BreadboardSupports the temporary assembly of the sensing and charging circuit.× 1
Jumper WiresConnect the divider nodes, module terminals, and ESP32 ground.× 10
USB CableProvides programming connection and power for the ESP32 development board.× 1
03

Build the project

Work through one focused step at a time. You can revisit any step whenever you need.

STEP 010 / 5 complete
BUILD STAGE 0120% of guide

Prepare the Battery Monitoring Components

Place the ESP32, breadboard, 18650 cell, and TP4056 module on a nonconductive surface. Inspect the battery and charging-module terminals before wiring, and prevent accidental shorts during handling or assembly.

Use a single-cell Li-ion battery compatible with the TP4056 module. Its protection features vary by model, so check the board before use.

1 of 5
04

Software & tools

Install these before uploading the firmware.

Arduino IDEEdits, compiles, and uploads firmware to the ESP32 development board.
ESP32 Board PackageProvides ESP32 board definitions and core APIs for this firmware.
WiFi LibraryConnects the ESP32 to an existing wireless network.
WebServer LibraryHosts the dashboard and processes live data and reset requests.
05

Expected output

Compare your build with the result described here.

FINAL CHECKPOINT

After upload, Serial Monitor at 115200 baud reports the Wi-Fi connection and local IP address. Open that address from a browser connected to the same router network to load the live dashboard.

The dashboard displays battery voltage, estimated percentage, a charger-input label, voltage history, minimum and maximum values, average voltage, session duration, voltage trend, stability, and the latest activity events with periodic browser updates.

06

Troubleshooting & fixes

Choose the issue that best matches what you’re seeing.

01Incorrect battery voltage or percentage
Try these checks

Check the two 1kΩ battery-divider resistors and the GPIO 34 junction. The firmware uses a 2.0 ratio; measure the ADC voltage, confirm the wiring, and calibrate percentage thresholds for the cell.

02Charging status appears incorrect
Try these checks

GPIO 35 measures the charger-input voltage through its divider, not TP4056 CHRG/STDBY pins. Check the 2kΩ/1kΩ network and understand that input presence can be shown as charging even when charging has completed.

03Dashboard fails to connect or update
Try these checks

Confirm the ESP32 joins the configured Wi-Fi network and copy the current IP from Serial Monitor. Check browser access, /data responses, and ESP32 power; restart after changing network credentials.