The ADC default reference voltage on arduino uno is 5 volt.
If I power my board directly on the 5volt pin with fresh battery the voltage on the pin will sligthly change with battery aging. Then mV value calculated on analogue pin will change because of the equation use to convert bytes to mV :
mV = Analogread * 5 volts / 1023.
In this equation and my condition, 5 volts is not exactly 5 volts. Thus calculated sensor mV change even if the mV on the pin remain constant.
If I wire my 5 volts pin on an analog pin and run analogread on it, I could then use the following equation and have mV output corrected for input voltage variation right?
mV = analogread (sensor pin) * analogread (5v pin) / 1023.
OR… there is a built-in function that do just that?