Infrared interruption counter
You can use photo any transmissive or reflective photo interrupter (wire or TH) ideally with integrated Schmitt trigger and connect to IRQ driven AVR input to have quick trigger reaction. For production is cheaper photo interrupter with external Schmitt but for prototyping it does not matter.
Don't forget serial resistor to limit current. 

Search e.g. "photo interrupter Schmitt" at Farnell.