KY-040 Rotary Encoder Sensor Module Brick Sensor is a rotary input device (as in knob) that provides an indication of how much the knob has been rotated AND what direction it is rotating in. It’s a great device for stepper and servo motor control. You could also use it to control devices like digital potentiometers.
KY-040 360 rotary Degree encoder, is an incremental electro-mechanical device that converts the angular position or motion of a shaft or axle to digital code. The output of incremental encoders provides information about the motion of the shaft, which is typically further processed in processor/controllers into information such as speed, distance, and position.

Features of KY-040 Rotary Encoder
- Operating Voltage: 5V
- Mechanical angle: 360 Degrees
- Output: 2-bit gray code
- Positions per revolution: 30
Pinout of KY-040 Rotary Encoder

Pin Type | Description |
CLK | Encoder Pin A |
DT | Encoder Pin B |
SW | No push-button switch |
VCC(+) | Voltage input(+5V) |
GND | Ground(Encoder Pin C) |
Specifications of KY-040 Rotary Encoder
Model | KY-040. |
Type | Incremental Encoder. |
Cycles per revolution (CPR) | 20. |
Working voltage | 0 – 5V. |
Material | PCB + Brass. |
Weight | 10 gm. |
Size | 32 x 19 x 30 mm. |
Datasheet KY-040 Rotary Encoder
Download KY-040 Rotary Encoder Datasheet from the link given below.