A wheel encoder is a disk with slots cut in it. Some more advanced ones have differently cut slots to have more precise control. Here are some levels of complexity:
http://www.avrfreaks.net/sites/default/files/SevenWheelsXparent.gifBut they all work on the same principle. You have layers of slots on the disk, and for each layer you need a light/sensor pair. In the image above, the first two pictures are 1 layer, the next 2 are 2 layer, and the absolute position ones are 8 layer.
You connect the light to always be on, and connect the sensor to an interrupt pin. As the wheel spins, the disk spins, and as the slots spin past the light, it causes flashes of light to be detected by the sensor. By counting these flashes, you can know how far the wheel has moved, to determine position.
By counting the flashes over a certain time interval, you can determine speed.
If you already have an encoder disk, then the only sensors you need are small LEDs, and a small photoresistor. Put the LED on one side of the disk, and the photoresistor on the other to count the pulses.