# How do I properly use Sharp GP2Y0A21YK0F sensor?

I've recently obtained Sharp GP2Y0A21YK0F IR distance sensor and I'm not sure how to make a proper circuit for output measurement, since I'm getting lots of noise. The only thing datasheet mentions is that there should be a $10 \mbox{ } \mu F$ capacitor on power pins as close to sensor as possible. Well, I soldered it directly to the sensor's power pins and it didn't help.

Here's what the output looks on the scope:

The fat line at the bottom of the screen is the actual expected output and when I move my hand near the sensor, the line moves as expected, but the peaks remain the same.

Using an LC filter did remove the peaks, but I'd like to know if there's some industry standard way of solving the problem I have.

• Can you post your circuit? What else is in this system? How is it powered? Are these same spikes present on the input power to the sensor? – Ryan Sep 13 '12 at 12:35
• @Ryan There is nothing else in the system. Only the sensor, power supply, scope and maybe 40 cm of cables. I don't see any spikes on the power connector of the sensor. There's around 50 mV peak to peak of ripple, but I don't see why that would be a problem. – AndrejaKo Sep 13 '12 at 13:31