[Runtimemicro] has the answer, at least if you are writing PWM code for the Arduino. Their free application lets you set a few parameters, visually see the results, and then generates code for you.
An IR transmitter/receiver pair are positioned on either side of the fan. When the blade passes in between then, the receiver shuts off a transistor connected to one of the Arduino’s external ...