Help with a Noisy Pulse Generator

I have a pulse generator that I want to hook up to an Arduino. The pulse generator generates a variable AC voltage from 0 to 5 V depending on speed and the frequency I am interested in is anywhere from 0 to 200 Hz.

I am using a LM339n with a ground reference to pickup the signal. However, there is significant noise from the pulse generator (even when its not moving) which unfortunately causes false pulses I am attaching two pictures, the first is with the generator stopped and the second is with the generator moving slowly.

I thought of using a 100 mV reference, but unfortunately at low RPM the noise and pulses have very similar voltage magnitudes.

Any suggestions to clean up the noise?

Since the noise appears to be higher frequency than the signal, you might try a simple [u]low-pass filter[/u] with a cutoff frequency at about 200Hz.

But, from the image on the 'scope I can't tell if there is high frequency and low frequency noise.

Another thing you can try is putting a load (resistor) on sensor/generator. You'll have to check the specs, experiment, or guess, to find the correct value. The LM339 has very-high input impedance (as does the Arduino) so it tends to be sensitive to noise.

Hi Doug,

Thanks for the quick response!

Can you suggest a value for the load resistor (I assume you mean across the input)?

Thanks!
Chris

are you using a switching power regulator?

these will give you lots of noise in the 20khz to 150khz range. i had this problem when i built a signal generator. capacitors, resistors and coils did not help. after running my devive from a standard power supply everything was fine.

this is just an idea. however my signals looked like yours - that is why i thought of this.

Your comparator circuit has gone into self-oscillation with the generator off.
What does your comparator circuit look like?
I would consider using positive feedback to create hysteresis and eliminate noise (like described here): Working with the Comparator Circuit | ermicroblog

Thanks to dlloyd. Looks like a 10k pullup from the signal line to Vcc solves my problem.

Have you tried a low pass filter ?

I assume you know that the LM339 has an open collector output, so it needs a pull-up resistor between Arduino's 5volt line and the opamp's output.
What is the value of that resistor. I would suggest 1-10k.

This seems to be a digital pulse.
Not really important if there is some hash on it when it's "high" or "low".
It is important that transitions are short/sharp, and that a "low" is close to ground and a high is close to the supply rail of the receiver of the pulse.

Maybe wise to post a circuit diagram of the opamp.
Leo..

Can you expand your Time/Div ?