A rotary encoder converts shaft rotation into electrical pulses. The quadrature output (two 90°-phase-shifted signals A and B) allows a microcontroller to determine both direction and speed of rotation.
| Supply voltage | 3.3 – 5 V |
| Resolution | 20 PPR (pulses per revolution) |
| Output | Quadrature A, B + push switch |
| Max speed | ∼ 600 RPM |
| Switch life | 50,000 cycles |
| Package | 5-pin module with shaft |
Two offset Hall sensors or optical interrupts produce signals A and B, each 90° out of phase. If A leads B, rotation is clockwise; if B leads A, it is counter-clockwise. Counting edges gives absolute position; edge rate gives velocity.
Incremental — loses position on power cycle (add battery backup or home on startup). Requires interrupt pins or fast polling to avoid missed pulses at high speed. Mechanical encoders suffer from switch bounce.