6

On the Arduino website it states that the analog pins read voltages from 0 to 5 volts (default) and return a value from 0 to 1023. One can also set the range with analogReference(). However, this is probably assuming the Arduino is running at 5 volts. If one powers the board with, say 4 volts, will the analog reference still be 5 volts default, or changed to the input voltage of 4 volts?

  • A reading of 1023 will mean 4V if the board is powered using 4V. 1023 means supply voltage, which is not necessarily 5V. – Gerben Sep 11 '14 at 18:19
3

Your suspicions are correct. Calling analogReference() with a value of DEFAULT sets the ADC reference to the voltage at AVCC which at least on the Uno R3 is tied directly to VCC and hence has the same voltage as whatever you're supplying there.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy