KY-040 Rotary Encoder Module

A compact incremental rotary encoder module with quadrature CLK and DT outputs plus an integrated momentary push switch. The five-pin interface exposes CLK, DT, SW, supply, and ground for breadboard-friendly user input.
Pinout
- VCC
Logic supply. Use 3.3V with 3.3V microcontrollers.
Type · PowerVoltage · 3.3 - GND
Ground reference.
Type · Ground - CLK
Quadrature encoder channel A.
Type · GPIO - DT
Quadrature encoder channel B.
Type · GPIO - SW
Integrated momentary push switch output.
Type · GPIO
| Pin | Type | Function | Voltage |
|---|---|---|---|
| VCC | Power | Logic supply. Use 3.3V with 3.3V microcontrollers. | 3.3 |
| GND | Ground | Ground reference. | |
| CLK | GPIO | Quadrature encoder channel A. | |
| DT | GPIO | Quadrature encoder channel B. | |
| SW | GPIO | Integrated momentary push switch output. |
Pin details
5 connections- VCC
Logic supply. Use 3.3V with 3.3V microcontrollers.
PowerVoltage · 3.3 - GND
Ground reference.
Ground - CLK
Quadrature encoder channel A.
GPIO - DT
Quadrature encoder channel B.
GPIO - SW
Integrated momentary push switch output.
GPIO
Passives
57 other optionsE12 resistor kits, ceramic and electrolytic capacitor sets, 1N4148/1N4007 diodes, TIP120 Darlingtons, IRLZ44N MOSFETs and 100F supercapacitors — bench stock in kit quantities.
1/4W Resistor Pack - 400 PCS visual preview1/4W Resistor Pack - 400 PCS
1N4001 Diode - 10 pack visual preview1N4001 Diode - 10 pack
$1.50
1N4007 Diode visual preview1N4007 Diode
1N4148 General Purpose Fast Switching Diode visual preview1N4148 General Purpose Fast Switching Diode
€2.45
220 Ω Metal Film Resistors, 1/4 W (Pack of 10) visual preview220 Ω Metal Film Resistors, 1/4 W (Pack of 10)
3mm LED Blue - 25 PCs visual preview3mm LED Blue - 25 PCs
3mm LED Pack (50 PCS) visual preview3mm LED Pack (50 PCS)
5mm Green LED visual preview5mm Green LED
5mm LED Pack (6 PCS) visual preview5mm LED Pack (6 PCS)
6-Ch High Current Driver 1X3 Kit v1 visual preview6-Ch High Current Driver 1X3 Kit v1
74HC165 Parallel-In Serial-Out Shift Register visual preview74HC165 Parallel-In Serial-Out Shift Register
74HC4067 16-Channel Analog Multiplexer visual preview74HC4067 16-Channel Analog Multiplexer
Related groups
4 groups
10W Super Bright LED - Violet visual previewLED pixels
WS2812/SK6812 NeoPixel strips, rings and Jewels, APA102 DotStar pixels, and plain analog RGB strips — each matched to its protocol and host, not just its connector.
Components · Addressable LEDs · 180 parts
18-Channel 8-bit PWM LED Driver w/ I2C Interface visual previewBare ICs
74HC logic gates, MCP3008/MCP23017 ADCs and expanders, 24LC256 EEPROM, 4N25-series optocouplers and ULN2803A drivers — bare DIP chips with no breakout-board conveniences like pull-ups or level shifting.
Components · Integrated circuits · 68 parts
10-bit ADC (SPI) visual previewConverters
ADS1115/MCP3421 ADCs, MCP4725 and GP8413 DACs, CP2102 USB-UART boards, and I2C plumbing like the LTC4316 address shifter — matched to bus, resolution and signal range.
Components · Interface converters · 114 parts
256MB Micro SD Memory Card visual previewMemory
24LC32/25LC256 EEPROM, I2C FRAM, 64Mbit PSRAM, and microSD breakouts up to 64GB — matched to write frequency and data volume, not just interface.
Components · Memory & storage · 39 parts