Arduino Rotary Encoder Pinout Wiring
Rotary Encoder Pinout is an electro-mechanical instrument that converts rotational motion into analog or digital information. Apparently, it seems like a potentiometer however it has turning capability in both clockwise as well as counter-clockwise directions up to an infinite extent. In this article, we will see Arduino rotary encoder wiring.
Rotary encoder Pinout is of several types. Two main types include relative (incremental) and absolute encoders. The output of the absolute encoder is a value proportional to the current shaft angle while the incremental encoder’s output is a step of the shaft and its direction.
Principle Of Encoder:
The rotary encoder has 5 pins; three of them are on the encoder side while two are on the click button side.
The two (1 & 2) pins are actually pushed buttons where 1 is grounded and 2 acts as a switch while on the encoder side the corner pins (3 & 5) are connected to the Arduino board whereas the middle pin of the encoder is grounded.
With a total of 5 pins, 3 on one side for rotary encoding which needs a simple circuit to supply DC 5V while the other two go short whenever pressed, you’re not short of any functionality when using this.
However, when the rotary encoder is mounted on the breakout board, all five pins are available on the same side. The pictorial comparison is given below.
Arduino rotary encoder wiring is the most important of this, therefore we have shown below rotary encoder pinout wiring clearly to easily understand wiring:
The rotary encoder has 5 pins total. Three are for the rotary encoder and two are for the button switch. The rotary encoder pins are A, C (common ground), and B, in that order when the rotary encoder is upright, i.e. oriented so the three pins are facing you.
We’re going to be using both the rotary encoder and the push button switch for this guide. The following wiring diagram shows wiring up the rotary encoder to the ItsyBitsy to match the code example.
You can wire it however you like to your CircuitPython Express board – just remember to also update the pin #’s in the code: