Skip to main content
Wie wil meedoen met de solarbike zelfbouw club?
Who wants to join the solarbike DIY club?

Battery management system BMS

Published: 30 April 2011
Last updated: 18 November 2023


A battery management system (BMS) is an electronic system that manages a rechargeable battery. A BMS that only contains battery protection is a so-called protection circuit module (PCM).

Required extra BMS functions for my solar bike

In the future, I want to develop a battery charger that can charge an ebike battery in a short time with 1000W. This requires a special BMS, because normally, small charging currents are used with ebike batteries. My solar bike also needs a special BMS. These are the additional requirements for the BMS:

  • Internal resistance compensation during charging and discharging
  • Charge and discharge at the same time
  • Charging current 10A
  • Bluetooth interface

Standard BMS functions

  • Over- and under-voltage protection for each cell.
  • Overcurrent protection.
  • Battery cell balancing.
  • Logging of individual cell voltages to detect bad cells.

Optional BMS functions

  • Estimating the battery state of charge by Coulomb counting.

BMS common port vs separate charge and discharge port

Some BMS allows simultaneously charging and discharging. There are two different kinds of charge and discharge port configurations:

BMS common separate portBMS common / separate charge and discharge port

The separate ports BMS configuration has two advantages:

  • There is less loss because the discharge current does not also pass through the charge Mosfet Q2.
  • The charge Mosfet Q2 can be smaller than the discharge Mosfet Q1.

It is not as easy as it seems, so are Q1 and Q2 sometimes in active-diode mode where the drain voltage is lower than the source voltage. The Mosfets are turned on and off as follows:


  • Discharge Mosfet Q1 is on and switched off when battery is empty
  • Charge Mosfet Q2 is on and in active diode mode


  • Discharge Mosfet Q1 is on and in active diode mode
  • Charge Mosfet Q2 is on and switched off when battery is full

A common port BMS requires a current direction detection

Controlling the Mosfets with a common port BMS is more complicated than with a separate port BMS:

When the battery voltage is at the minimum level, there are two situations:

  1. When charging, Q1 and Q2 must be on
  2. Discharging is not allowed, Q1 must be off

So, Q1 is only on during charging, an extra charge current detection circuit is required.
A separate port BMS requires no charge current detection circuit.

When the battery voltage is at the maximum level, there are also two situations:

  1. When discharging, Q1 and Q2 must be on
  2. Charging is not allowed, Q2 must be off

So, Q2 is only on during discharging, an extra discharge current detection circuit is required.

Using a BMS with separate port as a BMS with common port

According to the circuit, you would suppose that you could always use a BMS with a separate port as a BMS with a common port. So you use the charge port as a discharge port. That's not true. It depends on the BMS if it works safe.

The difference is that now the load is connected to Q2 instead of Q1 and Q2 should be on during discharging. If not, Q2 will be working as a diode during discharging and will overheat. Previously, Q2 was not used during discharging and it didn't matter if it was on or off during discharge. I have tested this, it works well with the OZ890 BMS chip.

There is also another problem, you don't know if Q2 is strong enough for the large discharge current.

Charging and discharging a dual port BMS at the same time

What happens if this BMS is discharged with 4A via the discharge port and charged by 1A via the charge port. The BMS thinks it is discharged with 3A and could turn off Q2. That will overheat Q2 because it is in diode mode during charging. I have tested this, it works well with the OZ890 BMS chip.

Charging and discharging a common port BMS at the same time

This is of course no problem since the BMS sees just the resulting current. It comes down to charging or discharging.

Dual port circuit example

How the MOSFETS are controlled can be seen in the following example of an OZ890 BMS chip.

BMS OZ890 dual port circuit exampleBMS OZ890 dual port circuit example

Connecting e-bike BMS protected batteries in parallel

When connecting batteries with built-in BMS in parallel, the following happens: if battery BH with a higher voltage is connected to a battery BL with a lower voltage, then BH is in load mode and BL is in charge mode.
A voltage difference creates a current from BH to BL. The current is: I = (UH-UL) / (Ri1 + Ri2)A voltage difference creates a current from BH to BL. The current is:

I = (UH-UL) / (Ri1 + Ri2)

Suppose the internal battery resistances are 100mΩ and 200mΩ and the maximum permissible current is 2A, then the maximum voltage difference is U = 3A * (100mΩ + 150mΩ) = 0.75V.

Paralleling a second battery to Yamaha Haibike e-bike battery

This may seem simple in principle, but technically speaking it is more complicated than it initially seems. Here is a diagram as the situation will be if the external battery has a common port BMS. Note that the Yamaha has a separate port BMS:

Dual battery install to a Yamaha Haibike e-bike batteryDual battery install to a Yamaha Haibike e-bike battery

An extra battery with a so-called common port is charged and loaded via the same connector. The charging plug of the Yamaha is very small and cannot be used as an output. That is why the extra battery is connected to the thick + and - cables. But now a critical situation has arisen, namely if a battery charger is used on the + and - then the Yamaha battery will be overcharged because BMS1 cannot turn off the charging if the battery is fully charged because Q2 is not in use.

The "Dangerous charger" is not allowed in this situation because the BMS1 has no safety charge control with only transistor Q1 in use.

It is important that both batteries have the same voltage before connecting them in parallel, otherwise, excessive current will flow between the batteries. You can equalize the voltage by a series resistance of, for example, 10 Ohm 10W.

The need for iR compensation

During charging, the voltage is measured across the battery, but this is not the actual voltage because the voltage drop across the internal resistor (Ri) is not taken into account. The actual battery voltage during charging is lower than the measured value:
U battery = U measured - charging current * Ri
As a result, charging is stopped too early. The opposite is the case with discharging. Unfortunately, no compensation is done in any BMS for ebikes.

Here is a calculation:
The internal resistance of the battery that I use is 110mΩ (LiFePO4 A123 ANR26650 12s2p). The voltage drop across the internal resistor with a charge or discharge current of 9A is 1V. You can see that this has a lot of influence in the discharge graph:

The need for battery iR compensationThe need for battery iR compensation

The majority of the discharge graph is between 37V and 39V, and therefore a measurement error of 1V is completely unacceptable. Here is a link:

Over-voltage and under-voltage battery protection

LiFePO4 batteries, as well as lithium-ion batteries, doesn't like to be overcharged or over-discharged. Therefore a fail-safe circuitry is mandatory. It shuts down the battery pack when the voltage of one of the battery cells becomes outside the safe range, for A123 LiFePO4 batteries this is about 2V to 4V. The fail-safe circuitry is part of the so called battery management system (BMS).

LiFePO4 battery safe voltage areaLiFePO4 battery safe voltage area

A BMS contains quite a lot of electronics to be able to measure all the individual cell voltages. Power MOSFETs are used as switches to shut down the battery. A BMS is often equipped with extra functions, such as a balancer.

Battery capacity improvement with battery cell balancing

Upon discharging, the entire battery pack is shut off when the weakest cell drops below the lower voltage limit. It is clear that the other cells are still not completely empty. Upon loading plays the same problem. To get the maximum capacity out of a battery pack, the cells must therefore be balanced. Cell balancers can be dissipative or nondissipative.

Here is a practical example from Charles Richter that shows the capacity improvement that a balancing BMS can bring about.

Battery capacity improvement by switched capacitor cell balancing BMS Battery capacity improvement by switched capacitor cell balancing BMS

Balancing ultracapacitors

Ultracapacitors have to be balanced also. Although I will not treat this kind of storage, I want to mention that the information about the battery cell balancing is useful for ultracapacitors too.

Gross and maintenance balancing

Gross balancing

At a new battery pack, it is important that the cells have to be balanced manually for the first time. The battery cells must be charged to the same voltage. If this is not done, the BMS can't balance anymore because the balance current is too low to balance cells with large differences in charge, see more about this HERE. The same plays a role, if broken cells have to be replaced.

Maintenance balance

A BMS is designed for maintenance balance, not for gross balancing. If a battery pack starts balanced, the BMS has just to compensate for the variation in self-discharge leakage in the cells. Therefore, the balancing current is generally just 10mA to 100mA.

Passive cell balancers

Also called bleeding cell balancers or dissipative cell balancers. Resistors are used to bleed the energy from the good cells, in order to match the voltage to those of the bad cells. It is clear that this is wasting a lot of energy because the good cells are in the majority.

Passive cell balancing circuitPassive cell balancing circuit

Bleeding cell balancing BMS with 390Ω bleeding resistorsBleeding cell balancing BMS with 390Ω bleeding resistors

The balancing procedure can proceed as follow:

  1. Initially, the balancer is turned off after the battery charger is connected.
  2. When any battery cell reaches 3.65V, the BMS will turn on the balancing circuit in this channel, and the discharge resistor in this channel will slightly drain the cell.
  3. When any cell reaches 3.9V, the BMS will turn off the charge current by the power transistor in the charge line.
  4. At that time, all the cells whose voltages are higher than 3.65V will be still being drained by the discharge resistors in their channels. This way, all the high cells will be discharged to 3.65V.
  5. When the highest cell drops to around 3.7V, the BMS will connect the charger again.
  6. Note that, at this time, there are cells that are still below 3.65V.
  7. Return to 2.

Finally, all cells are fully charged to 3.65V.

Battery charger turn off

Some battery chargers turn off permanently after the charge current is turned off by the BMS. This is not allowed because the balancer is not able to repeat the balance steps. The battery is not balanced completely and some cells haven't reached 3.65V.

Active cell balancers

Also called nondissipative cell balancers or distribution cell balancers. An distribution cell balancer moves energy from the good cells to the bad cells. This can be done capacitive or inductive.

Capacitive cell balancers

A common method is using a charge shuttling balancing circuit, containing a flying capacitors, for every two neighbouring battery cells. Each cell contains a balancing circuit that can move energy with a capacitor to cells above or below in the cell string. Over time, all cell voltages will be equal.

The number flying capacitors is the number of battery cells -1.

Capacitive cell balancing circuit with flying capacitorsCapacitive cell balancing circuit with flying capacitors

It is clear that when the good and bad cells are on the opposite ends of the cell string, the charge would have to travel through every cell. Because of the cell-to-cell transfer loss, this kind of capacitive balancing has a maximum efficiency of just 50% in practise. The maximum number of battery cells in series that can be used without killing the efficiency is about 12.

Capacity cell balancing BMS "AE-LMD17 REV A1"Capacity cell balancing BMS "AE-LMD17 REV A1"

A serious disadvantage of the capacity cell balancer is that it requires a certain cell voltage difference to function, but on the flat section of the LiFePO4 discharge graph the voltage differences between cells are very small.

Inductive cell balancers - transformer based

Energy transfer in power supplies is commonly done inductively, with coils and transformers. We see only capacitor based power supplies at lower power levels. Inductive cell balancers are faster and have a higher efficiency than capacitive cell balancers. At a transformer based cell balancing BMS, the primary winding is used for the battery pack and the secondary windings are used for the individual cells.

Transformer based cell balancers can be divided between bottom cell balancers and top cell balancers.

  • Bottom cell balancing. A battery cell receives energy from the entire battery pack.
  • Top cell balancing. The entire battery pack receives energy from a battery cell.

Here is a bottom cell balancer that uses a flyback transformer with a winding for every cell.

Inductive cell balancing circuit with flyback transformerInductive cell balancing circuit with flyback transformer

At a transformer-based cell balancer, the transformer can be used at a convenient way to measure individual cell voltages. If a battery cell is connected to its secondary winding, on the primary winding arise a voltage pulse proportional to the cell voltage.

Inductive cell balancers - inductor based

An inductor based cell balancing BMS is the patented PowerPump cell balancing technology from Texas Instruments. It uses a buck-boost converter to transfer the energy from one cell to the other. It is used at the TI chipset BQ78PL114 / BQ76PL102, which is unfortunately not recommended for new designs, but still in production. See PowerLAN Gateway Battery Management Controller with Power Pump Cell Balancing.

PowerPump inductive cell balancing circuit with the TI chipset BQ78PL114 / BQ76PL102PowerPump inductive cell balancing circuit with the TI chipset BQ78PL114 / BQ76PL102

Unfortunately, there is no e-bike BMS on the market that uses the TI chipset. Currently Per Hassel Sørensen is developing an advanced BMS with this chipset.

Charge only or continues cell balancing

BMS can be divided further into two types:

  • Charge only cell balancing. 
    Balancing is done at the end of the charge cyclus. The advantage is that at the end of the charging, the voltage differences between the battery cells are maximal. Bleeding cell balancers are mostly of this type.
  • Continues cell balancing.
    This method also fixes imbalances that develop during operation. However, it is hard to measure the individual cell voltages during operation, when the battery is under load. The battery cell voltages can vary among themselves more as a result of the internal resistances as by the charge differences.

Battery fuel gauge

Accurately determining the battery state-of-charge is quite a task, it requires sophisticated hardware and software. Special microcontrollers have been designed for it, for instance the Texas Instruments BQ34Z100

Regenerative braking with BMS

Hub motors without freewheel can be used for regenerative braking. Instead of using the brake when driving downhill, the motor is used as generator and the energy is stored into the battery. Regenerative braking is no problem for the BMS; it is the same as if a battery charger is connected.

If the battery is full, the BMS switches the battery off:

  • While the motor/generator is abruptly switched off, braking is stopped, this can cause a dangerous condition.
  • The voltage of the motor/generator at high speed can exceed the BMS maximum voltage, this can damage the BMS.

Over-discharging lithium-ion batteries

If a battery is stored for a long time it can become over-discharged. Another reason is a failing BMS, this happens to me more than once! Lithium-ion batteries may become irreversible damaged by over-discharging. See Battery University for more about it.

To allow charging over-discharged batteries, a BMS should have the possibility to re-charge over-discharged batteries with a small current.

DC fuse for secondary battery protection

The BMS is equipped with a fast over current protection. But we can't rely on the electronic fuse of the BMS alone. For secondary protection and to fulfill safety tests, an additional fuse is required. For DC currents we can't use standard fuses; these are designed for AC currents and will not cut DC currents properly. The DC current may remain and the fuse may explode or cause a fire. We need a special high current DC fuse, such as the 30A 250VDC fuse 0324030.HXP from Littelfuse. The resistance is 1.82mΩ.

Fast acting ceramic DC fuse Littelfuse 0324-030.HXPFast acting ceramic DC fuse Littelfuse 0324-030.HXP

Fuse holder resistance loss

The resistance of fuse holders is often larger than the fuse itself. These values are measured at 8A:

  • Fuse 5 x 20mm F16A, R = 4mΩ

Fuse 5x20mmFuse 5x20mm

  • Chassis mount fuse holder. R ~ 1mΩ

Chassis mount fuse holderChassis mount fuse holder

  • In-line fuse holder. R > 10mΩ

In-line fuse holderIn-line fuse holder

  • Panel mount fuse holder. R > 20mΩ

Panel mount fuse holderPanel mount fuse holder


  • "A cost optimized battery management system with active cell balancing for lithium ion battery stacks" Infineon Technologies, Carl Bonfiglio, Werner Roessler.
  • "How to Efficiently and Safely Charge a Lithium Iron Phosphate (LiFePO4) Battery" Texas Instruments, Jinrong Qian.

Other articles from Ebike electronics