What is a Rotary Encoder? – A Complete Guide

A Rotary encoder is a type of position sensor that converts the angular position (rotation) of a knob into an output signal that is used to determine what direction the knob is being rotated. They are employed in a variety of applications, including robotics, CNC machines, and printers, due to their robustness and fine digital control.

In this blog, we are going to discuss the basics of Rotary Encoder, Its Working, Types, Advantages, Disadvantages & Applications in detail.Let’s Get Started

What Is a Rotary Encoder?

Rotary encoders are sensors that convert rotational mechanical displacements into electrical signals and process them to detect location and speed. Rotary Encoders measure the number of rotations, the rotational angle, and the rotational position. 

The Angular position or motion of a shaft or axle is converted to analog or digital output signals by a rotary encoder, also known as a Shaft encoder. Absolute and Incremental rotary encoders are the two most common varieties. An absolute encoder is an angle transducer since its output indicates the current shaft position. An Incremental encoder’s output offers information on the shaft’s motion, which is often processed into information like position, speed, and distance.


  • The output is controlled based on the shaft’s rotational displacement.

Linking to the shaft using a coupling enables direct detection of rotational displacement.

  • Returning to the origin is not required at startup for Absolute Encoders.

With an Absolute Encoder, the rotational angle is output in parallel as an Absolute value. (Refer to Operating Principles below.)

  •  The direction of rotation can be determined.

With an Incremental Encoder, the rotation direction is defined by the output timing of phases A and B, while with an Absolute Encoder, the code increase or decreases. (For more information, see the Operating Principles section below.)

  •  From a variety of resolutions and output kinds, select the best Sensor. Choose the Sensor that best fits your needs.

Rotary Encoder Pinout

The pinouts of the rotary encoder are as follows:

rotary encoder module pinout
  • GND connection is used to connect to the ground.
  • VCC is the positive supply voltage, commonly 3.3 or 5 volts
  • SW is the output of an active low push-button switch. The voltage goes LOW when the knob is pressed.
  • DT (Output B) output is identical to the CLK output, however, it is 90 degrees behind the CLK. The direction of rotation can be determined using this output.
  • CLK (Output A) is the primary output pulse for determining the amount of rotation. Each time the knob is rotated by one detent (click) in either direction, the ‘CLK’ output goes through one cycle of going HIGH and then LOW.

How does Rotary Encoder Works?

Let’s look at the encoder in more detail and see how it works. The square wave pulses are generated as follows: As seen below, the encoder has a disc with equally spaced contact zones that are connected to the common pin C as well as two distinct contact pins A and B.

When the disc begins to rotate in steps, pins A and B will make contact with the common pin, resulting in the generation of two square wave output signals.

If we just count the pulses of the signal, we can determine the rotational position using any of the two outputs. However, we must analyze both signals at the same time if we wish to determine the rotation direction.

It is clear that the two output signals are 90 degrees out of phase with one another. The output A will be ahead of the output B if the encoder rotates clockwise.

Counting the steps each time the signal changes, from High to low or Low to High, we can see that the two output signals have opposite values at that time. In the opposite case, when the encoder rotates counterclockwise, the output signals have the same value. As a result, we can easily configure our controller to read the encoder location and rotation direction using this information.

Types of Rotary Encoder:

  • Absolute Encoder:

An absolute encoder maintains position information when power is removed from the encoder. When power is applied, the encoder’s position is immediately available. The relationship between the encoder value and the physical location of the controlled machinery is established during assembly, and the system does not require recalibration to maintain position accuracy.

An absolute encoder uses numerous code rings with different binary weightings to generate a data word that represents the encoder’s absolute position inside one revolution. A parallel absolute encoder is a name given to this sort of encoder.

Additional code wheels and gears are included in a multi-turn absolute rotary encoder. The fractional rotation is measured by a high-resolution wheel, while the number of entire revolutions of the shaft is recorded by a lower-resolution geared code wheel.

  • Incremental Encoder:
Incremental Encoder

An incremental encoder will notify changes in position instantly, which is a necessity in some applications. It does not, however, publish or track the absolute location. As a result, to initialize the position measurement, the mechanical system monitored by an incremental encoder may need to be moved to a fixed reference point.

Advantages of a Rotary Encoders:

  • Highly reliable and accurate
  • Low-cost feedback
  • High resolution
  • Integrated electronics
  • Fuses optical and digital technology
  • Can be incorporated into existing applications
  • Compact size

Disadvantages of a Rotary Encoder

  • Subject to magnetic or radio interference (Magnetic Encoders)
  • Direct light source interference (Optical Encoders)
  • Susceptible to dirt, oil and dust contaminates

Applications of Rotary Encoders:

An encoder can be used in applications requiring feedback on position, velocity, distance, etc. The examples listed below illustrate the vast capabilities and implementations of an encoder:

  • Assembly Machines
  • Packaging
  • X and Y Indication Systems
  • Printers
  • Testing Machines
  • CNC Machines
  • Robotics
  • Labeling Machines
  • Medical Equipment
  • Textiles
  • Drilling Machines
  • Motor Feedback


Hope this blog helps you to understand the basics of Rotary Encoder, Its Working, Types, Advantages, Disadvantages & Applications. We, MATHA ELECTRONICS will come back with more informative blogs.

Leave a Reply

Your email address will not be published.