A paper blade is attached to the motor's shaft and the motor run with the blade passing through the slot of the photomicrosensor (Omron EE-SX1137). Whenever the blade cuts the IR beam the sensor signals a HIGH value to Arduino input pin making it possible to count the number of revolutions.