Go Down

Topic: ADC interference when switching between ports? (Read 2 times) previous topic - next topic


I'm playing around with the ADC on an Uno board.  I use a 555 IC with 50% square wave configuration as test signal.  When logging two channels at a time (555 output and capacitor voltage), I get a nice plot, see double signal figure.  The square wave (green trace) has nice flat tops.  If however I only log the 555 output, the tops of the square wave trace looks as if it slants a bit.  It therefore seems as if the shape of one measured signal depends to some extend on signals on other analog ports being measured.  If more than one analog port is selected for logging I alternate the ADC between the ports, i.o.w. the ADC is cycled through the selected ports.  I have varied the ADC clock prescaler but see the same effect at different prescaler values.

Any explanation for this?  Which signal shape is the more accurate one?  Unfortunately I don't have a real oscilloscope to use as reference...


It therefore seems as if the shape of one measured signal depends to some extend on signals on other analog ports being measured.

It does (in some circumstances). There is only one ADC, shared between the analog pins. The result is that one reading can be impacted by the last. A common workaround is to read twice, ignoring the first reading. When I posted something like this recently, Grumpy Mike added this:

That is only true if the input impedance to the ADC is significantly higher than 10K.
Keep it at 10K and you can sample at the maximum rate.


@wildbill: I am playing around with (yet another) oscilloscope application, so I'm not too keen on dropping 1/2 of the measurements.

It seems as if the impact of measuring other signals on different channels disappear if I add a  resistor (1 MOhm) between the output pin of the 555 timer and ground.  I can then take successive readings of the 555 output and either 5V or ground on another channel without seeing any drift or funny shapes of the 555 output.

I guess the next step is to use a voltage follower to buffer the signal to the analog pin since this sounds like a high output impedance problem of the 555 output pin?  Perhaps a better test signal would be to use a digital output pin of the Arduino itself...


Now you're turning to the dark side. You need the hardware folks to help you - I'm going to have to punch out - good luck.


For results of an investigation on the accuracy of an ATmega328 ADC, have a look at the ATmega328Accuracy project, located with LXARDOSCOPE at Sourceforge. Some of the results shown are for two channels sampling close to 3kHz. Maybe you can use the preamplifier shown in the report ATmega328Accuracy.pdf for achieving an oscilloscope style input impedance of 1MegOhm as a buffer between the ATmega328 and the circuit you want to measure.

Go Up