Close

Measuring battery volts​

A project log for LoRa darkStar

Low Quiescent Current, Solar Powered +30dB LoRa

capt-flatus-oflahertyCapt. Flatus O'Flaherty ☠ 02/06/2023 at 15:450 Comments

Should be easy yeah? Well, turns out it's not that easy to do this in a low quiescent power context. With a basic resistor bridge set up using 2 x 1M Ohm resistors a small amount of current is continually wasted. A rough calculation suggests that this current = 4.1V / 2,000,000 = 2 uA, but in reality current also seems to flow back through the MCU analogue read pin to earth, so the current lost could be more like 4 uA. Does not sound like a lot, but it's continuous, regardless of whether the MCU is powered on or not.

The second problem is that 1M Ohm is simply too high due to resistance on the MCU pin and means that the 3.3V threshold on the pin is exceeded. The obvious solution is to leave the 1M Ohm resistors in place but throw in a couple of diodes in series on the MCU pin thereby reducing the voltage. The technical term for this is 'forward bias voltage drop' which is an inherent characteristic of all diodes and is normally about 0.7V each, depending on the current. For a 1N4148 operating at about 4 uA the forward voltage was measured as 0.3 V, so  this being the case, we'd probably want 2 or 3 of them in series between the battery and the resistor bridge.

But why not go one step further and stick a switching transistor in the mix? The transistor will also have a voltage drop across the collector and emitter, which will help improve the situation. If the transistor has low leakage, it should also be able to get rid of the continuous 4 uA current loss. So that's win, win .... hopefully.

Fortunately, the new PCBs on their way from China can be easily hacked to insert a through hole transistor into the battery measuring circuit. Should also be able to include a diode as well, if necessary. Just luck really!

Discussions