Reading battery voltage behind voltage regulator, energy consumption help

MrSherwood:
I have dealt with this problem a few times. The solution depends on how much it matters to save power and how accurate you want the readings to be. First, I will present the quickest and easiest "zero wasted power" approach:

  1. Use your existing voltage divider, but switch it on and off with 1 N-channel MOSFET driving the gate of 1 P-channel MOSFET. The MOSFET's you use should be considered "logic level gate" devices. This just means that you can turn them on and off with relatively small voltages (like what your ATMEGA can output). You will use a regular digital pin on you ATMEGA to turn the gate of the N-MOSFET on/off. Turning the pin ON will drive the gate of the NFET high, making it a closed-switch, which will pull the gate of the PFET low, making IT become a closed-switch as well. You cannot drive the gate of the PFET directly from the ATMEGA because, in order to shut it off completely (make it an open switch), you would need to drive the gate up to whatever the input voltage is, which is beyond the range of your ATMEGA.

Thank you very much!