analogReference(INTERNAL2V56) and sensor at 4.5V

Yes, totally safe. The analog input still accepts 0...5V, and the ADC does not care.

However, you should not throw the ratiometric principle overboard.
The ATmega2560 runs at 5V, that is the same 5V as the 5V pin. The sensors should be powered with that 5V.
The sensor outputs a voltage relative to the 5V and the Arduino reads a voltage relative to the 5V.

If the internal voltage is used, then the Arduino measures a absolute voltage (because of the absolute voltage reference), but it needs to measure the relative voltage (relative to 5V).

You can get better results by taking many samples (5...100) and calculating the average.

1 Like