Skip to main content
1 of 4
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81

On the ATmega328P (the microcontroller of the Arduino Uno), the AREF pin is initially floating. If you try to read its voltage, you can get basically anything.

As soon as you select an analog reference other than EXTERNAL, the AREF pin gets internally connected to either the AVCC pin (if you select DEFAULT) or the internal 1.1V reference (if you select INTERNAL). This typically happens when you call analogRead() or, in your example code, when you set the REFS0 bit of ADMUX.

Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81