Brochage
Brochage Module encodeur rotatif (KY-040, 5 broches)

Broches
- GND
- + (VCC, 3.3–5V — only feeds the two 10kΩ pull-ups on CLK and DT)
- SW — built-in pushbutton, shorts to GND when the shaft is pressed (no pull-up on the board for this one: use INPUT_PULLUP)
- DT — quadrature output B
- CLK — quadrature output A
Caractéristiques
| Tension d'alimentation | 3.3–5 V |
|---|---|
| Sortie | 2-channel quadrature (CLK, DT) |
| Résistances pull-up | 10 kΩ on CLK and DT; none on SW |
| Detents per turn | Typically 20 |
| Rotation | Continuous 360°, no end stop |
| Push switch | Shorts SW to GND when pressed |
| Contacts | Mechanical — debounce needed |
Notes
- Read CLK/DT transitions to determine rotation direction; debounce SW (and CLK/DT) in software, or read CLK/DT from an interrupt on CLK.
- The header reads GND, +, SW, DT, CLK top to bottom with the mounting hole above it — most clones keep this order, but check the silkscreen: a few swap CLK and DT.







