Reading battery voltage behind voltage regulator, energy consumption help

I'm planning on putting my Arduino behind a voltage regulator - a 3.3V MCP1702-33. So I can't use the bandgap method to read the battery voltage. I can use a voltage divider from the battery to ground - but that means constant battery consumption just for reading the battery voltage, so that's not ideal. If battery voltage is around 5V, using 10kOhm and 1kOhm resistors, I get 0.45mA. On a 2000mAh battery, that's 185 days battery life just for the voltage divider...that's not very good, plus 0.45mA @ 100% duty is more consumption than what I calculated for the Arduino plus wireless transmitter.

Is there another way to read the battery voltage - one that is more intermittent? Like maybe I use the ATMEGA to turn on a transistor that's installed before the voltage divider? My knowledge here gets fuzzy - transistors represent a voltage drop by itself, and I need guidance on what type of transistor to use, how it effects my readings, what other gotchas are there?

The reason the ATMEGA328 is behind the voltage regulator and not directly run from battery is because the wireless transmitter is not 5V tolerant, has to be around 3.3V - it would require some voltage dividers for MOSI, MOSI, CLK, SS. Also 3xAA ranges from 3V to 4.5V, so 3xAA's low end is too low for the MCP1702 to maintain 3.3V. While 4xAA ranges from 4V to 6V, where the high end is too high a voltage for the ATMEGA328 (5.5V max). So the best solution I came up with is to put everything behind the voltage regulator.

10K and 1K resistors gives you (5 * 1 / (10 + 1)) = .45V. That's kinda an odd combination; you'd want something closer to 3.3V so you have more precision over the full range. 10K and 10K would give you 2.5V which leaves good headroom for slightly greater than 5V batteries. And that takes you down to .25ma for the divider.

But when you have a slowly-changing voltage you're trying to read it's OK to use larger resistances. Use two 47K resistors and take the current down to .05ma. Then you're at 4.5 years.

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".

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!

Which arduino board?

The simplest solution is to use a dc dc step up regulator, maintain a 5v constant, then feed the sensors off the onboard regulator..

They're cheap on ebay.