Help with tachometer code

The iginition waveform (coming off coil neg.) is supposed to look like this:

One approach is to trigger on the first pulse after t1 and a simple circuit to do this is as follows (see the bottom part):

Tach-In connects to the pickup from your coil and tach-out goes to an Arduino digital pin. D2 will supress the negative going pulses (this is missing from your circuit and is why it may eventually destroy your AtMega). If R2 is too high you will pick up more than the initial pulse and if too low you will not see any pulses. So if you plan on building this you may want to replace R2 with a pot and tune it until you get a single pulse.

R1/R2 acts as a voltage divider, D3 (4V7 zener) is to limit voltage on the Arduino input pin to a safe level. Arduino Gnd should be connected to car battery minus.