The Fibonacci Clock

206K1.1K172

Intro: The Fibonacci Clock

UPDATE: This project has been successfully funded on Kickstarterand is now available for sale at http://store.basbrun.comThank you to all those who supported my campaign!

I present to you the Fibonacci Clock, a clock for nerds with style. Beautiful and fun at the same time, the clock uses the famous Fibonacci sequence to display time in a brand new way.

STEP 1: How Do I Tell Time?

The Fibonacci sequence is a sequence of numbers created by the Italian mathematician Fibonacci in the 13th century. This is a sequence starting with 1 and 1, where each subsequent number is the sum of the previous two. For the clock I used the first 5 terms: 1, 1, 2, 3 and 5.

The screen of the clock is made up of five squares whose side lengths match the first five Fibonacci numbers: 1, 1, 2, 3 and 5. The hours are displayed using red and the minutes using green. When a square is used to display both the hours and minutes it turns blue. White squares are ignored. To tell time on the Fibonacci clock you need to do some math. To read the hour, simply add up the corresponding values of the red and blue squares. To read the minutes, do the same with the green and blue squares. The minutes are displayed in 5 minute increments (0 to 12) so you have to multiply your result by 5 to get the actual number.

Often, there are multiple ways to display a single time. To add to the challenge, the combinations are picked randomly from all the different ways a number can be displayed. There are, for example, 16 different ways to display 6:30 and you never know which one the clock will use!

STEP 2: Circuit

I built the Fibonacci clock using an Atmega328P micro-controller using Arduino. You could buy an Arduino board and a DS1307 real-time clock break-out board and build a custom shield for your circuit but I preferred to build my own circuit board. That allows me to keep size small and price low.

STEP 3: Buttons

The three buttons attached to Arduino pins #3,#4 and #6 are used together to change time. Button on pin #3 can be used alone to change the color palette of the LEDs. An extra button is attached to pin #5 to change between different modes of the clock. Two modes are lamp modes and the default mode is the clock. All buttons are connected to the Arduino pins with a 10K pull-down resistor in parallel.

STEP 4: Real-Time Clock

The real-time clock chip DS1307 is connected to the Arduino analog pins 4 and 5 with two 22K pull-up resistors. The clock pin 5 (SDA) is connected to the Atmega328P pin 27 (Arduino A4) and the clock pin 6 (SCL) is connected to the Atmega329P pin 29 (Arduino A5). To keep time while unplugged the DS1307 chip needs a 3V battery connected to pint 3 and 4 of the chip. Finally, the real-time clock is driven by a 32KHz crystal connected on pins 1 and 2. A 5V power is applied on pin 8.

STEP 5: LED Pixels Strip

I am using LED pixels built on top of the WS2811 drivers. These microcontrollers allows me to set the color of each individual LED with a single output on the Arduino microcontroller. The Arduino pin used to control the LEDs in this project is pin #8 (Atmega328P pin #14).

STEP 6: Microcontroller

You will find all the details on how to connect the Atmega328P to make an Arduino clone on my post “Build an Arduino Clone“. I added a new feature in this project, an FTDI port to program your Arduino microcontroller directly on this circuit. You connect pin one to the reset pin of the Arduino trough a 0.1uF capacitor to synchronize your uploader with the chip bootup sequence.

Pin 2 (RX) of the FTDI port connects to pin 3 of the Atmega328P(Arduino 1-TX) and pin 3 (TX) of the FTDI connector connects to pin 2 of the Atmega328P (Arduino 0 – RX). Finally FTDI pin 4 goes to 5V and 5 and 6 to ground.

STEP 7: The Enclosure


The video presents all the steps for the construction of the Fibonacci clock enclosure. The idea is to create 5 square compartments in the clock, two inches deep, matching the size of the five first terms of the Fibonacci sequence, 1, 1, 2, 3 and 5. The LEDs are distributed in all squares and connected in the back of the clock to the circuit board.

The enclosure is built out of birch plywood. The frame is 1/4″ thick and the back panel is 1/8″ thick. The separators are 1/16″ thick and can be made of any opaque material. The dimensions of the clock are 8″x5″x4″. The front of the clock is a piece of 1/8″ thick semi-transparent plexiglass. The separators are marked using a Sharpie pen.

The wood finish is a water based varnish applied after a good sanding using 220 sand paper.

STEP 8: Make It a Lamp


The Fibonacci clock can also be converted into an ambiant lamp! The code published already support two lamp modes. Simply push the mode button to toggle between the three modes. The code is open for you to hack, feel free to implement your own modes!

STEP 9: You'r Done

You are done! The Fibonacci clock is a fantastic discussion starter...bring it to your next NERD get together or to the Christmas family reunion!

Thanks for reading/watching!

STEP 10: The Code

You can find the source code on my github account:

https://github.com/pchretien/fibo

135 Comments

Hola! lo primero, muchas gracias Basbrun por este fantastico diseño, tengo relojes digitales, binarios de péndulo y me faltaba uno tan original como tu " Fibonacci Clock".
Aunque ya lo tengo funcionando al principio no me contaba bien, en vez de incremetar los minutos incrementaba las horas ¿? con los pulsadores si funciona bien.

Para que el incremento de los minutos y horas funcione bien he tenido que cambiar las siguientes lineas de comandos:
// setBits(hours, 0x01); // antes NOK
setBits(hours, 0x02); // despues OK
// setBits(minutes/5, 0x02); // antes NOK
setBits(minutes/5, 0x01); // después OK
A mí me funciona, aunque no entiendo muy bien de programación, lo dejo aqui por si a alguien le pasó lo mismo y esto le puede ayudar.

Muchas gracias de nuevo, estoy muy contento con este diseño!!

Saludos J. Torres
Hi! I'm planning to build a version of this using a raspberry pi and a partially built grandmother clock frame - I wonder if you might be able to post a txt file of the code? I can't seem to find a program to open the files on GitHub.

Love this project, and can't wait to get stuck into mine...
Can this be done using a NodeMCU micro-controller?

Hi, awesome project! I'm working on making it with an ESP8266 and an HTML UI for the time / mode / palettes setup.

I'm analysing your code (from your git repo) and I was wondering why you do a division by five in the setTime function:

if (oldHours == hours && oldMinutes/5 == minutes/5) return;

Wouldn't it be the same as the following?

if (oldHours == hours && oldMinutes == minutes) return;

Thanks a lot for opening your code, blueprints and schematics!

> if (oldHours == hours && oldMinutes/5 == minutes/5) return;
> Wouldn't it be the same as the following?
> if (oldHours == hours && oldMinutes == minutes) return;

Answering to myself haha, this is not the same as we are comparing bytes, not floats.
The first line would be true for each multiple of 5 minutes while the second would be true for each minute.

That's smart! =)

Also, why don't you use internal pull-up resistors instead of adding pull-down resistors? This would save you space and money ;)

I am trying to build the fibonacci clock, I have already bought all the components excepct the case and the pcb. I want to order the pcb but I have big problems in the specifications because I can not see this information in the fritzing program. The fabric ask me for this specifications for my order:

material: normal FR4 board / aluminium board / blind vias board ?

fr4-tg: tg130-140/ 150-160 / 170-180 ?

thickness: from 0.4 to 2.4 mm ¿1.6?

min track/spacing: 4/4mil, 5/5mil, 6/6mil ?

min hole size: 0.2mm, 0.25, 0.3 ?

surface finish: HASL with lead, HASL lead free, inmersion gold, hard gold ?

via process: tenting vias, plugged vias, vias no covered ?

finished copper: 1 oz Cu, 2,3, 4 ?

Somebody can help me, please?

What a neat idea! I'm not a HW guy, more of a SW person. Really like the way blue functions as a double signifier, for hours and minutes, in order to permit two seperate tallyings from 0 to 11 on the clock. But I think it needs a third tally, some mechanism to get in all the minutes from 0 to 59 onto the display.

Thought of two approaches to this.

First thought was to add a third signal to the display which basically counts from 0 to 4, incrementing every minute. This signal would tell how many single minutes to add to the calculated time based upon the previously existing two tallies. My idea would be to arc counter-clockwise from the single 1x1 cell which is strictly in the interior of the fibo rectangle, i.e the one without any exterior edges. That (interior) 1X1 cell would indicate: 0 added minutes. The other 1X1 cell directly north of it (moving counter-clockwise) would indicate: 1 added minute. The 2X2 square would indicate:2; and the 3X3 square would indicate:3; finally the 5X5 square cell would indicate: 4 added minutes.

How to distinguish which of the five cells are "on" in order to know how many single minutes to add? I suppose color saturation. Normally, I'd envision all colors to be muted for the other two tallies (hours and 5-minute intervals). The one brighter square would give the number of added minutes. If some sore of analog(?) design could be used to give a gradual shading depth during the course of 60 seconds, then you could even build in a rough visual signal about how far along within the course of a given minute the current time is. This would make for a more living, constantly subtly changing clockface.

What do you think?

The second idea I had, which is still half-baked, revolved around playing with primary colors and secondary ones. If either a white or blue or green or red square were to move towards (or suddenly be) grey, purple, yellow, or orange -- then this could also serve as a signal about how many minutes, 0 thru 4, to add.

Anyway, just messing around with the concept. I could see how the software coding for adding a third tally would not present huge problems, but have no idea what complexity it introduces in the hardware.

~RS

Hi,

That's a great idea! Many people wrote me about their solution for a clock accurate to the minute! I think it's awesome that people get so involved in this weird project. This is what open source is all about!

A teacher from the UK wrote me a message about the class he gave using my clock project. He asked the kids what they would do to improve the clock ... there are some pretty cool ideas! I posted an article on my blog: http://basbrun.com/2015/05/29/the-fibonacci-clock-...

Have a nice day!

Hi any direct link by using Arduino Uno and RTC?

If you google your question you'll find tons of samples!

Thanks for stopping by ...

Sorry, i could not locate the wiring diagram @github. I am more specifically wanting to know the LED sequencing as there are 5 sets to be sequenced in series.

can u pls share this detail as i am unable to proceed with your project due to this step not being clear? Any other readers who have figured out the wiring can kindly help?

Hi ravijag,

The LEDs are driven by the WS2811 LED driver ... you only need three wires connected to an SPI port to drive all the LED independently.

Some chinese ledstrips come with 5 wires; 2 white (both ground) 2 red (both 5v) and a green wire to drive the leds. You can clip off the extra red and white wires.

Are you trying to connect the ledstrip to the pcb?

I recently finished my first fibonacci lamp. I had some trouble producing my own pcb so i moved to a ready made arduino board and a ds 1307 breakout. Now I only have to make small pcb to accomodate the buttons.

That's awesome! Would love to see the final result! Thanks for sharing!

Hi

i want to build this for myself but am unable to understand the wiring sequence of the LED modules (DO to DI between modules). The picture or schematic is not clear on this critical connection. Can u please elaborate this step?

More Comments