analog measuring with low voltage arduino supply

Hello,

I need to measure voltage between 0-5V
the problem is sometimes, 5v supply can go down to 4V, the arduino works, but measurment is wrong because voltage reference is not 5V anymore
Can I supply 5V on Aref, have 4V on "5V power input" pin, and measure correctly 4.5V on a analog pin?

thank you

altzu:
Can I supply 5V on Aref, have 4V on "5V power input" pin, and measure correctly 4.5V on a analog pin?

No.

The answer is to lower the input voltage with a voltage divider to <= 1volt.
Then switch the A/D reference internally (with code) to 1.1voltAref in setup().
That makes things also independent of supply voltage variations.
Leo..

OK, thank you,

with this solution, what happens if analog input voltage is 2v?

pedemuriff:
OK, thank you,

with this solution, what happens if analog input voltage is 2v?

Input voltages between ~1.1volt and 5volt VCC will return the max A/D value of 1023.
Nothing bad will happen.
Leo..

If the vRef is set to 1.1V then to get a full range of measure from 0 to 5 V a resistor divider could be used.

voltage divider calculator

Just entering 5V for a source volt, 10K for R1 and 1.1V for the output V's will give a starting point.

Another benefit of the internal reference is the input is still protected to Vcc (5v), despite having a full scale voltage of ~1.1volts .

So if you arrange the input to your resistor divider to give you 1v with a 5v volt input , that would mean you could put 25v on the divider and not damage the Arduino ( as that would still only give 5v on the analog input)

Note that different devices have a large variation of the 1.1V reference, so you have to calibrate your
Arduino specifically, as the nominal 1.1V can be anything from 1.0V to 1.2V according to the datasheet.

[ This would be a big issue for mass-production ]

You might also want to consider external voltage references which are commonly available in 4.096V, 2.56V,
or simply using the 3.3V pin as a 3.3V reference?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.