analogReference(INTERNAL2V56) and sensor at 4.5V

Hello there;

Before I start blowing up Arduinos:

I have a ratiometric pressure (10-90%) supplied with the Arduino’s 5V Vdd. At full scale, that thing would generate a 4.5V output.

Now, most of the time, I’ll be operating at 20-25% of Full scale and it would help my accuracy to set the ADC at 2V56 reference.

Except, once a day, when the pump primes, the sensor output will go to 80% of FS (4V) exceeding the 2.56V reference…

Other than returning 1023, will the ADC suffer damages from having an input voltage exceeding analog reference (nut not VDD!).

In one formula analogReference(INTERNAL2V56 < Vin < Vdd = SAFE?


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

Thanks Koepel;

Keeping both ADC and sensor ratiometric off the same Vdd is quite valuable, indeed. I already take 32 samples and average them.

I’ll leave the design as it is. All 4 sensors are stable now and it’s time to move from lab to pump room.


If you want to detect small changes, than you can average them and calculate the result with ‘float’. The noise will help to get more resolution than the 10-bits. The overall accuracy will not increase.

1 Like

I already take 32 samples and average them.

I don’t know what you noise is like but in a situation where there can suddenly be high or low voltage spikes I found deleting the highest and lowest sample then averaging the rest can be quite effective.
When collecting a lot of samples you might delete 2 high and 2 low.

1 Like

Always thoughtful additions JR!

I’ll monitor that once I have the system in the pump room,

Cheers, JR.

Another way to increase sensitivity and to keep some of the ratiometric behaviour is to lower Aref with a voltage divider powered from the 5volt pin.
So voltage divider between 5volt and ground, with the tap to the Aref pin.
And switched to EXTERNAL in setup() (don’t forget that part !).
But maybe the pressure sensor itself is not accurate/stable enough for that.

1 Like


I think it’s time to stop tinkering and put this whole thing to the test… I’ll report back in a few days.

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