Electronic – reading the frequency of a sine wave

frequencywave

I'm trying to build a speedometer for my car, using the output from the cars speed sensor. The speed sensor outputs a sine wave. here it is on an oscilloscope:
asdf

as I understand it, in order for the arduino to be happy, this signal needs to be between 0 and 5v.

It seems that the peak to peak of this wave is about 8v-ish, which means if I somehow "chop" the negative voltage off of this signal, I should be left with something like 0-4v which is what I need.

How do I go about reading this signal by the arduino? I'd like to keep the circuitry simple due to the harsh(ish) environment that it'll be sitting in.

I've seen some people suggest simply a diode and a resistor, and others suggest op amps, schmitt triggers, and other concepts I'm not strong on.

Any help is very welcome!

Best Answer

There are several ways. Using an op-amp and a few discrete components, you can get a zero-crossing detector that provides a pulse no larger in amplitude than the positive supply rail to the op-amp, which can be detected with an external interrupt or pin-change interrupt on the Arduino.

Below is one example of a zero-crossing detector.

schematic

simulate this circuit – Schematic created using CircuitLab