Arduino ADC & Decoupling capacitors.


I have a sample Analogue to Digital Converter from Microchip.  (MCP3901).

Now I want to use this ADC together with an Arduino (Uno) on a breadboard  in order to connect it to my laptop. 
This works all very smoothly and all by all I am fairly happy with the result up till now.

But, there is a small problem.  There is a small oscillation in the data when measuring over something with a large resistance (first 3 graphs).  The oscillation is absent (or greatly diminished) over things with small resistance. (last 2 graphs).
I have only a basic knowledge about electronics and cannot get rid of (or even diminish) the oscillation.

My guess is that I don't get the decoupling capacitors right.

These are the symptoms:

Voltage measured across the solar panel of a calculator during ~2s  (while lifting my hand). Look at the oscillation in the data . (the oscillation is about 50Hz )

voltage across solar cell

And zoomed in:

Detail ofvoltage across solar cell

Secondly, in the case of a 100 kOhm potentiometer in series with a 2.2 MOhm          (There is no Omega in the special characters list?)
I can see that the oscillation is scaled with the measured voltage.
This means that the oscillation is probably internal.  (My guess is that the source is from the power lines which are probably not decoupled very good. And the oscillation manifests itself in the internal reference voltage)

So, this goes from 0 to ≃0.2 V  (because it is a 100kOhm in series with 2.2 MOhm between 5V and ground.) increased in small steps (small turns on the potentiometer)
Green = without decoupling Caps. Red = with decoupling caps (0.1µC ceramic in series with 47µf electrolytic, but it's pretty much the same with all caps.)

Detail ofvoltage across solar cell

(the oscillations here are more sinusoidal than the ones with the solar cell)

And finally, there is no problem when measuring over something with a low internal resistance.
Look at this graph of a (bad) potentiometer or about 100 Ohm.  And look at the near absence of noise and oscillations in the data. I can't immediately see why the ADC gives such clear data in this case. But this is definitely what I want.

Detail ofvoltage across solar cell

And a detail;
Detail ofvoltage across solar cell

Has anyone some Ideas on how to kill that oscillation? (I don't mean with fourier transforms and such)  If the decoupling capacitors are the problem, I have a limited choice in themc can you please say which ones I should search for?

Thank you very much.  

sort by: active | newest | oldest
Yes, you shouldn't measure things with very high output impedances ! What's happening is an interaction with the ADC input stage and your device under test. The input resistance of this ADC is only 350K. The best thing is probably to put a unity-gain buffer amp in front of the device.
Sparticles (author)  steveastrouk3 years ago
Thanks, yes, the unity gain buffer does indeed help. (it's just one with a 1M impedance, but the improvement is very significant)

However, I don't think that is the source of the oscillation.
Since the input impedance is just a resistor in parallel with the thing you want to measure.

But yes, with a unity-gain buffer it has improved a lot.
Thank you very much!

It IS the source of the oscillation. You have too naive a view of what the EFFECT of input and load impedance really is.

That said, its only from viewing your detailed graphs and data that I can come up with my diagnosis....

The input impedance of the ADC is likely to vary dynamically as the device makes a measurement. I bet you will find that your input noise is a harmonic of the device clock. Using a unity-gain buffer is preventing the noise current creating a noise voltage.

Likewise, you have missed the effect of feedback on the input resistance of a unity gain buffer - its now a LOT more than 1Meg......can you tell me why ?
Sparticles (author)  steveastrouk3 years ago
Forgive me my ignorance.

Yes, very naive. I did thought those harmonics only became important in more exotic cases.

Maybe, I sadly have no way of checking that. (I'm just tinkering here and the most advanced equipment  just a €12 multimeter (and one of the probes just fell of the cable :( ) )

All I can say and observe is that with a unity gain buffer, the signal improved a lot. But that sine wave is not gone.
And it is still 50 Hz  (Which is why I thought it it came the power lines, since the mains are 50 Hz. I've tested with my battery and the result was (mostly) the same, so you are right!)

I shall acquire a better op-amp (because the one I'm using is not meant for a 1 line supply of 5 V and apparently only works in a very limited regime)
And should read more about harmonics before advancing.

And the input impedance is a lot more than 1Meg because of the factor '~openloopgain' that occurs when you make the inverting input equal to the output voltage.
Yeah, I should think more before I write.


Depending on your desired signal bandwidth, you can digitally filter the output of the ADC, with a simple low pass filter.