A Little History
Quadrature encoding predates digital electronics. It's a mechanical trick for telling rotation direction from two sensors instead of one. Industrial tachometers and rotary encoders have used it for decades. It became a household technology (literally) inside the opto-mechanical computer mouse: a rubber ball turning two small wheels, each interrupting a pair of light beams slightly out of phase with each other. That's exactly the same signal shape you'll see on the QUAD header.
What It's Actually For
Measuring rotation, both direction and amount, without an absolute position sensor. A single square wave from a spinning shaft tells you how fast, but not which way. Add a second channel offset by a quarter cycle, and the order the two edges arrive in tells you the direction, while simply counting edges tells you how far it turned. It's still the standard way rotary encoders report motion today, in volume knobs, motor shaft feedback and old-school mice.
How It Works
Two channels, A and B, run the same square wave frequency, offset by a quarter period (90°). Whether A leads B or B leads A depends on which direction things are turning. Reverse the rotation and the two channels swap which one leads. On the sniffer board this relationship is fixed and just keeps repeating; there's no rotation to reverse, it's simply here as a known-good pattern to test against.
On the Sniffer Board
| Pin | Connects to |
|---|---|
| A | Logic analyzer channel D0 |
| B | Logic analyzer channel D1 |
| Logic analyzer GND wire |
In PulseView: 1 MHz sample rate, 20 k samples (that's 20 ms), then click Run. You should see two clean square waves at 1 kHz, with B trailing A by a quarter period.
- Only one square wave? Switch the board off and check that the D0 and D1 wires are pushed all the way onto A and B.
- B leads A instead of lagging? The D0 and D1 wires are swapped. Switch off and swap them.
- Noise or nothing at all? Check the ground connection first. It's the most common miss.