Varying frequency sine wave - period measurement


I am building a flowmeter by measuring the speed of rotation of an impeller. The impeller I have produces a sine voltage and I would like to measure the time period of each individual wave i.e. the time between peaks. This is because the flow speed, and so, the frequency of the wave is constantly varying so I need to be able to take an average of all of the wave periods in a given time to calculate an average flow speed. Can anyone give me any ideas about how to go about this?


It depends quite a bit on the voltage output by your impeller. Here, for example, is a circuit to both measure the frequency of a 12VAC signal and also power the Arduino from it (I'm not saying this will work for you...I don't know how much current your impeller provides):

If you are not deriving power from the impeller (most likely) you can just get rid of the bridge rectifier (diamond at the top left), C1, C2, and IC1 and the remaining components (D1, D2, R1) will give you 5V at the digital input on the positive half wave and 0V on the negative half wave. You can then use something like the pulseIn() library function to measure the frequency of the signal.

-- The Arduino Drum Machine: 14-track MIDI drum machine sequencer / groove-box