SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By ShreddinPB
#139520
Hi guys, I am using a LiFiPo4 battery that consists of 16 Headway 30140s cells in series for a 48v battery. I would like to read the individual battery voltages with an arduino. I noticed this and thought it would be perfect for it.

http://www.sparkfun.com/products/9056
BOB-09056

The main question I guess is, should I use something like an optoisolator between the batteries and the multiplexer? LiFePo4 cells dont go above 3.7v I believe, so would one still be necessary? Is there a 16 channel optoisolator or would I have to use 4 4 channel ones?

Id also like to add a current sensor for it.. but that can probably be saved for a different discussion.

Thanks!
By fll-freak
#139521
The problem with this mux is that it is only good for 6V relative to a single common ground. If you took taps at each cell, you would read 2.8, 5.6, 8.4, ..., up to 48v relative to the one ground. If you pass 48 volts to the mux you will fry it. What you would like to do is mux both the side of each cell to measure the voltage of that one cell. Easy to do with voltmeter probes, but not with this mux.

What you might be able to do, is look for a differential amplifier (output is gain*(input1-input2)) that can operate from 0 to 48V. Not sure if such a beast exists.
By MichaelN
#139540
fll-freak wrote:What you might be able to do, is look for a differential amplifier (output is gain*(input1-input2)) that can operate from 0 to 48V. Not sure if such a beast exists.
Yes, there are plenty of op-amps that have high-voltage power supplies, but they are pricey. With a suitable arrangement with resistors, a normal (cheap) op-amp can measure high voltages but still be powered from a low voltage. Probably the easiest is one amplifier per cell, with the outputs fed into a multiplexer that goes to the ADC input.

Instead of one amplifier per cell, you could use a high-voltage multiplexer (such as MAX378) to reduce the number of amplifiers, but they are pricey
User avatar
By languer
#139664
I'm not a battery buff, but if you're not after great resolution you can drop each successive stage with a voltage divider (that's a lot of voltage dividers, but it could be done). Something like: V1 = Vcell1, V2 = 0.5 (Vcell1+Vcell2), V3 = 0.33 (Vcell1+Vcell2+Vcell3)...
By skimask
#139669
languer wrote:I'm not a battery buff, but if you're not after great resolution you can drop each successive stage with a voltage divider (that's a lot of voltage dividers, but it could be done). Something like: V1 = Vcell1, V2 = 0.5 (Vcell1+Vcell2), V3 = 0.33 (Vcell1+Vcell2+Vcell3)...
That's one of the main issues when using any LiPo technology. You have to have decent resolution when charging/discharging the individual cells.
For instance, if the particular LiPo cell you're charging requires a charge cutoff voltage of 4.23 volts, then it's quite possible (unlikely, but possible in an older cell) that 4.24 volts might kill the cell right there and then. That's less than .3% of a difference. Take a string of .1% resistors, and after a few of them, you've already exceeded that tolerance.
By using "stages" of voltage dividers, in effect, the tolerance/sloppiness of each stage gets multiplied, and after a few stages, you're out in the weeds.

IF it was me (and it's not!), I might take a handful of the newer PIC12's with a built-in voltage reference, use the internal A/D converter, build a small circuit that attached to each individual cell and measure the voltage on that cell only (and be powered by that cell itself), and send the voltage of the cell out via a serial output from that PIC (once per second or whatever) isolated by an opto-isolator to a digital mux, controlled by a master PIC, which would then in turn, read (and remember) the voltage off each individual cell.
By lyndon
#139687
I worked on very similar projects in the 1996-1997 timeframe. I did look through the few project documents remaining, but couldn't find the multiplexer and opamps we used. However, I can offer a very simple idea that will work: use 16 double pole reed relays and float the battery ground. That way your ADC input will never have more than a single cell voltage across it and the rest becomes trivial. In the project I mentioned, we did this for a prototype, but the final product had to be much smaller, so we used multiplexers that could handle the voltage. I just don't remember which one.
By skimask
#139690
I thought about the relay thing too...but, adding that many "mechanical" bits/pieces to something like this, well, I would think that would exponentially increase the odds of mechanical failure.
I agree, simple, but, when one of those relays sticks...ouch!
By lyndon
#139692
True that relays have higher failure rate than semiconductors, but nothing about this application tells me we should be worried about that. The original project I referred to was using hp data acquisition units and reed relay multiplexers before I got involved. That's how things were done for years.

I should add that in all my years of using relays ,the only time I've had one stick is when it was carrying more current than it was rated for.
By skimask
#139702
Again, I agree...simplicity works, and it worked well "back in the day", and still does today (I worked B-52's, C-135's, and C-130's up until about a year ago...all relays, no solid-state switches to be found!)
But, with LiPo's, gotta worry about that whole thermal runaway thing, not to mention dumping a LiPo below or raising a LiPo above it's cutoff voltage for too long.
By ShreddinPB
#139742
MichaelN wrote:
fll-freak wrote:What you might be able to do, is look for a differential amplifier (output is gain*(input1-input2)) that can operate from 0 to 48V. Not sure if such a beast exists.
Yes, there are plenty of op-amps that have high-voltage power supplies, but they are pricey. With a suitable arrangement with resistors, a normal (cheap) op-amp can measure high voltages but still be powered from a low voltage. Probably the easiest is one amplifier per cell, with the outputs fed into a multiplexer that goes to the ADC input.

Instead of one amplifier per cell, you could use a high-voltage multiplexer (such as MAX378) to reduce the number of amplifiers, but they are pricey
Im not against creating a resistor based differential amplifier for each battery. How do I go about calculating the resistor values for each one?
By rrpilot
#139746
You could try something like this (forgive my hand-scratch):
circuitidea.PNG
This allows you to shift the voltages down to your digital ADC input range and allows you to use a standard analog MUX.

Lets say your ADC reference voltage is 5V, If you choose Ra to be 2.2k and Rb to be 3.3k then you get a max output voltage of 4.574V (for cell voltage of 3.7V) at the MUX input. Of course you can size the resistors differently for a lower reference voltage. This circuit does have some limitations, notably it can't measure below about 0.65V cell voltage but I don't think that's an issue for this application.

Once you obtain a ADC reading you can calculate the battery voltage using the following equation:

Vbattery = V1 * Ra/Rb + 0.65V

Note: the transistors collector-emitter voltage must be rated for the full 48V and for increased accuracy you could obtain a better approximation to the base-emitter voltage using the transistor datasheet.

Anyways, this is just an idea, there are obvious improvements you could do using op-amps if you're willing to spend the money.
You do not have the required permissions to view the files attached to this post.
By lyndon
#139752
It occurs to me that there is an option available in 2012 that we didn't have in 1996: inexpensive high resolution A/D converters. By using even a 16-bit ADC instead of the 10 bit one built into an arduino, you can divide the voltage down to 0-5V and still have enough resolution. However, the proper layout of a high resolution ADC PC board and peripheral bits: multiplexers, precision references, etc. make it non-trivial.
By ShreddinPB
#139808
skimask wrote:
languer wrote:I'm not a battery buff, but if you're not after great resolution you can drop each successive stage with a voltage divider (that's a lot of voltage dividers, but it could be done). Something like: V1 = Vcell1, V2 = 0.5 (Vcell1+Vcell2), V3 = 0.33 (Vcell1+Vcell2+Vcell3)...

IF it was me (and it's not!), I might take a handful of the newer PIC12's with a built-in voltage reference, use the internal A/D converter, build a small circuit that attached to each individual cell and measure the voltage on that cell only (and be powered by that cell itself), and send the voltage of the cell out via a serial output from that PIC (once per second or whatever) isolated by an opto-isolator to a digital mux, controlled by a master PIC, which would then in turn, read (and remember) the voltage off each individual cell.
I like this idea a lot.. having an individual pic monitoring each battery seems like a good idea to me.

So far I have only worked with arduinos and stamps.. those sort of mcu's

edit: so did some reading around.. do I literally just input the voltage to each pic? No resistors or anything needed since it will be <5v? Then that can be read and transmitted?
Possibly could then go thru a multiplexer to be able to read every one?

awesome diagram to follow lol
Image