Demonstrating Gray Codes With Industrial Display


The media in this post is not displayed to visitors. To view it, please log in.

Many people base huge swaths of their lives on foundational philosophical texts, yet few have read them in their entirety. The one that springs to the forefront of many of our minds is The Art of Computer Programming by Donald Knuth. Full of many clever and outright revolutionary algorithms and new ways of thinking about how computers work, [Attoparsec] has been attempting to read this tome from cover to cover, and has found some interesting tidbits. One of those is the various algorithms around Gray Codes, and he built this device as a visual aid.

Gray Codes, otherwise known as reflected binary, is a way of ordering an arbitrarily large set of binary values so that only one bit changes between any two of them. The most common place these are utilized is in things like rotary encoders, where it provides better assurance that the position of a shaft is in a known location. To demonstrate this in a more visual way [Attoparsec] hooked up an industrial signal light, normally used for communicating the status of machinery in a factory, and then programmed it to display the various codes. A standard binary counter is used as a reference, and it can also display standard Gray Code as well as a number of other algorithms used for solving similar problems.

[Attoparsec] built this as an interactive display for the Open Sauce festival in San Francisco. To that end it needed to be fairly rugged, so he built it out of old industrial equipment, which is also a fitting theme for the light itself. There’s also a speed controller and an emergency stop button which also add to the motif. For a deeper dive on Gray Codes and their uses, take a look at this feature from a few years back.

youtube.com/embed/Z9X3dH5LjrM?…


hackaday.com/2026/03/25/demons…