Skip to content

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.

KY-040 Rotary Encoder

Pin Signals
CLK
DT
SW
VCC power
GND power

Editable from the part inspector:

Attribute Default Description
angle 0
stepSize 18
pressed false

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.