# 4S Battery voltmeter for individual cells(schematic help please)

Hey guys total noob here. I have this 4S li ion battery, i would like to monitor each cell with my arduino. I dont have enough available analog input pins on board so im planning to use ADS1015 to measure each cell and pull the data with I2C interface.
Where im struggling to solve is how to connect each cell to ADS1015.
Currently i have a balance plug connected to the pack so i can get 4.2v-8.2-12.6-16.8v respectively relative to the packs negative.

I cant connect them directly because my logic is 3.3V so i have to use voltage divider for each cell. First cell is ok i can just connect it by dividing the value by 2 with resistors and multiply it by 2 on the arduino side.
for the second cell im getting confused.
can i connect 2.cell’s voltage divider reference to 1.cell’s positive side so i can still make the calculation from 4.2v and use the same resistor values all across for every cell? In this case on each hop i wont get more than 4.2v per cell and my formula on arduino side will be the same for each cell
OR
i should use common ground and adjust each cell’s voltage divider circuit in a way that they wont exceed 3.3v and use the resistor values in arduino side for calculation for each cell. also in order to find cell 4 voltage i will have to measure and sum all 3 beneath it and subtract them from the 4th cell in order to find the value.

Im not sure which one is acceptable or even if they would work correctly. i attached both schematics for both cases in order explain it better.

Circuit 5 won’t work as the voltages at the higher cells will exceed your 3.3v . ( put some resistors together and try it ) . In option 6 you may not get the voltage resolution you want for the top cells.
I’m sure people have done this sort of thing before and Google might show up some projects ?
Another option is to use 4 relays and switch across each cell (both pos and neg side “ flying contacts” ) in turn to measure its voltage - you need to add series resistor, as well as a divider in case more than one relay operates to stop shorts.
Some fuses might be a good idea as shorting these packs is dangerous.

You can buy quite cheap meters that can measure cell voltages and balance them or chargers that can do the same , including charge to full or storage voltage etc , by the correct method - IMO by the time you’ve messed about and packaged something , it might be the better and safer route.

Hi,
OPs diagram.
Diag 5.

Diag 6.

Tom...

hammy:
Circuit 5 won’t work as the voltages at the higher cells will exceed your 3.3v . ( put some resistors together and try it ) . In option 6 you may not get the voltage resolution you want for the top cells.
I’m sure people have done this sort of thing before and Google might show up some projects ?
Another option is to use 4 relays and switch across each cell (both pos and neg side “ flying contacts” ) in turn to measure its voltage - you need to add series resistor, as well as a divider in case more than one relay operates to stop shorts.
Some fuses might be a good idea as shorting these packs is dangerous.

You can buy quite cheap meters that can measure cell voltages and balance them or chargers that can do the same , including charge to full or storage voltage etc , by the correct method - IMO by the time you’ve messed about and packaged something , it might be the better and safer route.

i came up with a circuit 5 because when i check individual cell voltages from the balance port i put the negative lead of the multimeter to the positive side of the previous battery and positive lead to the positive side of the actual battery that im reading so thats why i tied the ground side of the voltage divider to the previous cells positive side but never tried it probably i should test it on the breadboard and see what kind of results im going to read.

The thing is ive got a charger/balance board and it does the job but occasionally i would like to read the voltages and see their values. currently im removing balance port and checking each pin with a multimeter. circuit must be as slim and small as possible. this chip looks like a good option but only if i can make it work
if the circuit 6 wont give me around 10-20mV resolution then theres no point in it.
theres this http://www.ti.com/product/BQ76940?qgpn=bq76940 battery monitor and bms chip from TI which accepts cells according to its schematic and you can connect to it using a micro controller like arduino and talk to it but its just too complicated for my need.
im gonna try the schematic 5 for the first 3 cells on the breadboard using resistors and see what kind of voltage im going to get and report it here.

so halfway thru when i was preparing the breadboard i realized although im changing the reference of the voltage divider im not changing the reference of ADS1015 so it wont work tested it and voltage goes up in 2V increments. for 3S final value became 6V.

so the only option im left with is the diagram no.6 i think it should work at least for some reading.

i also found this analog pin multiplexer CD74HC4067 16 Channel Analog Digital Multiplexer Breakout Board Module|Integrated Circuits| - AliExpress but it requires 4 gpio + vdd + gnd in total 6 pins and i have to use the arduino analog resolution vs 4 pins in total for the ads1015 with 12 bit res.
also if i use ads1115(16bit resolution) instead of ads1015(12bit resolution) i might get more accurate results for the higher cells?

so in this case in order to measure the 4th cell, i will take 10 samples from each cell up to 4th cell divide the value by 10 and sum them all and subtract them from the final value
i.e for the 4th cell
cell1 = sample /10
cell2 = sample /10
cell3 = sample /10
cell4 = (sample/10) - (cell1+cell2+cell3)
etc.. for each cell..
there are %0.1 resistors that can be used instead of %1 do you guys think its worth it because there are not widely available for each value like %1.

Perhaps, instead of using 10ish or so external A:D converters, you will only be able to hook up 2 or 3 to the Arduino. You might want to use an analog switch and a little math.

Consider, if you have 3 batteries in series. If you measure the voltage of the first battery, by switching in the first battery to be measure and all other batteries are not switched in, you get the reading of the 1st battery. Let's say battery 1 has a voltage of 1.1 volts.

Then open the switch to battery 1 and close the switch to battery 2. Lets say you now get a reading of 2.2 volts. You know know that battery 2 has a voltage of 1.1 volts. Then do the whole switching the switch thing to now read the voltage on top of battery 3 and you get 3.4 colts. Subtract that reading from 2.2 volts and you get the reading of battery 3.

You'll not need to get an external A:D or 10 and with the analog switches wired in a matrix thingy you can use one Uno to address which A:D to read.

Idahowalker:
Perhaps, instead of using 10ish or so external A:D converters, you will only be able to hook up 2 or 3 to the Arduino. You might want to use an analog switch and a little math.

Consider, if you have 3 batteries in series. If you measure the voltage of the first battery, by switching in the first battery to be measure and all other batteries are not switched in, you get the reading of the 1st battery. Let’s say battery 1 has a voltage of 1.1 volts.

Then open the switch to battery 1 and close the switch to battery 2. Lets say you now get a reading of 2.2 volts. You know know that battery 2 has a voltage of 1.1 volts. Then do the whole switching the switch thing to now read the voltage on top of battery 3 and you get 3.4 colts. Subtract that reading from 2.2 volts and you get the reading of battery 3.

You’ll not need to get an external A:D or 10 and with the analog switches wired in a matrix thingy you can use one Uno to address which A:D to read.

thanks for the suggestion but i kinda want something automated i may attach oled screen and keep it on all the time. also im planning to get an electric bicycle and they do have some bms and voltage wiring but thats about it. what im trying to do is to extend the capabilities of simple and cheap bms by adding some cell voltage monitor. i mean posibilities are endless i can hook up an nrf24 or some other module to send the data as well but for bikes they go up to 10-12S which i guess its still doable with this setup but i have concerns about the resolution.

im aiming for 10mV resolution i found some %0.1 resistors and for example if i want to measure fully charged 10s battery thats 42V!

if i feed it through 255K- 20K divider i will get 3.055V reading which is in good limits of my logic.
lets say battery dropped 10mv and the actual voltage became 41.990V then i will get 3.054V which is for 1mV drop in my logic i get 10mV drop in the battery.

ads.setGain(GAIN_TWOTHIRDS); // 2/3x gain +/- 6.144V 1 bit = 3mV 0.1875mV (default) for ads 1115 each bit is 0.1875mV which way less than the 1mV value i need. thus it can compensate for the fluctuations if there are any.

im not sure if im looking at this correctly im just trying to make sense but it looks like it could work

orhanyor:
im not sure if im looking at this correctly im just trying to make sense but it looks like it could work

Not sure where to start correcting.
Did you Google things like "battery stack cell measurement site:arduino.cc"

The ADS1115 on a 3.3volt supply is best used at PGA2 (2.048volt).
So calculate your four dividers for that to get the full 15-bit (not 16) resolution.

0.1% resistors is throwing away money for nothing.
Just use common/stable 1% metalfilm. You must calibrate final readout anyway.

Measuring a 3S or 4S pack with four dividers might be just OK, but a 10S pack...
Dividers discharge the pack unevenly.
The lowest cell needs to support all dividers, the top cell just one.
A "flying cap" circuit might be more suited for a 10S pack.
Leo..

I was working on something like this for 4 6V batteries , It works in my simulator but not tried it in the real world, I'm yet to build it and test it, The Bat1-4 just go into the ADS115

Would something like this work ?

Steveiboy:
Would something like this work ?

Sure. Something like that has been done before.
Leo..

Wawa:
Not sure where to start correcting.
Did you Google things like "battery stack cell measurement site:arduino.cc"

The ADS1115 on a 3.3volt supply is best used at PGA2 (2.048volt).
So calculate your four dividers for that to get the full 15-bit (not 16) resolution.

0.1% resistors is throwing away money for nothing.
Just use common/stable 1% metalfilm. You must calibrate final readout anyway.

Measuring a 3S or 4S pack with four dividers might be just OK, but a 10S pack...
Dividers discharge the pack unevenly.
The lowest cell needs to support all dividers, the top cell just one.
A "flying cap" circuit might be more suited for a 10S pack.
Leo..

i saw that PGA2 option so its definitely worth to recalculate my resistor values to benefit from the full range. each cell is 9Ah do you think drain will be significant to unbalance the pack considering i charge it every 2-3 days sometimes once a week

Drain depends on resistor values, so you can calculate that.

If unbalance is going to be a problem depends if your pack has a cell balancer.

For a 4S pack (16.8volt), resistor ratio should be 1:7.4 if you use PCA2.
Can use the same dividers for all taps, to keep resolution the same.
Leo…

Wawa:
Drain depends on resistor values, so you can calculate that.

If unbalance is going to be a problem depends if your pack has a cell balancer.

For a 4S pack (16.8volt), resistor ratio should be 1:7.4 if you use PCA2.
Can use the same dividers for all taps, to keep resolution the same.
Leo…

ok i will recalculate the resistors according to PCA2 i will take 1.95V as my max to have some head room and test the whole thing. probably leave it for 2 weeks and see the result but even after that BMS should take care of the drift.

10k:75k could work (1.9765volt, 3.6% headroom, 4.35volt/cell).
75k is a standard E24 value, but can also be made with 2*150k in parallel.
Leo..

Wawa:
Measuring a 3S or 4S pack with four dividers might be just OK, but a 10S pack...

Good luck..

Wawa:
Good luck..

thanks, i decided test a ready made module with my friends e bike battery which is 13s. i will test 7-8-9-10th battery in series with voltage dividers with calibrated resistor values see what kind of precision im going to get, if i can get a reasonable reading from the top batteries then lower ones will definitely give me better results.
i read its recommended to use small caps closer to the analog inputs, is 10nf-100nf would be ok?

orhanyor:
...with calibrated resistor values...

Nah...
Just calibrate voltage readout for each ADS channel against a good DMM.
That also takes care of other factors (if any).

orhanyor:
if i can get a reasonable reading from the top batteries then lower ones will definitely give me better results.

Not if you keep divider values the same. The stack/cell voltage resolution will stay the same.
Not wise to lower resistor values for lower cells, because of skewed cell discharge.

orhanyor:
i read its recommended to use small caps closer to the analog inputs, is 10nf-100nf would be ok?

Yes. Use 100n ceramic from each A/D input to ground.
It gives the A/D something 'solid' to sample from when voltage dividers with relative high values are used.
Leo..

Wawa:
Nah…
Just calibrate voltage readout for each ADS channel against a good DMM.
That also takes care of other factors (if any).
Not if you keep divider values the same. The stack/cell voltage resolution will stay the same.
Not wise to lower resistor values for lower cells, because of skewed cell discharge.
Yes. Use 100n ceramic from each A/D input to ground.
It gives the A/D something ‘solid’ to sample from when voltage dividers with relative high values are used.
Leo…

i was planning to use fixed R1 value for each cell and change only R2 according to the cell number to keep the resolution at max.
100nF it is! thanks.

Wawa:
Not sure where to start correcting.
Did you Google things like “battery stack cell measurement site:arduino.cc”

The ADS1115 on a 3.3volt supply is best used at PGA2 (2.048volt).
So calculate your four dividers for that to get the full 15-bit (not 16) resolution.

0.1% resistors is throwing away money for nothing.
Just use common/stable 1% metalfilm. You must calibrate final readout anyway.

Measuring a 3S or 4S pack with four dividers might be just OK, but a 10S pack…
Dividers discharge the pack unevenly.
The lowest cell needs to support all dividers, the top cell just one.
A “flying cap” circuit might be more suited for a 10S pack.
Leo…

after a long wait i got the ads 1115 boards and tried to measure 4s pack which was very successful and i liked how calm the readings were, they werent jumping around etc but calibration was needed so i just corrected the multipliers in the code until i get the matching values for each cell to the readings in my multimeter.

i was thinking about the uneven discharge you mentioned. what if it cut the pack ground from the common ground and put it behind a mosfet, in a way that it will only activate when theres a power in the I2C(ads1115) device? would this help at all?

ok that above post wont work im not very familiar but i guess i need to use mosfets for each cells low side in order for it to work. instead may be if i can drain batteries equally would be better and simpler for me. my initial test and thinking was to have a constant R1 for each battery and calculate R2 which yields in different drain values on each cell.. circuit1
instead if i adjust the R1 along with R2 i can get around the same drain on each cell according to this simulation. does this looks right? circuit2 around 13-15 microamps drain for each cell