Introduction: Fibonacci Mondrian Clock

Yes, it's a clock! Can you guess what time it's showing? (time shown in the first picture revealed at the end)

This clock is disguised as a Piet Mondrian painting and tells the time using a modified Fibonacci binary sequence. It works like a binary clock so you have to add up the values of the squares that are coloured to get the hours and minutes.

This is a remake of something I came up with 10 years ago in high school when I was so bored by my biology lessons that I started doodling a fibonacci based binary sequence. At the time I made it into a laser cut spiral with LEDs on it powered by an arduino, which has since broken and I haven't gotten round to fixing.

A couple years ago I had the idea to remake this project but make it look like a Mondrian painting, since you can creates a spiral of squares using the Fibonacci sequence for the size of the squares, and sticking to primary colours it can give the idea of Mondrian's famous abstract paintings. I first tried to over-complicate it by using thermochromic pigments to paint a canvas and custom sized heating pads to turn them "on" and "off", but ran into issues controlling the pads fast enough for it to work.

More recently I got renewed energy to make it work again and started looking at LED panels as a way to achieve the same effect, with the idea of diffusing the lights onto some paper. This snowballed into me buying a 3D printer to achieve this, but I'm pretty happy with the result!

The more poetic take on this clock is that it makes it very difficult to tell the time, even though all the data is there, and the shape could be enough of a hint to be able to decode it without prior knowledge (only one friend of mine has managed that feat so far). Maybe something about showing time as an abstract concept by disguising it as abstract art...

Step 1: How Does It Work?

First consider binary code, with which you can represent any integer as a sequence of 0s and 1s, which from right to left represent the sequence of the powers of 2.

Now replace the sequence of the powers of 2 with the Fibonacci sequence, dropping the first 1, and that results in a new binary code. Note that there are multiple ways to represent each number, but I went with always picking the largest numbers in the sequence first.

This is similar to the existing fibonacci coding, but reversed and a little simpler.


Fibonacci numbers can be used to create a spiral by joining quarter circles of radii of the Fibonacci sequence. I just used the enclosing squares of Fibonacci size to create the basis of my clock. For the hours side, I used the squares up to 21 (max 24 hours), and for the minutes I used the squares up to 34. I didn't want to have the largest square be 55 as it would only be used for 4 minutes every hour, so numbers 55 to 59 can use 21+34 as a replacement.

Putting those two spirals side by side gives a 55x55 size design, with a spare 21x21 square left blank. LED panels come in sizes like 32x32 or 64x64, so using a 64x64 matrix made the most sense. Adding an even 4-wide border around the clock part makes for a 63x63 grid, so just one row and one column of LEDs will remain unused.


The way I programmed it is so that a square should be off (0) it's white, and if it should be on (1) it's coloured. Also, I chose to light up both 1-size squares when one should be on, so it should only be counted once.


The video shows a sped-up version of what the clock would look like from 12:00 to 13:30.

Step 2: BOM

1) LED panels: 4x 32x32 6mm pitch RGB LED Matrix Panel from Pimoroni (also from Adafruit)

2) Controller: Interstate 75 W from Pimoroni

3) Power supply: Random 5V 200W power supply I had on hand, though 20W is more than enough

4) Frame: Made to measure box frame from picture-frame-express, with a mount (418x418mm frame with 378x378mm 20mm white mount)

5) Diffuser: Transparent tracing paper from Amazon, layered up multiple times

6) 3D prints:

  • Joins to attach the LED panels together
  • Diffuser spacer (in white)
  • Front outline (in black)
  • Frame spacers

7) Extra bits like a terminal block, wire, M3 screws

Step 3: Join the Panels

To join the panels rigidly together I printed some joins to use the existing M3 threaded holes in the panels (I found the technical drawing for the panels to get the spacing right).

Display Joins

Step 4: Assemble the Electronics

This couldn't be much easier thanks to the cables that were included with the LED panels from Pimoroni, and the Interstate 75 W just plugs into the back of one of the panels.

I connected the data cables of the panels in a spiral, I think they are designed to have one controller per row really, and the firmware is designed that way too, but I overcame that with code, see later step going over the code.

For the power wiring, I used a terminal block to make use of the existing spade connectors on the included cables. This could be neater but works.

Step 5: Create the Diffuser

I wanted to diffuse the light from the panels so you couldn't see individual LEDs, which meant leaving space for the light to diffuse, then adding a translucent layer on top. To ensure the light doesn't bleed between the squares I designed a 3D-printed diffuser spacer that bounds each square, and printed it in white so the light can reflect on it. I added some hooks so it attaches to the panels easily, and I had to break it up into 4 pieces to fit on my printer, so I used some puzzle joins to connect them.

Diffuser Spacer

Step 6: Top Layer and Black Outline

My frame came with a 2mm plexiglass sheet, which I added 3 layers of tracing paper behind, and then to add the black outlines of the squares I printed a very thin black layer in the same shape as the diffuser. I printed it in 4 pieces and joined them using a 3D pen to weld some joins between the pieces.

Step 7: Spacers

Since the 64x64 panel needs to be offset to center the 63x63 design, I printed some spacers to snugly fit at the corners between the panels and the frame.

Frame spacers

Step 8: Assembly

Putting everything together into the frame, the layers are:

  • White mount
  • Plexiglass sheet
  • Black 3D-printed outline
  • 3 layers of tracing paper
  • 3D-printed diffuser spacer
  • LED panel assembly
  • 3D-printed frame spacers
  • MDF backing board

Step 9: Code It Up

Find all the code on my github: https://github.com/arturoabruzzini/fibonacci_mondrian

Pimoroni provides micropython firmware for the Interstate 75 W (See their guide), but their PicoGraphics library only supports this panel joined up 4 times in a 128x32 matrix. and since I basically flipped two of the panels upside down when wiring them, I ended up writing the code so that everything is drawn twice, once for the first two panels, and then inverted to cover the remaining two.

To prototype I also used a Jupyter notebook with matplotlib to see what the result would look like quickly.

The Interstate 75 W is based on a Pico W, so I used Wifi to sync the correct time, then just draw a bunch of squares to represent the hours and minutes with primary coloured squares and leave the rest white. There are a couple of coloured sections on the border as well that stay static.

I played around with having a seconds ticker around the border, but I felt it distracted from the design, I like the mystery of it only changing once per minute, so at first glance you wouldn't even guess it's a clock. I will likely play around with adding a fun animation on startup, and maybe eventually extend the onboard buttons to somewhere on the frame, so I can control any other functionality I might add.

Step 10: Rounding It Up

By now you might be able to tell that the time in this picture is 18:40

Thanks for reading, let me know if you have any questions. Happy making!

Colors of the Rainbow Contest

Participated in the
Colors of the Rainbow Contest