Hacker Development

Arduino Kit Information: Rotary Encoder

Back to Kits list

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:
  A   Com   B
      o   o   o
  O              O   (Mounting Tabs)
       o     o
  PB0      PB1

B & B are encoder data outputs.
Com is the common terminal.
PBO & PB1 are Push Button switch terminals.

Rotary Encoder Output Waveforms

The output of the encoder rotating clockwise is as follows:

  • A   B
  • 0   0
  • 0   1
  • 1   1
  • 1   0

The output of the encoder rotating counter-clockwise is as follows:

  • A   B
  • 0   0
  • 1   0
  • 1   1
  • 0   1

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

Back to Kits list





Hackers' Notebook Forums   Hackers' Warehouse