Want to monitor how much a wheel has turned in your project? Then you need a rotary encoder! Here’s a way to add rotary encoding without changing the mounting method of your wheels (translated). [Jorge] added it as a way to improve the functionality of this line-following robot. It uses a paper encoder wheel which is monitored by an optical sensor.
The paper wheel consists of alternating white and black pie pieces. You can make this with a felt-tipped marker, or use a tool like the one we featured a couple of years ago to print out a disc rendered to your own specifications. This is glued to the inside of the wheel and monitored by a CNY70 reflective sensor (the same one used in that electric keyboard retrofit).
The homemade board which holds the sensor can be seen mounted on top of each wheel’s motor. It requires three wires, voltage, ground, and data. The data line is connected to the output of the phototransistor in the CNY70 package so it can be used with a microcontroller interrupt for easy integration with the firmware driving the robot.
[Jorge] goes into some detail about how the added data helps to improve the speed performance seen in the clip after the break.