Go Down

Topic: adc / accuracy? (Read 1 time) previous topic - next topic


Oct 05, 2009, 12:53 am Last Edit: Oct 05, 2009, 01:18 am by RIDDICK Reason: 1

today i connected a LM35 to an arduino analog input pin and the result was 20mV too low... i didnt like the LM75, because it seemed to be less accurate... *giggle*

both (LM35 and arduino) were powered by the USB cable...
the reference voltage was INTERNAL...
the cable between LM35 and arduino was 10m long...
and there was a MUX (4067) (with a 470nF cap at the output) inbetween, 2... :-)

a multimeter at the Vout pin of the LM35 and a thermometer near the LM35 suggested a 2°C (=20mV) higher value, than measured by arduinos ADC...

according to the atmega168 datasheet i can expect an accuracy of -3LSB to +2.5LSB (+/-2LSB and up to .5LSB non-linearity and up to -1LSB quantization error).
but 20mV corresponds to about -18.6LSB... right?

does somebody know this problem already?
what else could i try?




You say reference voltage is "INTERNAL" which is the 1.1V reference. Is this actually what you use - or is it DEFAULT which is the internal Vcc (USB voltage in your case)?

When using a 5V reference, the ADC resolution is 5V/1024 which is 4.88mV per step. Using the AtMega168 ADC with 2bit LSB absolute accuracy - this is the equivalent of +/- 19.5mV. Altogether not far from what you observe.

To improve on this you may consider the following:

- Eliminate fixed offset errors (use a digital multimeter)

Take a measurement of the AREF voltage (at the AREF pin). Take a measurement of voltage at the ADC input pin and compare to your measurement at the sensor output pin. Use the last two measurements to calculate the voltage drop in your 10m cable and use this along with the measured AREF voltage in your calculations.

- Eliminate/Reduce variations (noise)

To further improve on precision/accuracy, you can download the following application note from Atmel, read it, try to learn from it and apply the gained wisdom in your sketch  ;)



i used an
call and the result of analogRead() was about 148...

i tried different tricks (average, average of those samples that dont deviate too much from the average, median value), but they all gave me 148...

now i stuck a LM35 into analog pins 0..2 and gave it some power...
the result was closer to the value read by my multimeter:
multimeter: ~268mV; arduino: 251*1.1V/1024=269.63mV

i measured an input of the MUX,
1. when it was connected to the output of the MUX: 180mV
2. when it was connected to the output of the MUX: 159mV

is it the capacitor or the MUX, that introduces that quite big voltage drop?
maybe i soldered it too hot?

the capacitor is a "little, blue, quite rectangular, short legs, ceramic, 470nF, 50V, RM5, blocking capacitor, h=5mm, MURATA"...
does it have big leakage current or other weird properties?


Oct 05, 2009, 01:08 pm Last Edit: Oct 05, 2009, 01:53 pm by RIDDICK Reason: 1
can it be that i have to connect all input legs of the MUX?
i read something about "crosstalk" in the datasheet...

i just tried it:
and the answer is: no, that doesnt change the result... the voltage still drops by 20mV at _both_ ends of the MUX... *sob*  ;)


ohoh  :-?

when i use a shorter cable (20cm or so), the voltage doesn't drop...

but why does my voltmeter react nicely even at the long (1000cm or so) line?
the only difference i can c is, that my voltmeter has a pull-down resistor of about 1MOhm...

Go Up