Detect the status of an exhaust fan

The only problem I have is when the IR transistor end up in the black part of the wheel--it still measures rpm. I solved it by recording data during the exhaust fan's off state(in white and black) and on state, then I used an if-else statement to sort. But if you don't want to make your code longer, I recommend you use a line tracking sensor like this Gravity: Digital Line Tracking (Following) Sensor For Arduino - DFRobot and upload the rotary speed detection code I found here http://www.seeedstudio.com/wiki/Grove_-_Infrared_Reflective_Sensor. It measures revolution when there is change from white to black; it doesn't just count the black.

I hope this helps someone :slight_smile: