Noise on 3.3V output when connecting IR sensor to 5V? How to fix?

I was testing an IR sensor by sending them over serial and using the IDE’s serial plotter to visualize them (very simple script - attached).

I am using a Sharp GP2Y0A02YK0F sensor and an Arduino 1. The sensor is simply hooked up directly on 5V, ground and pin A5.

It had quite a bit of noise and I notice you could see the same noise on the Arduino’s 3.3V output, so I figured it was because of the Arduino’s voltage source. However, I then noticed that the noise only occurs when the IR sensor is connected.

3.3V output with sensor connected (positive spikes):

3.3V output without sensor connected:

I’m not entirely sure whether the voltage has noise or if it is possible that the Arduino’s ADC is measuring incorrectly. I wasn’t sure what to google.

What could be causing this noise and how can I fix it? (A low-pass filter didn’t seem to work on the sensor measurement - I guess an external 5V source will probably be necessary?)

serialPlotterTest.ino.ino (219 Bytes)

The output of the A/D depends on two things.

  1. the voltage you connnect to the analogue pin.
  2. the reference voltage of the A/D (which is the 5volt supply by default).

In your case the 3.3volt pin is probably still ‘clean’, but the 5volt supply has the spikes.

Try a decoupling capacitor across 5volt/ground of the sensor, close to the sensor.
A 10uF cap is even mentioned on the Pololu page.
Leo…