## MCP3008 - reading voltage of batteries in series

eric512
Posts: 3
Joined: Sun Dec 03, 2017 8:04 am

### MCP3008 - reading voltage of batteries in series

Running a Pi 3 with a MCP3008 and a voltage divider. Reads a 12v or with higher resistors, 24v etc etc.

I would like to read the voltage of a series of batteries. I have 4 12v batts in series for my UPS, 54v total. I want to read the voltage of each battery individually while they are connected in series.

Can this be done with one MCP3008 and a voltage divider for each 12v battery?

Not sure how to connect the ground circuits.

Aloha

mahjongg
Forum Moderator
Posts: 10914
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

### Re: MCP3008 - reading voltage of batteries in series

You essentially simply want to read multiple voltages.
So you will need multiple ADCs, or use an “analog multiplexer” to connect one of the voltages to the ADCs input.
Connect all GNDs together.

stevend
Posts: 188
Joined: Fri Oct 11, 2013 12:28 pm

### Re: MCP3008 - reading voltage of batteries in series

If using one MCP3008, its ground needs to be connected to the negative of the Pi's power supply, and to the negative of the complete battery assembly.
You then have several choices:
1. You can use separate potential dividers to measure the voltages of 1, 2, 3 and 4 batteries in series, and subtract to get the voltage of each individual battery. If you don't need great accuracy, this may be good enough (but remember that the potential dividers take current at all times).

2. You can use several A-D converters, electrically isolated from each other and the Pi, each measuring the voltage across a single battery. This gets a bit more complicated hardware-wise, but is probably the most accurate solution.

3. You can use an A-D converter in differential mode. Not sure that the MCP3008's 'pseudo-differential' mode is good enough for this; you may need to either use a better A-D converter, or use op amps in differential mode to generate a single-ended voltage input.

4. Sure I've seen specialist chips designed to do exactly what you want (it's a fairly common problem); suspect these won't be available on easy to use PCBs. Have a search if you've got the hardware building skills.

eric512
Posts: 3
Joined: Sun Dec 03, 2017 8:04 am

### Re: MCP3008 - reading voltage of batteries in series

stevend wrote:
Sun Dec 03, 2017 3:04 pm
If using one MCP3008, its ground needs to be connected to the negative of the Pi's power supply, and to the negative of the complete battery assembly.
You then have several choices:
1. You can use separate potential dividers to measure the voltages of 1, 2, 3 and 4 batteries in series, and subtract to get the voltage of each individual battery. If you don't need great accuracy, this may be good enough (but remember that the potential dividers take current at all times).

2. You can use several A-D converters, electrically isolated from each other and the Pi, each measuring the voltage across a single battery. This gets a bit more complicated hardware-wise, but is probably the most accurate solution.

3. You can use an A-D converter in differential mode. Not sure that the MCP3008's 'pseudo-differential' mode is good enough for this; you may need to either use a better A-D converter, or use op amps in differential mode to generate a single-ended voltage input.

4. Sure I've seen specialist chips designed to do exactly what you want (it's a fairly common problem); suspect these won't be available on easy to use PCBs. Have a search if you've got the hardware building skills.

#1 Looks simple, but like you said, a crap shoot.

#2 Interesting, but not sure if I can get the Pi to talk to 4 MCP3008s

#3 Thought about this route from some search results I've found - a few examples out there

#4 Would like to go with this one, the Maxim 14920 chip looks ideal, but hard to tinker with on a breadboard. I've queried for an eval kit. Don't know if they are avail still. Going to look into fully built products, but they may be \$\$\$

I'll post some progress

Aloha

stevend
Posts: 188
Joined: Fri Oct 11, 2013 12:28 pm

### Re: MCP3008 - reading voltage of batteries in series

eric512 wrote:
Mon Dec 04, 2017 6:55 am
#4 Would like to go with this one, the Maxim 14920 chip looks ideal, but hard to tinker with on a breadboard. I've queried for an eval kit. Don't know if they are avail still.
According to the data sheet, the MAX14920 has a maximum cell voltage of 4.5V; fine if you're going to monitor the individual cells, but not fine if you want to measure a whole battery. (There may be ways round this, though). At least the package is relatively civilised for hand soldering; if you can't get an evaluation board, you might be able to get a general purpose breakout board which simplifies things.

eric512
Posts: 3
Joined: Sun Dec 03, 2017 8:04 am

### Re: MCP3008 - reading voltage of batteries in series

stevend wrote:
Mon Dec 04, 2017 1:25 pm
eric512 wrote:
Mon Dec 04, 2017 6:55 am
#4 Would like to go with this one, the Maxim 14920 chip looks ideal, but hard to tinker with on a breadboard. I've queried for an eval kit. Don't know if they are avail still.
According to the data sheet, the MAX14920 has a maximum cell voltage of 4.5V; fine if you're going to monitor the individual cells, but not fine if you want to measure a whole battery. (There may be ways round this, though). At least the package is relatively civilised for hand soldering; if you can't get an evaluation board, you might be able to get a general purpose breakout board which simplifies things.
Yeah - would need to put a voltage divider between it and each 12v battery.