Incremental Rotary Encoder Wiring
ROTARY ENCODER CIRCUIT DIAGRAM, SERIES SPECIFICATIONS CONNECTIONS CAUTIONS
Heidenhain Encoder Wiring Diagram
Wiring the Rotary Encoder with Arduino
In this code, we are detecting two changes per period of the wave.
So here is a little example of how it works: For a clockwise rotation 1.
The power ground should be connected to an external power source do not use the internal Raspberry Pi power pin.