Lessons and the learning game

Battery management systems

What a BMS measures and why, on two 18650 cells: chemistries, series strings, balancing, charge state, protection and charging, ending in a pack monitor.

Take it on /learn as Battery management systems.

Lithium is serious

A shorted or punctured lithium cell can burn in a way water does not put out. On the bench: protected cells or a real BMS board, a fuse in the pack lead, never charge below 0 C or above the cell's rated voltage (4.2 V for most), never leave a charging pack alone, and charge in a fireproof bag or tin. Swollen, dented or hot cells go to a battery recycler. The simulator's cells never heat, swell or burn.

The lessons

  1. Chemistries: one 18650 on a meter and a load. 4.2 V full, 3.0 V empty, internal resistance, a pouch that sags more, and a table of lithium-ion, LiFePO4, NiMH and lead-acid.
  2. Series strings: a 2S pack, one current through both cells, and a weak cell that empties while the pack voltage looks fine.
  3. Balancing: a bleed resistor and an AO3400A across each cell drain the high one.
  4. State of charge: volts against counted coulombs, and a gauge with the wrong capacity.
  5. Protection: overcurrent, undervoltage and imbalance, with a latching low-side MOSFET.
  6. Charging profiles: a TP4056 charges one cell: constant current, constant voltage, and the end of charge.
  7. Boss: a 2S pack monitor: wire the protection MOSFET, prove the trips, and set the limits for your own pack.

The pack monitor

The sketch is packmon. A0 reads the middle of the pack (cell 2), A1 the top through a 10k / 10k divider, and cell 1 is the difference. An INA219 in the pack's + lead measures the current, and pin 7 drives an IRLZ44N in the load's return to the pack's -. It trips on any cell under uv (3.00 V), over ov (4.25 V), or a current over oc (2.00 A), and stays off until reset. Serial commands: uv 3.20, ov 4.25, oc 2.00, capacity 2500 (mAh) and reset. Settings live in RAM, so a fresh Run starts from the defaults.

Stand-ins and limits

  • A cell's voltage is a straight line from empty to full; a real lithium-ion curve is flat in the middle and steep at the ends.
  • Some steps cut a cell's capacity to a few mAh so it fills or empties in seconds.
  • The Uno checks every 20 ms or so. A real BMS chip trips on a short in microseconds, and a real pack still has a fuse.
  • The TP4056 module here has no DW01 protection chip and no temperature sensor.