Behavioural mixed-signal modelKY-040 (EC11)encoder_ky040
Rotary encoder KY-040 (with button)
Mechanical incremental encoder, 20 detents per revolution, one full quadrature cycle per detent on CLK/DT (CLK leads when turning clockwise), 10 kΩ pull-ups on the module; SW switches to GND (use INPUT_PULLUP). In the schematic: left half = turn left, right half = turn right, center = press.
Key data
- Category
- Modules
- Simulation model
- Behavioural mixed-signal model
- Manufacturer part number
- KY-040 (EC11)
- Reference prefix
- SW
- Pins
- 5
- Land pattern
- PinHeader_1x05_P2.54mm_Vertical
Simulation model
A behavioural model implements the interface of the chip (registers, protocol, timing) at its pins. The pins are connected to the analog circuit like CMOS pins.
- Model
- encoder
- Supply pins
- VCC / GND
Pins 5
| Pin | Name | Use |
|---|---|---|
| GND | GNDGround pin | Ground |
| VCC | +Supply pin | Supply for the module pull-ups (3.3 or 5 V) |
| SW | SWOutput pin | Push button: low when pressed |
| DT | DTOutput pin | Quadrature signal B: to an input (interrupt) |
| CLK | CLKOutput pin | Quadrature signal A: to an input (interrupt) |
Parameters 2
Position (detents)
posliveDefault0
Button pressed
swliveDefault0
PCB
Connector / off-board
PinHeader_1x05_P2.54mm_VerticalRotary encoder KY-040 (with button) as a module on a 5-pin header (GND, +, SW, DT, CLK) – compare the order with your own module