Measuring Accuracy of DC Volts

Hi Luis

If you use the inbuilt analog to digital capabilities on a Uno, it's capable of 10-bit accuracy, so 1023 steps between 0V and 5V (say) as the input.

That is done by using the analogRead() function (analogRead() reference). Unfortunately for your needs this is too granular giving 5000mV/1023 = 4.9mV per step by default so it might be able to tell you something was present by returning a 1 or a 0 only. Depending on your requirements that might be sufficient, but there is a way of improving this, by setting analogReference(EXTERNAL) first and connecting a 5mV source to the AREF pin on the Uno, redefining the maximum value to 5mV rather than 5V (analogReference() reference page.

I tried to find a note for the minimum functional voltage that AREF can take, and have not been able to find anything. You'll have to try it to see if that's going to work out. For this you'll also need a smooth 5mV reference voltage to connect to AREF - not sure if you have one of those, but it would be possible to construct with a voltage divider.

Another option (and one to take if you don't have a nice smooth 5mV voltage reference to feed in there) is to set the analogReference to INTERNAL which will use 1.1V as the maximum, giving 1.07mV per step so your readings might come back somewhere between 0 and 5.

If you need greater resolution than this, you could choose an external ADC with a higher resolution or perhaps work with an amplifier to increase the output range to 0-5V (say), read it via the Uno's ADC and scale the result in your code back to 0-5mV.

Just some thoughts to start the conversation anyway :slight_smile:
Geoff