Ground reference for BMS (Battery Management System) using Uno

Hello all

So I have been trying to make a small BMS using an Uno. I'm, for the time being, working with only 4 cells (18650 Li-ion) in series. So basically a 4S system. The issue is that these cells are connected in series and I need to check for the voltage of each cell individually. As I move to the second cell I need the ground reference for it to be positive of cell 1 and so on and so forth. If I am to use the Arduino ADC channel, my ground stays 0V and the output I get at the second cell is the sum of cell 1 and cell 2.

Now I have tried something and was wondering what do you guys suggest for it. I decided to use two analog muxes. HCF4051BE to be precise. It's an 8-to-1 mux/demux. I'm only using 5 channels from it.

What I have done is that channel 1 to 5 are connected to the ground of cell 1 and then onwards to the positive terminal of each cell in series. This gives me a successive sum at the end of the whole thing. I plan to have another mux that is connected the same way.

The aim is that while mux 1 is, let's say using the output from channel 2, mux 2 is using the output from channel 1. The difference between the values that I then obtain will be used to measure the voltage of the cell connected between channel 1 and 2 of either mux.

I can't seem to figure though how to make that shift happen in such a way that it's synchronized like that. Any suggestions on what I could do to achieve this?

I know it sounds a bit confusing, so feel free to ask for any clarifications
Thank you who try to help.

B0 to A0, B1 to A1, B2 to A2, B3 to A3.

Measurement of B0 = A0

Measurement of B1 = A1 - A0

Measurement of B2 = A2-(A0+A1)

Measurement of B3 = A3-(A0+A1+A2)

is one possibility.

That would mean using multiple ADC channels. I'm using the mux in order to minimize that because the ultimate goal is to have at least 7 cells in series. It would also mean more voltage dividers as the voltage currently is around 15V total. Each A input will require it's own voltage divider in that case if I'm not mistaken (besides of course A0 and A1 as they are under the limit).

To make it clear, currently, I'm using a 1 voltage divider only, that is the output of the mux and only one ADC channel as well.

Saad95:
Hello all

So I have been trying to make a small BMS using an Uno. I'm, for the time being, working with only 4 cells (18650 Li-ion) in series. So basically a 4S system. The issue is that these cells are connected in series and I need to check for the voltage of each cell individually. As I move to the second cell I need the ground reference for it to be positive of cell 1 and so on and so forth. If I am to use the Arduino ADC channel, my ground stays 0V and the output I get at the second cell is the sum of cell 1 and cell 2.

Now I have tried something and was wondering what do you guys suggest for it. I decided to use two analog muxes. HCF4051BE to be precise. It's an 8-to-1 mux/demux. I'm only using 5 channels from it.

What I have done is that channel 1 to 5 are connected to the ground of cell 1 and then onwards to the positive terminal of each cell in series. This gives me a successive sum at the end of the whole thing. I plan to have another mux that is connected the same way.

No, that will (literally) vaporize the analog switches. Analog switches only work for signal between the 0V and 5V rails,
as does the Arduino analog input. Lithium cells are powerful enough to rip all your circuitry to shreds if you
feed a higher voltage back to the chips.

You can have an identical voltage divider per cell and switch the outputs of those, so that the switch only
sees voltages below 5V.

You can have unequal dividers per cell to increase the resolution, but that's more complex.

The simplest approach is matched dividers (1% or better resistors), each divider capable of handling the max pack
voltage. The upper legs of each divider protect your circuitry from any high currents that the cells could
push into short circuit.

You might want a higher resolution ADC for lots of cells, but with 4 cells 10 bit is plenty so long as the Arduino
supply is properly regulated.

Each cell's voltage is the difference of two readings, not exactly hard to deal with!

The balancing hardware itself is going to be more of an interesting problem... A BMS for lithium has to implement active balancing.

Ahh I should have mentioned I suppose. I looked into the data-sheet and the max the mux can handle is about 20V (well within the range currently). So the mux is being powered by the cells separately. The common output from the mux then goes to a voltage divider and then to the Arduino "A0". The Arduino is only controlling the switching (through pins 2, 3, 4) by cycling through the binary combinations and writing a high or low to the appropriate bits. The Arduino is powered through USB so that's roughly about 5.11V (measured using a multimeter).

As for the balancing part, most likely might go for passive balancing at least to make a working model. But yea, that part comes later. Right now trying to read the proper voltages for protection from overcharging and discharging.