9 Sharp GP2Y0A21YK0F Analog Distance Sensors with Arduino Mega - Noise Issue

I've sort of hit a wall on this audio project and I could really use some advice.

Here's the deal. I have 9 Sharp GP2Y0A21YK0F Analog Distance Sensors hooked up to an Arduino Mega Board. I am currently powering the board with a 9VDC wall wart (actually putting out 12V) going through a voltage regulator circuit that is putting out a clean 5V (there is a 220 uf capacitor in this circuit, so I am pretty confident that there aren't any ripples in the current). The positive rail of the voltage regulator circuit is connected to the Vin Pin on the Arduino and the Ground rail is hooked up to the GND Pin. Then I connected the GND Pin and Pin 11(audio output) to a 1/4" audio out jack.

I have already soldered the positive and negative outputs of the sensors to their respective rails on a circuit board. I then have these rails connected to the rails of the voltage regulator circuit. Everything seems to be fine with the circuit until I connect the sensors. They introduce a lot of noise that I can seem to get rid of. It is not a hum type of sound, but rather a oscillating sound, somewhere around B5.

I am pretty certain that is a ground issue as the problem goes away when I connect the audio to a grounded DI Box, but I would prefer to figure out the problem in the circuit first.

Any suggestions?

You shouldn't put 5V on Vin. Vin goes to the input of the onboard 5V regulator. You have to feed it about 7V minimum to get 5V out. If you have a regulated 5V supply you should connect it to the +5V pin.

Thanks for the tip, I was hoping it might be that simple. But unfortunately, I still have the noise issue. Any other thoughts?

Capacitors across the sensor power rails should help absorb some of the noise.

Thanks for the tip. That is making a big improvement.

I had tried that before because it suggested a 10uf or more bypass capacitor. Except, I only put a 220uf capacitor in between the rails, thinking that would be enough to cover all 9. This time I have two 820uf, and a 330uf and a 220uf and it is making a noticeable difference. I think I'll pick up a few even bigger capacitors tomorrow.

Thanks again for your help!

Just a bit careful here ... two 820uF, and a 330uF and a 220uF makes 2.17mF, that's quite a bit. Cool for filtering, just don't get zapped directly from it, at 3.3V that lot can store ~7mC of charge, which, when discharging in a few ms can be quite some current.

If you're wanting to use sensors, might want to plonk a 220uF between Vcc and GND just in front of each Sensor, rather than bundling them all up and trying to filter out the mess from there ...

I'm curious about the cause of the noise. From what I understand about these sensors is that they continuously measure with approximately around 39ms repetition frequency [1], which would be around 25 Hz, much lower than your 'B5'. But it has a built-in oscillator that probably makes a pulse train at a higher frequency. Could not find out quickly where that is. Your 'B5' hints at 590 Hz (so roughly 1.6ms pulse length), but that could be a higher harmonic of a lower frequency oscillator as well (assuming a digital oscillator here).

[1] http://www.sharpsma.com/webfm_send/1489

I just tried it with 2 2200uf caps on the sensor rails and moved the two 820uf caps to voltage regulator circuit. Definite improvement with each additional cap, but I can still hear it a bit! Which seems a bit ridiculous to me. I have about 2-2.5 feet of cable between each of the sensors and the sensor circuit, so I am wondering if all of that length is causing the problems? And that maybe these caps are too far away to be as useful?

The B5 noise is really B5 and Bb5 as far as I can tell. Very strange I agree. I do not hear any fundamentals lower, so I would think that it is not a harmonic. But I'm not quite sure.

Update:

I tried combining my voltage regulator circuit and audio output (lowpass filter and twin-T notch filter) circuit onto one breadboard, thinking less wires might help. It actually got much worse. Previously I was feeding the audio output circuit the GND from the board. And apparently that is much cleaner, despite the fact that I had two 820uF caps going from Vcc to GND on the breadboard. Not really sure why? Is there something on the Arduino board that smooths out the GND that I don't have in my circuit?

Another Update:

I have had some more luck putting three 2200uf capacitors and two 820uf capacitors between the sensor rails. So I have decided just to get a 10000uf cap to do all of this work. This cap is rated at 16 volts and I was wondering if I would need a bleeder resistor and if so, what value it should be. All of the parts are concealed so a longer bleed off time would be fine. Thanks for the help!