# Monitoring 2 Separate Batteries

OK, I think I’ve made one of those silly little errors that you make form time to time and then have a ‘DOH’ moment.

In the attached image you can see the PSU part of one of my projects. The idea is that there are 3 monitoring points that go to the three analog pins. The basis is that you can then run on two sets for double time, and/or swap out a low set without interrupting power to the running device. The monitoring was intended to isolate each battery set so that discrete voltage levels of Batt1, Batt2 and Vin (Vin taken as being into the regulator, after the diodes) could be taken and flag a rough discharge profile for specific battery chemistry and terminal voltage. Flagging of battery state would be via wireless back to a web based application.

I know that the resistor divider is high Z for the analog input. I’ve now fixed that in software by extending the time between switching MUX and taking the sample, to allow the Sample & Hold Capacitor time to charge. That part works OK.

The issue is that I didn’t consider that the diodes won’t actually isolate parallelwd battery sets in the manner I originally intended. This was to prevent one good set trying to backfeed and charge a second poor set, plus isolate the voltages for monitoring of each terminal voltage. It was a ‘blonde’ moment as the terminal voltages will obviously be better in parallel due to one set not carrying full load.

If I connect one set and power up then the monitor works fine. If I then add a second set then the terminal voltages start to equalise. If I only have one set then the other monitor shows 0V, as expected.

I’m primarily a power distribution engineer so my electronics is reasonable but not as comprehensive as some of you and sometimes things just need to be worked out to make sense.

Since I effectively have volts applied to the cathode of D1, through a 0.7Vfd of D2, how does this relate to what is happening with those diodes on either side of the PN junction?

When parelleled it’s essentially

``````                     Vin (to 5v VR)
Batt 1             |             Batt2
----||------->|------|------|<-------||----
D1             D2
``````

So what happens to DC voltage either side of those diodes?

Any clever ideas to achieve what I originally had in mind, very simply?

The diodes you have will favour taking current from the battery with more charge and
higher voltage, but you need high-side switching to control more than this.

But with high-side p-channel MOSFET switches you can use a pull-down resistor
on the gates to bias them on by default, and have the Arduino over ride this to switch
off a particular MOSFET. I would keep the diodes, make sure they are schottky to
reduce voltage loss.

However you need a way to manually switch off the whole circuit too, I suspect, which gets
more complex with 2 batteries. You could bring more diodes into play and have
a single switch to drive the gates high (you still have to leak a small current through the
pull-downs when switched off though).

One insight is this: If the difference in voltage between fully charged and discharged
battery voltage is one diode drop or less, you can add high-side switches across the
diodes. By shorting out one diode you then isolate the other battery (unless its a diode
drop higher in voltage). That way you can discharge one battery while leaving the
other fully charged. In this circumstances ordinary diodes are better as they have
high voltage drop (but normally you are bypassing them so it doesn't waste power).