Try removing the serial output from the interrupt handler. You could create an array to hold your data (just a second or so, say 100 elements),store the data in the handler and send them from your loop when your array gets full. Don't forget to disable interrupts when you read and send the data and enable them when you are done. If this solves your problem then you can design some code to makes sure that the interrupt handler and serial print routines don't interfere with each other.
Hi there, great project - I plan to try something similar myself when I've finished my current project.
I would try to slim down the interrupt handler as far as possible and move debugging code into your main loop. Also, from your photos it looks like the arm (cardboard?) cutting the phototransistor may not be balanced - it will interact / drag when it nears the rpm counter aperture. I would recommend trying a circular disc with one or two small holes cut into it, and triggering your interupt on a rising signal from your phototransistor - this should be more stable.
Also, is there a chance that the interrupt is double-triggering? I don't know enough yet about how the ATMega processor works (I'm an Arduino newbie) but you could try disabling interrups at the start of your handler then re-enabling after logging your timecode, and possibly using a 'debounce' type circuit on the output from your phototransistor to ensure it gives a clean logic signal.
Just ideas, but hope they help. Let us know how you get on.
will try using a circular disc with a small slit (maybe the cardboard arm is really too wide)
will try connecting the transistor to ocsilloscope to see what it looks like.
maybe upload the image
as you can see on the link from my page , the 15-year-old kids who did this with an atmega8 (not arduino) used a similiar sensor and arm , so there should be litle difference.