5V AREF on a 3.3V arduino ok?

I've got a 3.3V 8Mhz arduino on the way. In my project, it would be a bonus if I can use it to measure the voltage of a battery whose voltage ranges from 3 to 4.2 V. In this project I also have a regulated source of 5V power. Can I use that 5V for the AREF pin of my arduino (which will be powered with less voltage)? This would allow me to use an analog input pin to measure the battery voltage.


Gotta keep the voltages on all pins between Vcc and Gnd. See absolute maximum ratings table in datasheet.

Aref can't be higher than VCC.

Always better to measure a battery with the internal 1.1volt Aref.

Drop battery voltage with a voltage divider to ~1volt.
e.g. 10k from analogue pin to ground and 33k from analogue pin to battery.

Call the internal 1.1volt Aref in void setup().

Use 1.1 (not 5) in the maths line that converts analogvalue to voltage.
Post your code if you want help with that.

If battery life is important, then use resistor values 10x or even 100x larger.
e.g. 1Megohm to ground and 3.3Megohm to battery.
If you do so, you must also add a 100n capacitor from analogue pin to ground.

Use a [u]voltage divider[/u] between the battery and the analog input. (You’ll probably want fairly-high values in your voltage driver so you don’t add to the battery drain, and with higher-value resistors you may need a capacitor across the “bottom” resistor to filter noise.)

If the Arduino is battery-powered use the optional 1.1V reference which will remain constant as the battery drains. (Since you’ll be using a voltage divider anyway there’s no reason not to use the 1.1V reference.)

Cool, voltage divider it is...