[<< return to quirkfactory]

Single Track Absolute Encoder

Single-Track Absolute Encoder is a do-it-yourself (DIY) absolute shaft encoder (rotary encoder) utilizing a single-track Gray encoding. It can be used to measure angular movement (for joints in robotic constructions, for example).

How-To Guide

  1. Making the Sensors
  2. Laying out the Board
  3. Create Plastic Strips
  4. Gluing the Sensors
  5. Making the Encoder Disk
  6. Final Assembly


I decided to build an absolute optical encoder for a robotics project. An absolute encoder has advantages over designs that use potentiometers and incremental encoders, and I wanted to take advantage of those.

The final construction is a 7-bit encoder measuring 8 inches (20cm) on each side, capable of resolving angular changes in approximately 3 degree increments.

Gray Encoding

Optical encoders often make use of Gray encoding, which reduce the possibility for positional ambiguity by changing the state of only one sensor for each shift in angular position.

A straightforward approach is to lay the gray code pattern out in a circular pattern as shown in this 5-bit example. Optical sensors can then be positioned so as to detect the black/white patterns in the disk.

This method requires careful alignment of a series of optical emitters and receivers, which either shine through (or reflect off) the encoding pattern.

Single-Track Encoding

A variation of Gray encoding called single-track Gray codes aligns the encoding patterns on the outer edge of a disk. The patterns are arranged such that the sensors detect unique patterns when placed at equal angles around the edge of the disk.

This has several nice properties:

  • angular error is minimized at the outer radius of the disk
  • pre-aligned emitter/detector pairs may be used, simplifying construction

Other Work

See this nice Optical Encoder Project page by Piotr Mitros which has a nice compact design for an incremental (not absolute) encoder.
Copyright © 1990-2024  quirkfactory.com. All rights reserved.
Contact The Head Quirk