KY-040 360° Incremental Rotary Encoder Module with Push-Button Switch
SKU
GEN-360-ROTARY-ENCODER
MPN
360-ROTARY-ENCODER
Barcode
8080800001461
Continuous 360° incremental quadrature rotary encoder module with integrated push-button switch and 20 PPR resolution for microcontroller menu navigation.
$0.90
Out of stock
This item is not currently available to order.
Available at Sangar Tech.
Key specifications
Weight
10 g
Description
### Product Overview
The KY-040 360° Incremental Rotary Encoder Module is an electro-mechanical digital input device that converts the angular displacement and rotational direction of its shaft into quadrature digital pulse sequences. Unlike conventional variable potentiometers, this incremental encoder rotates smoothly and infinitely through 360 degrees without physical end-stops, outputting 20 full pulse cycles per 360° revolution.
In addition to rotational tracking, the module features an integrated normally-open momentary push-button switch actuated by pressing the central shaft downwards. This dual-function capability makes it the gold standard user-interface component for microcontroller projects, enabling single-knob menu navigation, value stepping, parameter confirmation, and digital volume regulation.
### Key Specifications & Architecture
- **Encoder Technology:** Mechanical contact incremental quadrature encoder
- **Rotational Range:** Continuous 360° unlimited rotation
- **Resolution:** 20 Pulses Per Revolution (PPR) / 20 mechanical tactile detents per turn
- **Integrated Push Switch:** Momentary push-to-close tactile switch
- **Operating Voltage:** 3.3V – 5.0V DC
- **Pull-Up Resistors:** Onboard 10kΩ pull-up resistors populated on the CLK and DT output lines
- **Shaft Style:** 6mm diameter knurled D-type metal shaft
- **Operating Lifetime:** Minimum 30,000 rotational cycles
### Pinout & Wiring Configuration
| Pin | Label | Type | Description | Microcontroller Connection |
| :--- | :--- | :--- | :--- | :--- |
| **1** | **CLK** | Output | Quadrature Output Phase A | Connect to Digital GPIO (Interrupt-capable pin recommended, e.g., D2) |
| **2** | **DT** | Output | Quadrature Output Phase B | Connect to Digital GPIO (e.g., D3) |
| **3** | **SW** | Output | Push Button Switch (Active-Low) | Connect to Digital GPIO with internal pull-up enabled (e.g., D4) |
| **4** | **+** | Power In | Module Supply Voltage (3.3V – 5V DC) | Connect to 3.3V or 5V VCC power rail |
| **5** | **GND** | Ground | Ground Reference | Connect to System Ground (GND) |
### Application & Usage Guidelines
- **Direction & Step Decoding:** When the shaft rotates clockwise, output pin `CLK` leads output pin `DT` by 90 electrical degrees. When rotated counter-clockwise, `DT` leads `CLK`. Reading the state of `DT` at the falling edge of `CLK` determines rotation direction: if `DT` is HIGH, direction is clockwise; if `DT` is LOW, direction is counter-clockwise.
- **Hardware & Software Debouncing:** Mechanical switch contacts inherently produce electrical bouncing transients (1–5ms). Utilize a simple RC filter (0.1µF capacitors to GND) or implement software state-table debouncing using the popular `RotaryEncoder` or `Encoder` Arduino libraries.
- **Push Button Integration:** Pin `SW` pulls to GND when the shaft is pressed. In microcontroller code, enable the internal pull-up resistor (`pinMode(SW_PIN, INPUT_PULLUP)`).
### Documentation
- [KY-040 Rotary Encoder Wiring & Arduino Library](https://github.com/buxtronix/arduino-rotary)