A rotary encoder is a type of position sensor that converts the angular position (rotation) of a knob into an output signal that is used to determine what direction the knob is being rotated.
Due to their robustness and fine digital control; they are used in many applications including robotics, CNC machines and printers.
There are two types of rotary encoder – absolute and incremental. The absolute encoder gives us the exact position of the knob in degrees while the incremental encoder reports how many increments the shaft has moved.
The rotary encoder used in this tutorial is of an incremental type.