OHMYARD

DISCOVER · EXPERIMENT · BUILD

TRACK 9 · MAKER PITFALLS & SENSORS50/52
NOV 27, 2026
14:20:00
CLICK TO STEP: 4CH-A (CLK) · LEADS B BY 90°CH-B (DT) · 10nF RC CLEAN!90°↻ CW (A LEADS B) · 10nF DEBOUNCE ON
Drag or WASD to pan · Q / E to rotate · Scroll to zoom

Rotary Encoder Quadrature (A/B 90° Phase) & 10 nF Hardware Debouncing

✓ Reviewed by Jason Guo (OhmYard Lab)· IEC & Datasheet Verified· Updated Nov 27, 2026
QUICK ENGINEERING ANSWER (TL;DR)

How does a simple mechanical volume knob know whether you turned it clockwise or counter-clockwise? Inside are TWO switches (CLK and DT) offset by 90°: turning CW makes A change before B, while CCW makes B change before A — and adding two 10 nF capacitors eliminates the contact bounce spikes that cause double-counting!

Phase Shift Δφ = 90° (Quadrature) | RC Debounce τ = 10 kΩ × 10 nF = 100 µs

Hardware RC debouncing keeps interrupt service routines (ISRs) tiny and accurate even at fast knob spin speeds.

SymbolComponentReal-World Engineering Tip
ENC1KY-040 Incremental Rotary EncoderNever put giant 10 µF capacitors on encoder pins — they slow edges down too much; stick to 10 nF–100 nF.

Real-World Bench Scenario: Great for 3D printer menus, synth filter knobs, bench power supply voltage dials, and DIY macro pads.

Bench Challenge: Toggle CW vs CCW to watch Channel B shift 90° relative to Channel A, then switch 10 nF Hardware Debounce OFF vs ON to see raw contact bounce glitches disappear.

Frequently Asked Questions

How does a microcontroller detect clockwise vs counter-clockwise rotation on a rotary encoder?

A rotary encoder outputs two square waves (CLK/A and DT/B) offset by 90 degrees (quadrature). When CLK changes state, the microcontroller reads DT: if DT differs from CLK, the shaft turned in one direction (e.g., clockwise); if DT matches CLK, it turned in the opposite direction.

Continue Exploring Related 2.5D Labs
← All 52 Labs Hub8. RC & Oscilloscope →19. Arduino Uno Pinout →18. ESP32 Pinout Guide →

OHMYARD · ALL 52 INTERACTIVE LABS & SIMULATORS

1. Closed Loop & Faults
/closed-loop
2. Ohm's Law & Thermal
/ohm-law
3. Series vs Parallel
/series-parallel
4. X-Ray Breadboard
/breadboard-simulator
5. LED Resistor & E24
/led-resistor-calculator
6. Voltage Divider & Load
/voltage-divider
7. Multimeter Trainer
/multimeter-simulator
8. RC & Oscilloscope
/rc-oscilloscope
9. 555 Timer Pulse Lab
/555-timer
10. Diode & Rectifier
/diode-rectifier
11. Transistor & Flyback
/transistor-switch
12. PWM Dimmer & Fan
/pwm-dimmer
13. Op-Amp Comparator
/opamp-comparator
14. H-Bridge & Shoot-Through
/h-bridge-motor
15. Buck vs LDO Power
/buck-converter
16. Digital Logic Gates
/logic-gates
17. Resistor Color Code
/resistor-color-code
18. ESP32 Pinout Guide
/esp32-pinout
19. Arduino Uno Pinout
/arduino-uno-pinout
20. Zener Voltage Clamp
/zener-diode-regulator
21. I2C Pull-Up Bus
/i2c-pullup-bus
22. Battery Life & Sleep
/battery-life-calculator
23. PCB Trace Width
/pcb-trace-width
24. Wheatstone Bridge
/wheatstone-bridge
25. Raspberry Pi GPIO
/raspberry-pi-pinout
26. WS2812B LED Strip
/ws2812b-led-strip
27. SG90 Servo PWM
/servo-pwm-control
28. HC-SR04 Ultrasonic
/ultrasonic-hcsr04
29. Opto Relay Module
/relay-optocoupler
30. 3.3V ⇄ 5V Shifter
/logic-level-shifter
31. 2N2222 Pinout
/2n2222-pinout
32. SMD Resistor Code
/smd-resistor-code-calculator
33. Distribution Board
/inside-distribution-board
34. Wire a 3-Pin Plug
/wire-a-three-pin-plug
35. Power Strip Overload
/power-strip-overload
36. RCD & Earthing Safety
/rcd-gfci-earth-leakage
37. Live & Neutral Wires
/mains-live-neutral
38. Inside an MCB Breaker
/mcb-trip-breaker-anatomy
39. Why Did It Trip?
/why-did-it-trip
40. Two-Way Staircase Switch
/two-way-staircase-switch
41. AC Transformer Core
/ac-transformer-step-down
42. Induction Hob & Eddies
/induction-cooktop-eddy
43. Kettle Bimetal Thermostat
/thermostat-bimetal-kettle
44. Rooftop Solar & Grid
/home-solar-inverter-grid
45. Common Ground Pitfall
/floating-ground-common-gnd
46. OLED SSD1306 I2C Lab
/oled-ssd1306-i2c-wiring
47. Stepper A4988 Vref Lab
/stepper-a4988-vref-calculator
48. 18650 & TP4056 Lab
/lipo-18650-tp4056-protection
49. DHT22 vs BME280 Lab
/dht22-bme280-sensor-wiring
50. Rotary Encoder & Bounce
/rotary-encoder-debouncing
51. Soil Moisture & Corrosion
/capacitive-soil-moisture-adc
52. ESP32 vs S3 vs C3 Lab
/esp32-s3-c3-pinout-comparison