I use QRE1113 reflective optical detectors to count and time the revolutions of a small DC motor. The sensor detects a blob of white paint on a black disk on the motor shaft.
Sparkfun sells them on a breakout board but they are big enough for hand soldering if you don't want the breakout board. Even though you just want digital pulses use the circuit schematic that Sparkfun refers to as an analog circuit.
...R