Rotary Encoder Module KY-040 – Precision Position Sensor Arduino US SHIP TODAY!


Only 3 left in stock

SKU: WB0DG000001 Category:


body {
font-family: Arial, sans-serif;
.header {
background-color: #4CAF50;
color: white;
text-align: center;
padding: 10px;

.description {
margin: 20px 0;

.footer {
background-color: #4CAF50;
color: white;
text-align: center;
padding: 10px;
margin-top: 20px;

KY-040 Rotary Encoder Module – Precision Position Sensor for DIY Electronics

Introducing the KY-040 Rotary Encoder Module, an ingenious device that offers detailed position reporting of the shaft. This module is not just a position sensor; it also records the direction of rotation and even functions like a pushbutton when the shaft is depressed. Designed to be compatible with both 3.3V and 5V, it provides a versatile solution for your various electronics projects.

Key Features:

  • Continuously variable position sensor
  • Tracks direction of shaft rotation
  • Functions like a pushbutton when shaft is depressed
  • Compatible with 3.3V and 5V

The KY-040 Rotary Encoder Module finds wide applications, such as scrolling through menu items on an LCD display and triggering the selection of an item when the shaft is pushed. It can also interact with stepper motors, allowing a rotation of the encoder to correspond with the stepper motor’s rotation. Attach a known-diameter wheel to the shaft, and you can calculate the distance covered when the wheel moves along a surface.

This module works on an incremental encoder principle, outputting a pulse with every detent (click) of the shaft rotation. However, it does not have a specific physical position sense; it tracks the relative position from where it started when first powered on.

The KY-040 Rotary Encoder doesn’t have a mechanical stop and allows continuous spinning of the shaft. Furthermore, it can identify the direction of rotation (clockwise or counterclockwise), which can help to scroll a menu up or down, for example.

Connections and Pin Specifications:

  • GND= Ground
  • ‘+’ = Vcc (3.3 – 5V)
  • SW = Switch Output – Active LOW
  • DT = DT (B) Output Pulse. Connects to digital input on MCU to determine direction of shaft rotation
  • CLK = Clock (A) Output Pulse. Connects to digital input on MCU to determine amount of shaft rotation


  • PCB: 26 x 19mm
  • Height including shaft: 23mm


off, especially for you 🎁

Sign up to receive an exclusive discount, and keep up to date on our latest products!

We don’t spam! Read our privacy policy for more info.

Additional information

Weight 1.0 oz
Dimensions 6.0 × 4.0 × 2.0 in