KY-040 Rotary Encoder
KY-040 incremental rotary encoder with push-button. Turning the knob outputs quadrature pulses on CLK and DT (direction = which leads); the shaft press drives an active-low SW. Reads from any board’s GPIO.

| Pin | Signals |
|---|---|
| CLK | — |
| DT | — |
| SW | — |
| VCC | power |
| GND | power |
Attributes
Section titled “Attributes”Editable from the part inspector:
| Attribute | Default | Description |
|---|---|---|
angle |
0 |
|
stepSize |
18 |
|
pressed |
false |
Use it
Section titled “Use it”Add it from the component picker — search for “KY-040 Rotary Encoder” (tags: rotary, encoder, rotary encoder, rotary-encoder, ky-040). Right-click it on the canvas for the in-editor datasheet, and check the examples gallery for circuits that use it.