Reading battery voltage behind voltage regulator, energy consumption help

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.

  2. To get real accuracy, you'll want to place an Op Amp Buffer between the voltage divider and the ADC input on the ATMEGA. You can run the Op Amp from the same P-channel MOSFET that turns your voltage divider on and off. This will mean that zero power will be wasted by either the divider or the Op Amp.
    Using voltage dividers alone will introduce errors, as the ADC on the ATMEGA328 will "load" the signal down slightly. If that is a concern, you will want to buffer the divided signal before passing it to the ATMEGA (carefully selecting your Op Amp for low Input Offset Voltage specification). With the addition of the buffer, you could get away with significantly larger resistors in your divider and save more power.
    NOTE: This is not a solution for all applications. If there is a higher input voltage (say greater than 10V), you will need to employ a zener diode to make sure that the gate voltage on the PFET doesn't get too large and damage the device.

The two MOSFETs together essentially make a "high-side switch".