Skip to content

DigitalOsc guides

Rotary Encoder Counts Backwards: Compare A and B

DigitalOsc editorial team · Updated 19 November 2026

Use A/B phase order to diagnose a swapped pair or a noisy transition on a manual quadrature encoder.

Use two named lines

With a manual low-voltage quadrature encoder on a test board, identify channel A, channel B and the shared reference from the schematic. Check the intended input bias; some encoders are switches and require pull-ups. Turn the shaft slowly in one marked direction. Record both traces through at least two changes; a single stationary reading cannot establish direction.

Write the state order down

For an example with bits written A then B, a stable sequence might be 00, 01, 11, 10, 00. The other direction should reverse the order on the same unit and wiring. That example does not define universal clockwise wiring. If the traces are clean but the firmware direction is swapped, check labels, pin mapping and the convention used by the decoder.

Separate chatter from reversed order

If several fast transitions appear at one detent, compare the stable order with what the decoder counts. Inspect pull-ups, connectors and debounce before remapping software. If only one line moves, follow the quiet line first. A logic analyser can help once you need a longer state record; start with two traces if voltage and contact behaviour are the question.

Useful next steps

References