The rotary encoder is a rotation sensor whose direction and angle can be known. Similar in appearance to the potentiometer, the encoder has no limit t

Using a Rotary Encoder with Arduino

submited by
Style Pass
2021-03-18 03:49:54

The rotary encoder is a rotation sensor whose direction and angle can be known. Similar in appearance to the potentiometer, the encoder has no limit travel and instead of returning a resistance value, like the potentiometer, the encoder returns two digital signals representing direction and rotation. With the appropriate algorithm, it is possible to recover the state of these two contactors and to find its position. The rotary encoder is sometimes coupled with a push button which is useful when you want to create an interface.

The rotary encoder has two contactors, one which closes or opens depending on the direction of rotation; the other, opens and closes when the axis of the encoder is turned. Knowing this, an encoder sends two digital signals (HIGH or LOW state), one to recover the direction and the other to measure the angle of rotation. The number of state changes in a revolution varies according to the resolution of the potentiometer.

A sensor which returns a digital signal is preferably connected to the digital inputs of the microcontroller. The rotary encoder has 3 output pins: one for push button (SW) and two for direction (DT) and rotation detection (CLK).

Leave a Comment