Building the Fibonacci clock with SK6812 or WS2812 colour LEDs

Fibonacci wand

Back to start  Dutch version

The Fibonacci clock was a kick starter project of Philippe Chrétien.
What make this idea so beautiful is it simplicity, its ingenuity and the ever changing Mondriaan look alike display. Mondriaan searched and reached his ultimate simplicity in his paintings from realism to cubism and finding presenting his portraits and landscapes in primary colours and rectangles.
But a clock? Fibonacci?

fibonacci-12h Lay-out

Red+Blue = hour, (Yellow+Blue)*5 = minutes.

5 + 3 = 8 hours, 1 + 3 = 4, 4 x 5 = 20 minutes
It is 8:20

That's all that is inside.

Fibonacci was Italian mathematician and he described a number sequence. This was not just a number sequence but it appears in many biological settings, like sunflowers and shellfish. The sequence is simple. To get the next number in the sequence just add the previous ones. So: 1, 1, 2, 3, 5, 8.
If we add all the numbers in the example we get 12. Now we can present the time in hours with these number from the example.
Lets say it is 4 o'clock. That is: 1+1+2 or 1+3.
Lets say it is 8 o'clock. That is: 1+1+2+4, or 1+3+4 or 3+5 or .... and so on
What the clock does is turning on the light of the numbers to add.
For example: The 3 and 5 with the colour red to display 8 hours.
An hour is 60 minutes and that are twelve parts of 5 minutes. 
So 26 minutes = 26 / 5 is the fifth part. Five can be added up in several ways; 1+1+3 or 1+4 or 2+3 or 5. So the clock turns yellow lights on for lets say, the 2 and 3.

Now we have a problem; the three can not be red and yellow at the same time? Yes it can, we will give this a colour blue.
All the other, not used numbers, will be turned on with white light.
Confusing? That is why the clock keeps you and your visitors busy for a long time.
Fibonacci clock
Another time display:
3+2 red + 5 blue = 10 hour.
1 yellow + 5 blue = 6 * 5 = 30 minutes. The time is between 10:30 - 10:34

Of course we can use other colour themes but the Mondriaan theme is a attracting one. In the software some other palettes are available
The casing building blocks

First make the case. In this example a case of 10 x 10 x 20 cm.
Then the light compartments and the ground plate on which the colour LEDs are glued.
The inside of the compartments should be pure white to avoid colour bleeding in the display. 




You can use this Fritzing design but the clock can easily be made without it

PCB V014

Arduino Nano    
PCB for Fibonnacci-klok

 Fritzing PCB V014
1 x RCT DS3231 Precision clock module ZS-042  
1 x CR 2032 3V lithium battery  
1 x Dupont-kabel F-F, 20-wires  
2 x 6-pin female socket connector  
1 x  KY-040 Keyes Rotary Encoder  
1 x light sensor  
1 x 22kΩ resistor  
1 x 1000 µF capacitor  
1 x 470Ω + 1.1kΩ + 2.2kΩ resistor  
1 x Power supply 5V DC 2 Ampere    
1 x 50 cm black-red power wire (0.14 mm2)    
1 x set schrink tube 20 cm x 1.5 mm diam + 10 cm x 5 mm diam  
12 LEDs WS2812B or SK6812  
Wireless Serial 6 Pin Bluetooth RF Transceiver Module HC05 (Android, W10    
Wireless Serial 6 Pin Bluetooth RF Transceiver Module HM10 (voor Iphone, IPad)    
DCF77 DCF-2 module  

4x3 membrane keypad

Voorkant fibinacciklokAchterkant Fibinacciklok

If a 4x3 keypad is used the 7 connection can be connected to pin 6 - 12 on the Nano.
If you look at the top of the keypad the wire below # is connected to pin6.

Bluetooth met de HM10 BLE voor Apple IOS en Android

With a HM10 BLE module the clock can communicate with Apple IOS en Android.

Install on your iPhone the app "BLEserial HM-10", "BLESerial Pro" or the free "BLEserial tiny" (App store).


Serial Bluetooth Terminal  from Kai Morich works fine as terminal.

Connect with "Serial Bluetooth Terminal" to start communication.
After connection with the clock time and light intensity is transmitted every 30 seconds.
With the commando: I of i a menu with possible commands is transmitted and displayed in the terminal of the app.

More info about Bluetooth here


The last stable version. Source code V038

Older simple version  Source code V007

All on Github 

Used libraries

#include <Encoder.h>             //
#include <Wire.h>                // Default Arduino library
#include <RTClib.h>              // 
#include <EEPROM.h>              // Default Arduino library To store data in EEPROM
#include <TimeLib.h>             // Arduino library Time by Michael Margolis   
#include <Adafruit_NeoPixel.h>   //   for LED strip WS2812 or SK6812
#include "Adafruit_Keypad.h"     //                       
#include <SoftwareSerial.h>      // Arduino library for HC12 or Bluetooth

Libraries in ZIP

FibonacciKlok_V007 (Als zip file)

Oudere versies

Fibonacci Versie 16. (As ZIP-file) This version works with the Arduino Nano and a Bluetooth module.
With the #defines options in the source code, like a DCF77 receiver, can be turned on or off

Light weight library to control WS2811/WS2812 based LEDS and LED Strings for 8-Bit AVR microcontrollers.

If link is broken the library from my place

Ed Nieuwenhuys,

11 juli 2022

10 mei 2022, 15 december 2019 29 april 2019, 29 October 2018