Go Down

Topic: A Battery Management System(BMS) for 2018 (Read 1 time) previous topic - next topic


I'm trying to Use an Arduino/Arduino to make a BMS for my ebike battery, I could just buy one from China but that way I will not know exactly what is going on and rely on faith.

The basic idea is this to be able to manage a battery pack with up to 20 cells in series (more than that and I have to get different speed controllers).

The BMS must be able to mesure cell voltage, the AtoD converter should give me an accuracy of about 0.005v.

A Low Voltage And High Voltage cutoff will be needed to prevent over discharge and charge both settings must be user settable.

To stop the battery pack from getting out of balance there needs to be a balancing system in there.

The cutoff circuit would probably work best with mosfets 1 per 20a.

Unless someone has solved the problem it looks like I am going to have to go for a system with each cell controlled by its own ATtiny45 or 85 the outputs must be optically isolated from a controlling Arduino in the form of probably a nano though the chip from a uno could be used.

There needs to be a way to pole the ATtiny's so the information from them is recived one at a time, other information to be sent back is to control the balance circuitry (if the cell was high then connect the cell to a power resistor to drain the cell a bit till the cell is in line with the rest).
Once fully charged disconnect the charger from the BMS.

Have a way to connect a display to the BMS to check what the voltage of the cells are, mostly to be used while charging but can be used while the Battery is being discharged.

A possible extra idea would be to put a way to mesure how much power in the form of Watt Hours are being put into the battery how comes out and a way to in effect make a fuel tank gauge.(measuring from full charge to full discharge would be required for that the power would be stored, take a bit then store that as a fuel "tank"size with the energy going down not up.



That's a heck of a project!

I use a lot of LiIo batteries for various things but  nothing that large.  But this thread interests me because I have friends with e-bikes and we've discussed battery options and charging.

Please update this thread with your progress.  I'm earmarking it to check back on your progress.

Good luck!


I'm going to start small with a 3 cell setup this i should be able to breadboard.
First object is to get the attinys to recognise the LVC and HVC limits I want, for this I will need a few more attinys and a programming card there are plenty of instructions for making the latter on YouTube.
Next I'll be ordering some optoisolators for the link between the attinys and the Nano.


The LTC6802 (RS components) can monitor/balance 12 cells, and can be daisy-chained.
Might be easier/cheaper than 12 ATtiny and 12 mosfets.


I've been having some second thoughts instead of using one attiny per cell in series with its internal AtoD use an external AtoD with much higher resoloution to mesure 5 cells at once using a voltage divider to reduce the voltage to the 5v range one of the ADS1115's with a 16 bit converter should fit the bill. The first cell would use an internal AtoD the rest the AtoD converters in the ADS1115.

That chip has 4 AtoD converters with it the cells could be tested between ground and their cell positive so 1 cell would read the first cell 2 would read the first 2 cells and so on,voltage dividers  used where needed except for the first.

The voltage from the previous reading would be taken from the voltage measurement to separate out each cells individual voltage. In theory since 4 of these chips can be inputted into a single Arduino up to 17 cells could be measured but the accuracy would be reduced in the higher cells.

The coding would be more complicated but the reduction in number of components would probably be worth it.

A standard decider would probably be good enough allowing for overvoltage the maximum voltage you will need to read is 4.2v allow a bit of leeway so make it 4.5v per cell that way a 5 to1 decider should work.
I have all the parts needed to make a 5 cell tester at the moment I will just need the circuit for the voltage divider.

I'll take a look at the LTC6802.
The mosfets are not for use with the attinys they work as an electronic switch to disconnect the battery from the speed controller, I would need one for the charging side of things.



Jan 14, 2018, 11:21 am Last Edit: Jan 14, 2018, 11:24 am by Wawa
Four voltage dividers will discharge the cells unevenly.

The mosfets in the LTC are for cell balancing during charging time.

Did you consider "flying capacitors" with relays to measure the cells.
That would have zero draw from the cells, and no measurement difference between cells.
Because only one A/D is used.

Battery stack measurement is a frequent subject on this forum.
Search the site (lollypop on top of this page).


The LTC would probably be the best way to go but I would need a lot more information about it than I have found so far flying capacitors and relays sounds interesting what type of relay, what does the turm flying capacitors mean and how are they measured.


Jan 14, 2018, 08:10 pm Last Edit: Jan 14, 2018, 08:15 pm by Wawa
what type of relay, what does the turm flying capacitors mean and how are they measured.
Imagine you having to measure the battery of your car,
but you're not allowed to take the expensive digital multimeter out of the lab...

Take a small capacitor, and connect it to the battery of the car.
Voltage on the cap is now the same as the battery.
Throw it to your friend in the lab.
Your friend measures voltage on the cap, writes it down, and throws it back.
You connect it to the car battery again, in case you have to measure it again.
It did come back charged, so no new charge charge from the car battery is used.
This 'throwing' can be done with a small DPDT relay.

Pictures of an 8-cell flying cap experiment in post 49 here.

Go Up