Interrupt help

Jonarotz:
The RPM is a 0-5v square wave...the amount of waves (pulses in my head) will increase per second as RPM increases.
At a specified RPM or frequency the relay will need to be deactivated.
The RPM will continue to climb and vary, it will not stop after the relay is deactivated. The operating rpm will just be outside the window I specify.
The rpm I want the relay activated will be more comparable to a cranking speed, once startup occurs (above my specified pulse count) the relay will shut off.

Hold on a moment now. This is a very different concept to what I thought we were dealing with.

You now seem to be saying that the interval between pulses represents the speed and it is the speed you are interested in - not the number of pulses.

You need to tell us how many pulses per second correspond with different RPMs and, in particular what is the critical pulse rate that you are interested in.

I have an Arduino controlling a small electric motor with an optical detector that produces a pulse every revolution. My Arduino code records the value of micros() for every pulse and the difference between the current value and the previous value is the number of microsecs for a revolution. A little maths can turn that into RPM.

...R