KY-040 encoder pinout
KY-040 encoder (EC11 with button), EC11 mechanical incremental encoder with button, 5 V logic, 19.05×25.9 mm, 5 pins
partly verified17.10.2026
Top view (shaft side), connector on top.
BuyDownload PNG- Chip
- EC11 mechanical incremental encoder with button
- Logic
- 5 V
- Power
- + 3.3-5 V
Important
- CLK and DT are pulled up on the board with 10 kΩ to "+", SW is not: use INPUT_PULLUP for the button.
- The contacts bounce: read by interrupt while checking the second channel, or use a library (Encoder, ESP32Encoder, AiEsp32RotaryEncoder).
- Geometry from KiCad footprints and photos (±0.5 mm). Holes and small components are approximate, check with calipers.
All pins
| Label | Number | Functions | Limits | Check |
|---|---|---|---|---|
| GND | Ground | not from manufacturerNo-name module: labels match Joy-IT, Wokwi and the footprints; which edge GND is on comes from a single labeled footprint only (Wokwi draws it the other way round). Check the labels on the board. | ||
| + | 5 V | power input | not from manufacturerNo-name module: labels match Joy-IT, Wokwi and the footprints; which edge GND is on comes from a single labeled footprint only (Wokwi draws it the other way round). Check the labels on the board.The CLK and DT pull-ups go to this pin: with ESP32, Pico and other 3.3 V boards connect + to 3.3 V.Labelled on other revisions as: VCC | |
| SW | not from manufacturerNo-name module: labels match Joy-IT, Wokwi and the footprints; which edge GND is on comes from a single labeled footprint only (Wokwi draws it the other way round). Check the labels on the board.No pull-up on the board (the resistor pad is empty): enable INPUT_PULLUP or add 10 kΩ to the supply. | |||
| DT | Encoder channel B | onboard pull-up | not from manufacturerNo-name module: labels match Joy-IT, Wokwi and the footprints; which edge GND is on comes from a single labeled footprint only (Wokwi draws it the other way round). Check the labels on the board.10 kΩ pull-up to "+" on the board. | |
| CLK | Encoder channel A | onboard pull-up | not from manufacturerNo-name module: labels match Joy-IT, Wokwi and the footprints; which edge GND is on comes from a single labeled footprint only (Wokwi draws it the other way round). Check the labels on the board.10 kΩ pull-up to "+" on the board.Direction: which of the CLK and DT channels changes first. |
Sources
Not verified against the manufacturer: 5 of 5 pins. The pin card says what confirms each one and where sources disagree.
- Joy-IT: KY-040 Rotary Encoder (COM-KY040RE)user guide, checked 17.10.20265 V supply, size 18×31×30 mm including the shaft
- Wokwi: wokwi-ky-040third-party source, checked 17.10.2026pins CLK, DT, SW, VCC (+), GND; the board has pull-ups only on CLK and DT; SW shorts to GND; 20 steps per revolution
- KiCad: brianinnes/waterMonitor ky-040-rotary-encoder-module and ysoldak/fpvc-gadget RotaryEncoder KY-040third-party source, checked 17.10.2026outline 19.05×25.9, row 2.54 from the edge, Ø3 holes; labels from the second footprint: pin 1 GND, then +, SW, DT, CLK
Size: from the KiCad footprint (waterMonitor); Joy-IT lists 18×31×30 including the shaft, sellers list 19×26…32 (approximate).
FAQ
- What supply voltage does the KY-040 encoder need?
- +: 3.3-5 V. 5 V logic.



