Jump to content
  • 0

Analog shield - noisy input to ADC


Josh L

Question

I'm using the Analog Shield, and I'm using analog.read() or analog.signedRead() to sample a control voltage (DC), that seems to be pretty noisy (Vpp = 100 mV), so any processing I do on that signal is also noisy, meaning my final output is really noisy. Any suggestions on how to deal with a noisy input? I'm much more of a programmer, so any suggestions are welcome - sorry if this is obvious or EE 101 kind of stuff...

Thanks very much,

Josh

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

The culprit I've often struggled with has been the power supply.  If you use a linear power supply (not your typical wall wart ...), you can often remove a bunch of noise.  Sometimes an RF choke can help as well.

To really get into the issue/question, you'll need to take a Fourier transform of your "noisy" input, and look at the spectral components of the noise.  That'll help you identify where it's coming from, and hence what needs to be done about it.  For example, an oscillation at the switching rate of a switching power supply can be ... very suggestive.

Just some thoughts,

Dan

Link to comment
Share on other sites

Hi Josh,

The other thing I've personally found (also related to the power supply) that I have forgotten to do is to make sure that the Analog Shield and your power supply are sharing the same ground line; you can get some funky results that don't quite make sense since the two components aren't sharing the same reference point. But if you've already done that, I guess my only other thought (aside from what Dan has already suggested) would be to ask what board do you have your Analog Shield mounted on and how are you powering it?

Link to comment
Share on other sites

Thanks Dan and JColvin -

I'm going to check the noise via FFT and see if it looks like power supply...also will check grounds, as well as check the noise on the line with it disconnected from the analog shield.

I'll let you know what I find...

Josh

Link to comment
Share on other sites

OK so FFT doesn't show any real peaks - the plot is just sort of generally slightly fuzzy - so I'd call it low level white noise. Plus, I checked the line not hooked up to the Analog Shield - still noisy, so the noise has nothing really to do with the Arduino or Analog Shield. So here's the thing: I can use this control voltage (CV) line in another device (Moog Mother-32 synthesizer CV oscillator control input) and it seems to work fine without any jitter. I wonder if the other device uses some kind of lowpass or smoothing filter? Do you have any recommendations for filtering for removing this kind of white line noise before going into the Analog Shield?

Thanks again.

Josh

Link to comment
Share on other sites

"Generally slightly fuzzy"?  Hmm ... How big of an FFT did you do?  Did you manage to do any averaging on the FFT output?  (Square it first before averaging, rather than taking an absolute value--just to satisfy purists like myself.)  Often times the output of an FFT can be so jumpy in and of itself that you need to average several of them together.  256x averages isn't that uncommon.  Further, if your FFT is too small, you might miss some of what is there.  You can then compare squared and averaged values to the sum of the squares and averages of the whole, to determine the significance of any given peak.

As for filtering, there are *lots* of options.  Let's start with the most simple--a recursive average.

y_{n+1} = alpha * x_n + (1-alpha) * y_n

where y_n is the output of your filter at time n, and x_n is the input at time n.  You can adjust alpha for whatever amount of lowpass filtering you need.  Apply this filter in succession for even greater smoothing.

The "better" options than this, such as those with linear phase, tend to get more expensive--both to design as well as to implement.  This filter, however, is quite simple and should be easy enough to implement.

Dan

Link to comment
Share on other sites

I think finding out what's wrong with, and fixing the hardware is better than code based.  :D  The filter I outlined above should have similar characteristics to an RC lowpass filter.  Both are messy, neither has linear phase, etc., but depending on your application, both may work.

Dan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...