Hello evryone! I am making a battery monitor circuit. When I monitor 1 battery its ok, but if I want to make the PCB for 2 batteries, i meet a problem. I have 2 batteries in series (12V per battery). I monitor each battery separately with this circuit bellow. If I put 2 separate PCBs for each battery and the bottom copper layer of each PCB is filled so it can act as groun, everything is ok. But If I put the 2 (exactly the same circuits) on 1 PCB, they will have a common ground. What bothers me is this: if there is a connection between the upper battery's "-" and ground ,and the lower battery's "-" wont that cause a problem? Wont the voltage for the upper battery rise to 24V, or this to short circuit the 2 battries in series.
Hi,
Yes, the problem is that the lower battery gets shorted out.
The simplest way to handle this is to measure the bottom battery in the usual way, then to treat the top battery terminal (not the battery itself) as another battery. With two 12v batteries this means you would see two batteries, one 12v and the other 24v. However, this is enough information to get the voltage of each individual battery.
The formula is simple:
vB1=vB1
vB2=vTop-vB1
so you simply subtract the lower battery voltage from the top terminal voltage and that gives you the second battery voltage, and that will be the true voltage as if measured with a volt meter.
The way to get the voltages is to scale the input to the ADC so that the two channels have either the same scale or different scales.
For example, for a 5v ADC to read 12v you can scale to say 15v, which means for example a 10k resistor in series with a 5k resistor so when the voltage is 15v the ADC sees only 5v.
Same for the top, but now you need to scale to 30v, so 25k in series with 5k and now when the top is 30v the ADC sees 5v only.
Then just subtract readings as above to get vB2.
There is some loss of accuracy due to the scaling, but that's the way it goes unless you want to go to a much more complex system. The loss of accuracy is not usually too much anyway. If you start with a 12 bit ADC a ratio of 2 to 1 brings it down to an equivalent 11 bits, and a scale of 4 to 1 brings it down to 10 bits, which is good enough for almost everything. Since you will have one channel at 5 to 1, it will be a little less than 10 bits but better than 9 bits. So that's still pretty good. If you can use oversampling of course you get better than that too.
Note that you way want to scale to 20v and 40v instead of 15v and 30v so you have a little head room.
This is the simplest possible method which still provides decent accuracy.