Hacker DevelopmentArduino Kit Information: Rotary Encoder |
Rotary Encoder A Rotary Encoder is a digital version of a potentiometer, but it has no drift and can be turned continuosly. The Rotary Encoder included with the kit also has a push button activated by pressing the knob. The Rotary Encoder has 5 electrical legs and two mounting tabs. The two legs are the push button and the three are the Gray Code Outputs. In this image you can see the mounting tab and the two legs for the push button. The center leg on the other side is the common and the other two outside legs are the data pins. Pinout: B & B are encoder data outputs. The output of the encoder rotating clockwise is as follows:
The output of the encoder rotating counter-clockwise is as follows:
The Rotary Encoder is just a switch so you must add pullup/pulldown resistors or enable the internal pullups in your processor. A sample Sketch for the Arduino is available in the Hackers' Notebook forums at Rotary Encoder |