E-bike battery monitor with state of charge and range
Electric scooters and e-bikes are booming in India, but riders often have only a few bars to judge range, and packs age without warning. A monitor that counts charge in and out, checks cell balance and temperature and estimates range teaches battery management.
- Parts
- ₹3,447
- Build
- 14 weeks
- Board
- ESP32
- Objectives
- 5
Block diagram
- Current sensorCounts charge in and out
- Cell taps and ADCMeasure each cell's voltage
- NTC probesMeasure pack temperature
- ESP32Estimates SoC, health and range
- Pack with BMSThe battery under test
- OLED displayShows SoC, range and warnings
- Cloud dashboardStores readings, plots trends and sends alerts+
Objectives
- To measure each cell's voltage within ±10 mV and pack current within ±2%.
- To estimate state of charge by coulomb counting, corrected by open-circuit voltage at rest.
- To estimate remaining range from recent Wh per km.
- To warn on cell imbalance, high temperature or low charge, and measure SoC error over full cycles.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
Parts and specifications
- ESP32 DevKit V1Dual-core 240 MHz, 520 KB SRAM, Wi-Fi + Bluetooth, 3.3 V logic, 12-bit ADC (use ADC1 pins when Wi-Fi is on)₹450Buy
- ACS712 current sensor (20 A)Hall effect, 100 mV/A for the 20 A version, output centred at 2.5 V, 2.1 kV isolation₹150Buy
- 12 V geared motor with load (test load)12 V, 300 RPM, about 10 kg·cm, 0.3 A no-load and up to 3 A stall₹450Buy
- LM2596 buck converter4 to 40 V in, 1.25 to 37 V out, up to 2 A continuous (3 A peak), about 85% efficient₹90Buy
- × 61% resistors for cell dividers₹12
Total about ₹3,447 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Tap 2 reads cells 1 + 2; cell 2 = V(tap 2) − V(tap 1). Dividers scale 12.6 V to within the ADS1115 ±4.096 V range (ratio 4, 30 kΩ / 10 kΩ, 1% resistors, calibrate each).
SoC(t) = SoC0 − (1 / Capacity) × ∫ I dt. Sampling every 100 ms: 4 A for 30 minutes removes 2 Ah from a 4 Ah pack = 50%.
After 30 minutes at rest, look up SoC from open-circuit voltage per cell (for example 3.85 V ≈ 70%, 3.65 V ≈ 30%) and reset the drift.
Recent consumption 12 Wh/km (bike) with 300 Wh left → 25 km. In the model use Wh per minute of motor run instead.
Warn when any cell differs by over 50 mV from the mean at rest.
Pin map
| Signal | Pin or connection |
|---|---|
| Cell taps 1S / 2S / 3S via dividers | ADS1115 A0 / A1 / A2 (0x48 on GPIO 21 / 22) |
| ACS712 OUT | ADS1115 A3 (better than the ESP32 ADC) |
| NTC probes | GPIO 34 / 35 with 10 kΩ dividers |
| OLED | Same I²C bus |
| Load relay or MOSFET | GPIO 26 (test load control) |
Firmware outline
- Every 100 ms read current (zero offset taken at rest) and integrate charge.
- Every second read cell voltages and temperatures.
- Correct SoC from OCV after a rest; learn actual capacity from full-to-empty cycles (state of health).
- Show SoC %, range, pack V, current, hottest temperature and warnings on the OLED.
- Log to flash and send to a phone app (upgrade).
Test plan
| Test | Expected result |
|---|---|
| Each cell vs a multimeter | Within ±10 mV |
| Current vs clamp meter at 1, 2, 4 A | Within ±2% |
| Full discharge and charge cycles | SoC error at end vs OCV |
| One cell slightly discharged | Imbalance warning |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Build these first
Datasheets and sources to cite
- Plett, Battery Management Systems Vol. 1
- AIS 156 (EV battery safety, India)
- TI ADS1115 datasheet
About this project
How much does the e-bike battery monitor with state of charge and range project cost?
About ₹3,447 for the parts in the base list: ESP32 DevKit V1, ACS712 current sensor (20 A), ADS1115 16-bit ADC, NTC 10 kΩ waterproof probe × 2, 0.96 inch OLED (SSD1306, I²C), Li-ion 18650 pack 3S2P (11.1 V), 3S BMS 20 A, 12 V geared motor with load (test load), LM2596 buck converter, 5 A glass fuse with holder, 1% resistors for cell dividers × 6.
How long does it take?
About 12 weeks for the base project, built on an ESP32. Each upgrade adds time.
Which branches is it suitable for?
Electrical and Electronics, Electronics and Communication, Instrumentation, as a major project.
Which pins and design calculations does it use?
Cell taps 1S / 2S / 3S via dividers on ADS1115 A0 / A1 / A2 (0x48 on GPIO 21 / 22); ACS712 OUT on ADS1115 A3 (better than the ESP32 ADC); NTC probes on GPIO 34 / 35 with 10 kΩ dividers. Worked calculations on this page: cell voltages from taps, coulomb counting, ocv correction, range, imbalance.
How do I test it?
Each cell vs a multimeter: Within ±10 mV. Current vs clamp meter at 1, 2, 4 A: Within ±2%. Full discharge and charge cycles: SoC error at end vs OCV. One cell slightly discharged: Imbalance warning.
What are the objectives?
To measure each cell's voltage within ±10 mV and pack current within ±2%. To estimate state of charge by coulomb counting, corrected by open-circuit voltage at rest. To estimate remaining range from recent Wh per km. To warn on cell imbalance, high temperature or low charge, and measure SoC error over full cycles.
