Encoding direction and speed

Basic encoding measures how many wheel slots pass the sensor. This will give speed and distance. By using two sensors slightly apart, you can also encode the direction. The following diagram shows how this would work:

Encoding speed and direction with multiple sensors

The system on the left only encodes the speed. The wheel on the right encodes direction, with a sequence of 1, 2, 3, 4. The direction of the sequence indicates the direction of the wheel.

To build a robot with a record and replay type user interface, or a mouse/trackball, direction is important information, so the additional complexity and space needed ...

Get Learn Robotics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.