Arduino – multi-cell voltmeter

Right at the start of the saga which is my multi-cell voltmeter/potential BMS, I considered and rejected the simplest way of doing this, namely using voltage dividers to drop the voltage from the cells down to within the range of the Arduino analog to digital converter, and connecting all 16 cells to 16 analog pins and reading in turn. I programmed it, tested a bit of it, but in the end the 10 bit value of the digital voltage reduced the resolution to about 1/20 of a volt if I was going to allow for a 16 cell LiFePO4 battery. This was nowhere near accurate enough and I started looking at many, many alternatives, none of which works because of the need for a common ground!

Pondering possibilities the other day, I realised that the 10 bit resolution was possibly just a restriction of Arduino, and maybe I should be looking at other chips. Then a lightbulb when on in my head – what if all Arduino are not created equal? A quick search shows that the Arduino Due and Arduino Zero both allow for using a 12bit resolution – so instead of 1024 discreet steps, they can use 4096 steps. This might not sound like much, but when combined with another couple of changes, the resolution is down to 0.011 volts, or just a little bit more than 1/100 of a volt. Obviously 4 times the steps to not give 5 times the resolution, so what else have I decided to do? Well, if I go down the DUE path, the DUE only has 12 analog inputs, which forces me to build for just a 12 cell battery, not a 16 cell battery. If I am doing that, I only have to allow for a total voltage of 43.6 (call it 45) volts. Divide that into 4096 steps, and there is the 1/100 of a volt resolution.

So here I am back at the beginning, building another array of voltage dividers, to reduce 0-45v down to a 0-3.3v range, and using simple code to read the total voltage at each cell in turn, subtracting the previous cell value from this cell to give the cell voltage. Obviously there will be some tweaking for resistor variations in the voltage dividers, and we will need to adjust the measured voltage back up into the 0-45v range, but all should be good for measuring the individual voltages of 12 cells in series. The common Ground problem is resolved – in fact it becomes the main feature rather than a problem.

Later on I may re-introduce the MUX/DEMUX chip to read all 12 cells into a single analog pin, but only if I need to use some of the 12 pins for other devices (real time clock or GPS unit). I don’t think I will go back to 16 cells, I am now a confirmed 36v e-bike man, and 60v over 4096 steps reduces the resolution a little too much.

Posted in Arduino, Computer Stuff, Electric Bikes, Programming

Leave a Reply

Your email address will not be published. Required fields are marked *

*