Electronic – Rotary Encoder – Unexpected output

encodermicrocontroller

I'm seeing unexpected data on the A & B outputs of my ALPS incremental rotary encoder. The A & B pins are are attached to a microcontroller with pull-ups enabled and the centre pin is ground The pulses are aligned on their rising or falling edges rather than being 90 deg out of phase as I expected (and documented everywhere). Attached are two capture screenshots, one for clockwise the other anticlockwise rotation. Am I missing something?

Clockwise

Anticlockwise

Best Answer

You have, most likely, connected pin A or B to ground instead of C.

enter image description here

Figure 1. Encoder pinout. (Click to enlarge.)

enter image description here

Figure 2. (1) Encoder ABC. (2) Push-button pins.

Now that C is the centre pin.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 3. In (a) 'A' requires both switches to close before it will pull low. This will occur 25% of the time. 'B' just requires SW2 to be closed to pull low. This will occur 50% of the time.