# A device which will detect a difference in voltage

A comparator can compare two voltages and output a signal indicating whether one is greater than the other. However, for balancing a lithium-polymer battery pack, I need to measure the difference between two cells which are not relative to ground.

The simplest solution is to just use voltage dividers to drop the voltage down to about 4.2V to compare against a reference voltage. However that solution would have a poor CMRR for higher voltage battery packs, with 6 to 8 cells. It would also be highly dependent on the divider accuracy, meaning expensive precision resistors.

I'm aware I can use op-amps to produce a difference signal. However, that would then require a further comparator to accomplish what I want. For an 8-cell battery pack, we would be looking at two op-amps and two comparators which is a lot; size and power consumption are important.

Basically I'm looking for a device which does this: if((V1 - V2) >= V3) then output high else output low.

-
How about a battery management IC? It does all of that work for you and are smaller than anything you could do on your own. – Kellenjb Aug 2 '11 at 16:51
What does CMRR mean? – Dean Aug 2 '11 at 17:12
@Dean - Common Mode Rejection Ratio: how a identical voltage applied to both inputs is suppressed. – stevenvh Aug 2 '11 at 17:15
@Kellenjb There are several other reasons for wanting to do this homebrew, including doing per-cell datalogging and adding adjustable discharge current, which a dedicated IC would not be capable of. – Thomas O Aug 2 '11 at 17:41
I tend to think that for something like that, if it has any practical purpose someone would have already made it in an IC form. – Kellenjb Aug 2 '11 at 19:06
In that case there's a simple solution. Connect a 1:1 resistor divider between $V_-$ of the lower cell and $V_+$ of the higher cell. $V_+$ of the lower cell (= $V_-$ of the higher cell) goes to the inverting input of the comparator; the midpoint of the divider goes to the non-inverting input. This forms a Wheatstone bridge with both cells in one branch, and the resistors in the other. If the lower cell's voltage is higher the output of the comparator will be low. Both cells will have voltages close together, so some hysteresis may be needed.