MicroJPM
KY-040 Keyes Rotary Encoder - (AD835)
KY-040 Keyes Rotary Encoder - (AD835)
Couldn't load pickup availability
Description:
The Keyes KY-040 rotary encoder is a rotating input device (like a knob) that provides an indication of how much the knob has been rotated and in which direction it is rotating.
It's a great device for controlling stepper motors and servos. It could also be used to control devices such as digital potentiometers.
How does it work?
A rotary encoder has a fixed number of positions per revolution. These positions are easily measured by small "clicks" as you turn the encoder. This Keyes module has thirty such positions.
On one side of the switch there are 3 pins. They are usually named A, B, and C. In the case of the KY-040, they are oriented as shown.

Inside the encoder there are two switches. One switch connects pin A to C, and the other switch connects pin B to C. At each encoder position, both switches are either open or closed. Each click causes these switches to change states as follows:
If both switches are closed, rotating the encoder right or left by one position will cause both switches to open.
If both switches are open, rotating the encoder right or left by one position will cause both switches to close.
The following illustration is representative of how the switch is constructed:

As you can see, the angular position of terminal A and terminal B is such that:
If you turn the knob to the right, the switch connecting A and C will change state first.
If you turn the knob to the left, the switch connecting B and C will change state first.
If we represent the opening and closing of the switches as waveforms, it would look something like this:

Compartir
