In my project I have an arduino uno and a pressure sensor with a from 4 - 20 mah , I read the voltage drop throught a 200 ohm resistor (high pressicion). I wont the accuracy to be max 2-3%+- off.
What accuracy can i expect from arduino' when running with 9v power source and defult analogreferens()?
sebb898:
The sensor range is from 4-20 mA (thanks for noticing :)) throught a 200 Ohm resistor.
What I'm wondering is how accurate the values that I am reading from 'analogRerefence()' actually are if i have a power supply that is 9 Volts
Thanks. Rock ´n roll
Your 9 volt has no bearing on the matter of accuracy. It supplies power to the on-board +5vdc voltage regulator that powers the 328p chip and is also the voltage reference used by the ADC. Accuracy will be that stated in the AVR ATMEGA328P datasheet which most likely will meet your requirement of <2-3%..
Just be sure you wire a common ground wire between a arduino ground pin and the negative side of the loop power supply.
accuracy will be good.
the 9 volt battery is controlled to 5 volt.
so the reference will be fine.
resolution is in theory 0.64 of 1023 so simple 600 points.
this is better as 0.2 % resolution
now you can calibrate your sensor, note the 2 values and make a graph or use map to get corrected values.
as the pressure sensor has an accuracy of about 2% the arduino is better and will only add another 0.5% to it. thus result is 2.5% which is for not commercial use fine.
So the default reference voltage is good enought for an accuracy of -+ 2%?
I have read that the reference voltage (vcc) is unstable and needs some tuning to get it right. For example using a lm4040 (reference voltage diode) or using the 1.1 voltage reference to messure the vcc to get the analogread value right ( 0-5 Volt ).
Is this only the case when using unstable power supply such as usb port??
I connected a 9v battery to the power jack in the arduino and the analog readings is not accurate to the voltage.
If i have a 20 mA signal thats messeure 5 volts over the resistor 250ohm i dont get maximum value that is 1023 from the Arduino.
When i messure between the gnd and 5v pin on the arduino i have 5.17 volt.
I connected a 9v battery to the power jack in the arduino and the analog readings is not accurate to the voltage.
If i have a 20 mA signal thats messeure 5 volts over the resistor 250ohm i dont get maximum value that is 1023 from the Arduino.
When i messure between the gnd and 5v pin on the arduino i have 5.17 volt.
What can i do to make the reading more accurate
If you know that the on-board +5 vdc voltage regulator has an output voltage of 5.17, then use that value with the mapping function to get a correct analog voltage scaling. Best to use millivolt scaling to get better resolution.
int value = map(analogRead(A0), 0, 1023, 0, 5170); //results in millivolts
Example:
I use my lm4040 shunt diode on pin 1 and always have 4.1 volt there.
If i know the voltage on that pin i can calculate the k value of Y=kx+m (m=0) since the the 0-1023 value is linear and correct the value on the reading pin.
I just assumed that i did not have any current throught the analog pin (iL) and then calculated the resistor to 26-500ohm. I messured the current trought the lm4040 and it was around 2 mA. The lm 4040 accept current between 60 um and 15 mA so its al good.
If you are going to discuss accuracy, it is not sufficient to simply state you setup is inaccurate. You need to present your data.
If you want to discuss your accuracy , post a list that shows voltages measured and readings acquired for at least 10 readings and post the voltage measure at 20mA. That means you need to post the exact resistance of the resistor as you measured it The voltage readings across the resistor are not accurate to calculate the current without an acurate measurement of the resistor.
If Vcc = 5V then 1 count = 5/1023= 4.8875mA. If however Vcc = 5.17V then 1 count = 5.17/1023=5.05375mA.
5/5.17=0.96711798839458413926499032882012
5V measured on a system running with a Vcc of 5.17V = 989 counts , NOT 1023.
The voltage per count is a function of Vcc. If Vcc = 4.5V , then each count = 4.39882mA.
Do the math.
If you already know your Vcc is NOT 5.00 V , why do think your measurement would be 1023 for 5V ? (which it couldn't be BTW).
There is no problem with running a system with a Vcc of 5.17 V. The problem comes when you expect it to behave the same as a system running a Vcc of 5.00 V. Your code for converting the analog counts to voltage has to be calibrated to the Vcc you are using. You need to change your code to use 5.05375 mV per count when running with a Vcc of 5.17. Then 5.00 V will read 989 counts , which is correct, not wrong. You can only read 1023 counts if you are measuring 5.17V if you are running with a Vcc of 5.17V.
What i mean is that i dont know for sure that the vcc always is 5,17V so i need a reference that i can rely on.
I need to know how many counts 5 volt is because of my 1-5V signal without having to know the vcc.
now i have a analog pin on the arduino thats always 4,1 volt with 1% accuracy from that pin i can calculate the k value of a straight line so i know how many count 5 volt is.
I have a precision resistor that i have done several test with a lab bench and a good multimeter.
24.1 Features
• 10-bit Resolution
• 0.5 LSB Integral Non-linearity
• ± 2 LSB Absolute Accuracy
• 13 - 260?s Conversion Time
• Up to 76.9kSPS (Up to 15kSPS at Maximum Resolution)...
That's just the for ADC, it doesn't include any inaccuracy in the reference.
I have a precision resistor that i have done several test with a lab bench and a good multimeter.
Good! Any good instrument needs to be calibrated against a known-good reference. Typically, you calibrate the slope (AKA gain) and the offset (usually at zero).
With an ADC or DAC the "end points" (i.e. zero and 5V) can be "difficult" and often there is more error than intermediate measurements.
Where I work, we have some 0-10V DACs that are calibrated/corrected at 100 points (every 0.1V) in software.
In addition to constant gain & offset errors which can be calibrated-out, there is usually non-linearlty which can be corrected for to some extent as we are doing with our 100-point calibration, and short-term noise and long-term drift which cannot be calibrated-out.