User Manual

42
Lesson 8 Rotary Encoder
Introduction
A rotary encoder is a type of electro-mechanical device that converts the angular position
or motion of a shaft or axle to an analog or digital code. In this lesson, we will learn how to
use this device.
Components
- 1 * Raspberry Pi
- 1 * Breadboard
- 1 * Rotary Encoder Module
- Jumper wires
Principle
A rotary encoder is an electronic switch with a set of regular pulses with strictly timing
sequence. When used with IC, it can achieve increment, decrement, page turning and
other operations such as mouse scrolling, menu selection, acoustic sound regulation,
frequency regulation, toaster temperature regulation, and so on.
There are mainly two types of rotary encoders: absolute and incremental (relative)
encoders. The output of absolute encoders indicates the current position of the shaft,
making them angle transducers. The output of incremental encoders provides information
about the motion of the shaft, which is typically further processed elsewhere into
information such as speed, distance, and position.
Most rotary encoders have 5 pins with three functions of turning left, turning right and
pressing down:
Pin 4 & 5: switching wiring terminals for pressing down (no different from the buttons
mentioned previously, so no more details will be provided here.)