Design and build a full-featured BMS for a 7S Li-ion battery pack with cell balancing, SOC estimation, temperature protection, and CAN bus telemetry. This comprehensive guide covers everything from design through implementation, testing, and deployment.
🧪
Theory & Background
Li-ion batteries require strict control to prevent: overcharge (>4.20V per cell → electrolyte decomposition, thermal runaway), over-discharge (<2.5V → copper dissolution, permanent capacity loss), overcurrent (short circuit → rapid self-heating → thermal runaway → fire), over-temperature (>60°C → accelerated aging, thermal runaway risk). BMS functions: Cell voltage monitoring (each cell individually), Current monitoring (charge + discharge), Temperature monitoring (cells + PCB), Protection switches (disconnect pack on fault), Cell balancing (equalize cell SOC), SOC estimation (remaining capacity), Communication (telemetry to host).
Advertisement
🔨
Components & Requirements
10 components required for this project.
#
Component
Purpose
Qty
1
BQ76940 Battery Monitor IC (15S capable)
Cell voltage and temperature monitoring
x1
2
BQ76200 High-Side FET driver
Charge/discharge MOSFET switching
x1
3
N-channel MOSFETs (100V, 30A) × 2
Pack charge and discharge switches
x2
4
Passive balancing resistors (2Ω, 1W per cell)
Cell voltage equalization
x7
5
NTC thermistors (10kΩ) × 4
Cell and PCB temperature sensing
x4
6
STM32G0 MCU (BMS host)
SOC algorithm and CAN telemetry
x1
7
SN65HVD230 CAN transceiver
CAN bus communication
x1
8
Current sensor (ACS758, ±50A Hall effect)
Pack charge/discharge current
x1
9
Li-ion cells (Samsung 21700, 5Ah) × 7
Battery cells (7S configuration)
x7
10
Coulomb counter (LTC4150)
Integrated current-time for SOC
x1
📋
Step-by-Step Implementation
Follow these 4 steps carefully.
1
Battery Safety and BMS Functions
Li-ion batteries require strict control to prevent: overcharge (>4.20V per cell → electrolyte decomposition, thermal runaway), over-discharge (<2.5V → copper dissolution, permanent capacity loss), overcurrent (short circuit → rapid self-heating → thermal runaway → fire), over-temperature (>60°C → accelerated aging, thermal runaway risk). BMS functions: Cell voltage monitoring (each cell individually), Current monitoring (charge + discharge), Temperature monitoring (cells + PCB), Protection switches (disconnect pack on fault), Cell balancing (equalize cell SOC), SOC estimation (remaining capacity), Communication (telemetry to host).
2
BQ76940 Cell Monitoring
BQ76940 monitors up to 15 series cells. Each cell connected to VC+ and VC- pins. Integrated ADC measures cell voltages with ±1mV accuracy. Temperature inputs: NTC thermistors via TS1–TS3 pins. Communication: I2C to MCU at 400kHz. Registers: CELLVOLTAGE1–15 (16-bit each), SYS_STAT (fault flags: OV, UV, OCD, SCD, OVRD_ALERT). Alerts: OV (over voltage), UV (under voltage) hardware comparators with programmable thresholds (via OV_TRIP, UV_TRIP registers). SCD (Short Circuit in Discharge): hardware latch within 70µs — far faster than MCU response.
3
State of Charge (SOC) Estimation
SOC estimation methods: Coulomb Counting (integrate current over time: SOC = SOC_initial - ∫I×dt / capacity). Accurate when reset is possible, accumulates drift over time. Voltage-Based: OCV (Open Circuit Voltage) vs SOC table lookup. Accurate at rest (after 2h equilibration), useless during load. Kalman Filter: combines Coulomb Counting with OCV correction, accounts for temperature and aging effects. Battery model: equivalent circuit (V_oc + R_internal + RC pairs for transient response). Extended Kalman Filter is industry standard for EV BMS.
4
Cell Balancing Strategy
Passive balancing: excess charge in high cells dissipated as heat through resistor. Simple, reliable, cheap. Energy wasted (efficiency loss). Bypass controlled by BMS: when cell voltage > (pack_average + 10mV), enable balancing resistor. Continue until within 5mV. Only balance near full SOC (cells most divergent at top). Active balancing: transfer energy from high cells to low cells using DCDC converters. High efficiency (80–90%), complex, expensive. Used in premium EV packs. For this project: passive balancing via BQ76940's integrated balancing switches (with external resistors).