Electronic – arduino – Backup battery tester circuit

arduinomicrocontrollerpower supplytransistors

I am attempting to read the voltage on a backup battery on an Arduino. To that end, I used the circuit Olin Lathrop offered in answer to this question. I am powering the Arduino with 5V, and the battery is 3 AA cells, so 4.6V or less.
Using the battery checker circuit Olin offered, see link above,
I can reliably read the voltage on the main power supply (~5V) but when I connect the battery instead, I am only reading 0.06V when the Q1 is turned on. I believe this is because the base voltage on Q2 is too close to Q2's collector voltage. I only see turning Q2 on as more difficult as the batteries discharge. I think the way to fix this is to modify the Q1 part of the circuit so that the base voltage on Q2 is less when this circuit is "on".
Any input would be appreciated.

Best Answer

This circuit I showed in the other answer was for when the battery voltage was somewhat higher than the processor's voltage. After all, that was your original reason for not just connecting the battery to a processor input pin.

When you know the battery voltage won't exceed the processor voltage you can do something like this:

CTRL is driven by a digital output of the processor. When high, the battery test circuit is off. when low a few 10s of mA drain is put on the battery, and the battery voltage minus the Q1 saturation voltage appears at out. This only needs to be on for a few 10s of µs occasionally, so represents very little average drain on the battery.

If the C-E voltage of Q1 introduces a unacceptable offset on the battery voltage reading, then you can replace Q1 with a P channel FET. You have to make sure to use one that can turn on well enough with just the processor voltage on the gate. Such things are sometimes called logic level FETs.