Flipdigits are the mechanical version of the seven-segment numbers you commonly see on electronics such as dashboard panels and gas station pumps. Each digit has seven little plastic segments that can flip independently through an electromagnetic pulse. At the end of the flipdiscs guide I mentioned wanting to try a set, and AlfaZeta kindly sent us a box of panels to play with.
Contents
Build
Panels
We used 24 AlfaZeta panels, arranged four across and six high. Each panel holds seven digits across and four down, so the whole wall has 28 × 24 digits. That’s 672 digits, or 4,704 little pieces we can move independently. A pulse through a coil turns a magnet inside each segment and brings a white face into view. AlfaZeta’s panel and digit specifications
Here’s what a few panels look like running on my desk.
Testing the code with an early prototype
Frame
For the full wall, we went back to the 80/20 aluminum extrusions we used on the flipdisc build. The aluminum carries the panels and mounts to a birch frame. You can see the exposed rails in the early skull test further down. 80/20 framing
Cabling
These panels were easier to hook up than our old flipdisc boards. The stiffer plastic makes the panels easier to handle, but the segments are slightly louder when they flip. We could daisy-chain the data connections with RJ11 cables. We gave each column its own USB-to-RS‑485 adapter so that an update only has to travel through six panels on any one line. All four adapters run at 57,600 baud. Like our flipdisc panels, these update at around 50–60 frames per second.
If you’re using our config, it helps to trace one cable first. We numbered the panels left to right as we assembled the wall, but the cables run down the columns. From the back, the first chain is on your right. Its adapter talks to addresses 1, 5, 9, 13, 17, and 21. The layout tells the driver where a panel sits in the picture. The address list tells it which cable reaches that panel. Our layout and device configuration.
Power
We used a 24 V, 20 A Mean Well HLG-480H-24 for power. Our estimate was roughly 1 A per panel during fast updates. At that draw, flipping all 24 panels together would add up to 24 A, so the 20 A on our supply is worth keeping in mind if you’re sizing one for your build. Power supply datasheet
Software
Board
We could reuse the serial connection from the flipdisc project. What needed to change was the picture we sent over it. On the old display the driver packed a row of dot flips into bits. On this one, a byte describes all seven segments of a single digit. We rewrote our driver to support both display types. I like 1 and 7 as a first test because you only have to change one thing to tell them apart.
| Bit | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
| State | |||||||
| Weight | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
64 + 32 + 16 = 112 (0x70)
The upper-right segment is worth 32 and the lower-right one is worth 16. Send their sum, 0x30, and you get a 1. Add the top segment, worth 64, and the very same digit reads 7. Turn on all seven bits and you get 8, or 0x7F. For an immediate update the driver wraps 28 of those bytes in a panel frame like the one below. It starts with 0x80, then 0x83 and the panel’s address, and ends with 0x8F. That’s 32 bytes to change one whole board. Segment panel driver
Drawing across digits
We made a small Node library called flipdigit so we could draw lines, paths, text, and images in one coordinate system. To use it in your own project, install it with npm.
npm install flipdigit The idea of keeping separate images for the horizontal and vertical strokes came from Ksawery Kirklewski’s Processing work. His Flipdigits Player walkthrough is really fantastic.
Take the outline of a square. Its top edge can use the top, middle, or bottom segment of every digit it crosses. That gives us one horizontal sample across and three down per digit, or a 28 × 72 image for the wall. Now follow the right edge of the square. It can use either side of each digit, and each side is split in two. That gives us a different image, 56 × 48, for the vertical strokes. The canvas takes the wider dimension of one and the taller dimension of the other, so we get 56 × 72 drawing coordinates. At render time the driver picks three values from the horizontal image and four from the vertical one to make each digit byte.
To draw a line we round its endpoints and walk from one to the other using Bresenham’s algorithm. A step to the right writes to the horizontal image. A step down writes to the vertical one. When both coordinates change on the same step, we use the slope to decide which segment to flip. A line that travels six places across and two down flips horizontal segments on successively lower rows. Swap those distances and it flips vertical segments in neighboring columns. At exactly 45 degrees we use horizontal segments. That little decision is visible in a rotating wireframe. Line drawing code
Here is a basic example of drawing a square on the panel. The driver takes care of where one panel ends and the next one starts, so you can draw straight across the display.
canvas.clear()
canvas.drawRect(16, 24, 24, 24)
canvas.render()
We can fit a wireframe cube on one 14 × 12 panel. Draw two squares, then connect their corners. The driver skips the write if the frame hasn’t changed.
canvas.clear()
canvas.drawRect(1, 4, 7, 7)
canvas.drawRect(5, 1, 7, 7)
for (const [x, y] of [[1, 4], [8, 4], [8, 11], [1, 11]]) {
canvas.drawLine(x, y, x + 4, y - 3)
}
canvas.render()
Canvas documentation · Library and examples
Pictures and sprites
When we load an image, we fit the picture to the display, resize one copy for the horizontal segments and another for the vertical ones, and convert each copy to grayscale. By default we use Floyd–Steinberg dithering. When a gray sample rounds up to white, we pass its rounding error on to its neighbors. A patch of gray ends up as a mix of white and black segments. For a repeating 4 × 4 pattern, you can use Bayer dithering. We center the two results in their grid before packing the digits. Image and dithering code
Here’s how to draw a local image using Bayer dithering.
canvas.clear()
await canvas.drawImage('./photo.png', 'bayer')
canvas.render()
The display server also accepts a finished frame, which is handy for PIXI sprites like the Halloween skull. The driver samples that 56 × 72 picture twice using nearest-neighbor resizing. For the horizontal segments it reads every other source column. For the vertical segments it keeps every column and takes two samples per three source rows. Each sample with a luminance of 0.5 or higher turns its segment white. Segment display driver · Sampling code
Running scenes
For the installation we wanted camera experiments to live on the same wall. We already had a queue and a controller for the office flipdiscs, so we reused flipdisc-server. The entry point in flipdigit-display takes the same panel map and four serial devices as the square example. The only difference is selecting Panels.AlfaZetaSegmentPanel in the config to tell the driver how to turn a rendered frame into digit bytes.
import { Display, createServer } from 'flipdisc-server'
import { layout, devices, options } from './config/config.js'
Display.configure(layout, devices, options)
const app = createServer()
The drawings live in scenes/. Each file exports a scene and a schema for its controls. A scene like a metaball can render a Three.js mesh and hand the resulting image to the same driver. The scene makes it fairly straightforward to create new visuals, while providing the basic building blocks to get started. Scene and server documentation
Examples
Here are a few things we drew on the wall. The player runs through the same segment bytes we send to the panels.

Wireframe drawing code · Pyramid example
A wireframe pyramid on the assembled wall Original post
Halloween
In October we decided to put the display in our front window and turned it into a giant eyeball. If you walked past on the sidewalk, it would look over at you. We also drew a skull so we could try the same idea with two eyes. Here it is running on the bare frame while we were still working on it. Original installation post
An early skull test
It took some time to find a visual that people walking past could recognize at a glance. A spooky rotating skull seemed to fit the bill.
Drag across the skull to compare the source pixels with the segments they flip. Look at the narrow gaps between the teeth and then the wide white area around the eye socket.
In the app we called the scene Eyeball Tracker (scenes/eyes.js). A Python process reads the webcam with OpenCV and runs YOLOv8n on each frame. We look for people and bicycles. If two people walk by together, we follow whoever takes up the most space in the camera image. Python sends the center of that box and the size of the camera frame back to Node over ZeroMQ.
We draw the pupils separately from the sprite sheets for the eye and skull. The scene maps the camera position into the eye socket, reverses the horizontal direction to account for the viewer facing the window, and uses GSAP to move the pupil to its new position. The same coordinates drive both pupils on the skull. Every so often the scene chooses between the two faces.
The view of the Halloween display from the sidewalk
It’s been a few years since we put that giant eye in the window, and our neighbors still bring it up!

