Hi Arduino Forum members,
looking for some help with this code for rpm
http://arduino.cc/playground/Main/ReadingRPMInstead of using an hall effect sensor, I have in place a photo-interrupter that gives a high logic when blocked.
Since I am only gettings 1 pulse per revolution I have changed the line:
rpm = 30*1000/(millis() - timeold)*rpmcount;
to
rpm = 60*1000/(millis() - timeold)*rpmcount;
The arduino uno I'm using is R3 and have the output from the photo-interrupter connected to pin2.
photo-interrupter name: KTIR0611S
connected as in picture below.

Motor am using is a 80mm 12V pc fan, running on 9Vdc. Not sure about how fast such a motor should go.
Here is some of the kind of values am getting.
31984
59580
59580
31984
31984
53212
25876
4448
53212
15072
53212
42508
5096
28400
54312
29584
32592
32592
21068
36900
53212
15072
15072
9724
36900
25876
15072
21068
9724
36900
15072
25876
29584
9724
53212
4448
21068
27856
59568
48144
25876
25876
64136
25876
48144
48144
29584
29584
56300
29584
29584
56300
1460
29584
2908
41848
17520
21068
21068
48144
32592
48144
48144
48144
44336
56300
17520
32592
59568
21068
59568
32592
59568
36900
64136
64136
64136
64136
9724
9724
25876
25876
64136
9724
36900
9724
59568
59568
48144
44336
Hope some one can help me.
Thanks.