# Arduino Forum

## Topics => Science and Measurement => Topic started by: LuisArduino on Nov 15, 2012, 10:47 am

Title: Measuring Accuracy of DC Volts
Post by: LuisArduino on Nov 15, 2012, 10:47 am
Dear community,

I am looking for the measuring accuracy for Arduino Uno for the voltage inputs.

I know It can measure up to 5V, but I will be measuring from 0 to 5 mV from a sensor, What would be the accuracy with Arduino?

I am new to Arduino so any information you can provide me will be appreciated.

Thanks,

Luis

Title: Re: Measuring Accuracy of DC Volts
Post by: strykeroz on Nov 15, 2012, 12:43 pm
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 (http://arduino.cc/en/Reference/AnalogRead)).  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 (http://arduino.cc/en/Reference/AnalogReference).

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  :)
Geoff
Title: Re: Measuring Accuracy of DC Volts
Post by: MarkT on Nov 15, 2012, 01:15 pm
For measuring in a range of 0mV to 5mV you will need a rail-to-rail instrumentation opamp such as the INA326 (although that only has a max gain of 100)
Title: Re: Measuring Accuracy of DC Volts
Post by: LuisArduino on Nov 16, 2012, 10:36 am
Dear all,

Thank you very much for the information and the explanation. They are very much appreciated it.

I found that the Arduino Due has 12 bits for the input (4096).

However what I haven't been able to figure out if with the Arduino Due can I change the reference voltage to lets say 1 V?

Thank you very much,

Luis
Title: Re: Measuring Accuracy of DC Volts
Post by: MarkT on Nov 17, 2012, 12:53 am

Dear all,

Thank you very much for the information and the explanation. They are very much appreciated it.

I found that the Arduino Due has 12 bits for the input (4096).

However what I haven't been able to figure out if with the Arduino Due can I change the reference voltage to lets say 1 V?

Thank you very much,

Luis

No, that's not possible.

From the datasheet the ADVREF can be 2.4V upto the max analog supply (3.6V) - for 12-bit accuracy, as low as 2.0V for 10-bit accuracy.  If you want to use the AREF pin on the Due you have to desolder a resistor-bridge from the board BTW as otherwise its hardwired to the 3.3V supply via a noise-filter circuit.
Title: Re: Measuring Accuracy of DC Volts
Post by: dc42 on Dec 02, 2012, 10:30 pm
For measuring 0 to 5mV, amplifying the signal using an op amp or an instrumentation amplifier (depending on your exact requirement) is your best bet.
Title: Re: Measuring Accuracy of DC Volts
Post by: Constantin on Dec 10, 2012, 12:22 am
I agree that a op amp is your best bet. Analog Devices have some very useful resources online as well as programs that allow you to model ahead of time how well an op amp will perform - ie expected noise, ENOB that can be expected, etc. very very cool

As far as the arduino is concerned, the minimum voltages for the AREF are around 1v, depending on the model. But there is no reason to restrict the voltage range, just use a well-matched op amp and be done with it.

That said, if high speed is not needed, a external ADC with a built in PGA like the MCP 3421 can be pretty compelling.
Title: Re: Measuring Accuracy of DC Volts
Post by: retrolefty on Dec 10, 2012, 12:33 am
Quote
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.

No, not possible to wire a 5mv voltage to the AREF pin, minimum amount is 1.0vdc per datasheet.

Lefty