Usually robot's wheels are rotated by a motor via some gear - a set of gear wheels decreasing rotation speed of motor in many times. The gear wheel rotating robot's wheel has already several times more rotation speed the wheel. The next gear wheel rotating this gear wheel has even more speed and so on. If drill holes in one of these gear wheels and situate optical sensors there - it's possible to register rotation angle changes with fine precision.
LED and optical receiver are taken from an old mouse with a ball inside instead of optical sensor. Actually optical receiver is a photo-transistor or a photo-diode which has resistance about hundreds Ohms and noticeable less when LED lights on it.
Step 1: Drill Holes in the Gear Wheel
Step 2: Soldering LED and an Optical Receiver
This receiver has one pin (4) left free because it has one more receiver inside - it may be used to define the rotation direction. Not used this time.