Encoder: the sensor that counts turns and angles

An encoder is a sensor that turns rotation or movement into a digital signal: it shows the angle of rotation, the number of turns, speed and direction.

An encoder counts marks on a spinning disc

In plain words

Remember counting steps so you would not lose track in the dark? An encoder does the same for a motor: it counts "steps" - tiny marks on a disc that turns with the shaft. Knowing the number of "steps", the robot knows exactly how far the wheel or joint has turned.

How it works

  1. A disc with marks - slots, magnets or stripes - is attached to the motor shaft.
  2. A sensor (optical or magnetic) detects the marks as they pass.
  3. Each mark is a pulse: the number of pulses gives the angle, and their frequency gives the speed.
  4. Two sensors slightly offset from each other show the direction of rotation.
  5. Absolute encoders know the exact position straight away; incremental ones count from a starting point.

An encoder in a robot's wheel measures distance travelled

Where you'll see it

Robot joints, robot vacuum wheels (to measure distance travelled), 3D printers and machine tools, computer mouse wheels, volume knobs on audio gear and car steering wheels.

Does it matter when buying

Not for buying - it is a hidden part. But in robotics, encoders are the basis of precision: without them a robot does not know where its "hand" is or how far it has driven. In learning projects, motors with encoders make driving in a straight line much easier.

Myths

  • Myth: An encoder is something complex and expensive. Reality: The simplest ones cost next to nothing and are even in your mouse.
  • Myth: An encoder moves the motor. Reality: No, it only measures movement. The actuator does the moving.

FAQ

How is an absolute encoder different from an incremental one?

An absolute encoder knows its position right after power-on; an incremental one only relative to the start.

What is encoder resolution?

The number of pulses per turn - the higher, the more precise.

Does a robot vacuum have encoders?

Yes, in the wheels - they help measure distance travelled and build the map.

Related terms

Servo motor, Actuator, Autonomous navigation, Inertial measurement unit (IMU)

← Glossary