RPM input help

Hello Everyone! I'm working on a small project for my car (2002 camaro) and would appreciate some help. I have an LS1 engine with the factory ECU.

I'm wanting to input an RPM signal into my arduino. This engine is an 8 cylinder with 1 ignition coil per cylinder. So, my idea is to input the pulsed signal from one ignition coil (5v signal) into the arduino and get the arduino to understand that signal as RPM so that I can code in some on/off signals using the rpm. For example...to turn on an led light between say 5000 and 6000 rpm I need some help with the code to get a useful RPM signal. The coil will fire one time for every 2 revolutions of the crankshaft.

Also, I would like to add some sort of smoothing. I think a "running average" of say 10 samples would be good. So I could sample 10 values...average them...then use that average in my rpm calc. Then with every new sample...drop off the oldest saved data point of the 10 and re-average them.

Thanks in advance for any help!

You need to be very careful to ensure that the Arduino does not get any voltage higher than 5v (even very briefly). An opto-isolator would be a good precaution.

The program in this link should provide a good starting point. I use it with a small DC motor that rotates at up to 15,000 RPM.