Brigadoon - An Occasional Corner on the Internet
360° Rotation Rotary Encoder
Designed by Mark Little
 
The 360° Rotation Rotary Encoder sends out a data pulse stream when the dial is turned clockwise or anti-clockwise. This device has three outputs. The SW output connects to a normally switch that closes if the shaft is pushed down. The Encoder A (Clk) and Encoder B (DT) pins determine which way the shaft is being rotated.

The sensor has 12 indents, meaning that the movement is detected approxinately every 30° of rotation.
The direction of the rotation can be determined by which Encoder Output changes first.

If the Encoder A Output changes state before the Encoder B Output, the switch is rotating in a clockwise direction.
If the Encoder B Output changes state before the Encoder A Output, the switch is rotating in an anti-clockwise direction.