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!

## Step 10: The Code

You can find the source code on my github account:

https://github.com/pchretien/fibo

<p>Fascinating clock to build. Made it myself using hardboard enclosure and 8 MM RGB Neopixel LEDs</p>
<p>Here are some pictures. I failed in producing the original pcb so i decided to take the the design one step simpeler by using an arduino nano and a ds1307 module.</p><p>Then I needed to fabricate a custom pcb to house the parts. In Fritzing that is quite easy. Quite happy with the result. Still have to fabricate the back lid.</p><p>I will be using the fibonacci clock in the classes R&amp;D that i teach. And showing off to colleagues off course :-).</p>
<p>Hi friend, sorry I would like to know which library you have used with that module because I have mounted it as you using RTClib-master and it does not show me the hours or anything. a greeting</p>
<p>BTW i moved to the ds3231 module as it is much more accurate. Adapting the code for this module is very easy and available on request.</p>
<p>Wow, great. Thanks a lot</p>
<p>Hi,</p><p>Your project looks great. Would you mind sharing your code or how you changed the original code? Thanks!</p>
<p>Did you rename the library folder from RTClib-master to RTClib?</p>
<p>It is the same library as in the original design.</p><p>Maybe give this a try:</p><p>https://github.com/adafruit/RTClib</p>
<p>Hi,</p><p>Your clock looks great! I like the way you built your circuit ... What and where are you teaching? </p><p>Thanks for sharing with the community!</p><p>Phil</p>
<p>Hah, its a bit quick and dirty, but it works.</p><p>I am a teacher in biology and research&amp;development to youngster aging from 12 to 17 years old in the Netherlands.</p><p>Your clock is a demonstration of what can emerge when creativity and technology meet.... ingenuity!</p><p>For over two month's now, I have a lot of fun with your clock on a daily basis. Designing the custom pcb, the woodworking, sourcing the parts, the build and, off course the final result.</p><p>THANK YOU FOR SHARING THE FIBONACCI CLOCK IN THE OPEN SOURCE MANNER.</p><p>Maybe there is a market for ready made clocks in the Netherlands....;-)</p>
<p>Here are the pictures of my project. I realized it by using an arduino nano and an ds3231. It was a great pleasure to build it although my hair turned gray sometimes. </p><p>To house the parts I used a veroboard. I placed this board in a way that I still can reach the mini-usb from the arduino nano. This allows me to change the program and use other color schemes for example.</p>
<p>I have just published an article here at Instructables. I hope you can appreciate it. Regards, Eric</p><p><a href="https://www.instructables.com/id/Fibonacci-Clock-Modified" rel="nofollow">https://www.instructables.com/id/Fibonacci-Clock-Mo...</a></p>
<p>Thanks to your project I built <a href="https://www.instructables.com/id/Geek-Clock-FiBiNo-Fibonacci-Binary-Arduino-Clock/">my watch</a>, which I published today.</p><p>It is a bit easier (I did not use the Neopixel) but I added the minutes and the seconds in binary format and I also added a display</p>
<p>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:</p><p>material: normal FR4 board / aluminium board / blind vias board ?</p><p>fr4-tg: tg130-140/ 150-160 / 170-180 ?</p><p>thickness: from 0.4 to 2.4 mm &iquest;1.6?</p><p>min track/spacing: 4/4mil, 5/5mil, 6/6mil ?</p><p>min hole size: 0.2mm, 0.25, 0.3 ?</p><p>surface finish: HASL with lead, HASL lead free, inmersion gold, hard gold ?</p><p>via process: tenting vias, plugged vias, vias no covered ?</p><p>finished copper: 1 oz Cu, 2,3, 4 ?</p><p>Somebody can help me, please?</p>
<p>Hi,</p><p>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! </p><p>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: <a href="http://basbrun.com/2015/05/29/the-fibonacci-clock-in-the-classroom/" rel="nofollow">http://basbrun.com/2015/05/29/the-fibonacci-clock-...</a></p><p>Have a nice day!</p>
<p>Hi any direct link by using Arduino Uno and RTC?</p>
<p>If you google your question you'll find tons of samples!</p><p>Thanks for stopping by ...</p>
<p>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.</p><p>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?</p>
<p>Hi ravijag,</p><p>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.</p>
<p>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.</p>
<p>Are you trying to connect the ledstrip to the pcb?</p>
<p>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.</p>
<p>That's awesome! Would love to see the final result! Thanks for sharing!</p>
<p>Hi</p><p>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?</p>
Hello, <br>All the schematics are in the git repo on github. <br>P.
<p> Can we convert the double sided pcb to single sided one???</p>
Sure you can... The Fritzing file is in the git repo. You can also find the pub at https://store.basbrun.com if you want to go faster! :)
<p>is there any substitute for the type of led strips used?</p><p>can we use separate red, yellow and green leds?<br>if so plese tell me how?</p><p>i would like to do this project</p><p>the led strips are not available in my place and it is undeliverable area in inernet shopping sites.</p><p>please help me</p>
<p>Hi,</p><p>Thanks for your message ... You can use any WS2811 based LED strip. You should be able to find it on eBay or Alibaba.</p><p>Using distinct red,green and blue LEDs won't produce the same effect and you'll need multiple LED drivers to drive that many LEDs.</p><p>Where are you located?</p>
<p>An RGB LED is actually 3 seperate LEDs with either the anodes or cathodes tied together, take a red a green and a blue, twist either all the anodes or cathodes together and you have yourself a common anode or cathode (depending on which you tied) RGB LED, although, you will not get the same diffusion, it will work.</p><p>If you wish you can replace all the colours with any available LED colour, it would even be possible to make an IR clock that displays the led at 3 different brightnesses by tying different resistors to the anode or cathode that can only be seen through a camera with its IR filter removed for extra confusion!!!!</p>
<p>But how to programme it???</p>
<p>I certainly will. Right now i am sourcing the right of plexiglass..</p>
<p>OMG, I tried to drive the pixelstrip from the wrong end. </p><p>Problem solved!</p>
<p>Hi,</p><p>Glad you solved your problem! Would love to see the final result!</p><p>Philippe</p>
<p>I love the idea of this clock. Very creative i must say.</p><p>I am trying to build one myself. Shipping costs to the Netherlands are a bit steep and i don't want to miss out on the DIY fun</p><p>Already fabricated my first pcb. So proud of myself. Now i want try the breadbord version before i go into soldering, but i run into some trouble now.</p><p>I bought a strip of 50 lights and cut them up in strands of 9. The first 9 led work just fine but the other cut up pieces don't ligt up. De complete strand of 50 lights worked fine also. Maybe i want to build some more as a gift so i would very much like the strands to work to.</p><p>Do you have any idea of what is going wrong here?</p><p>Thx in advance!</p>
That's really cool. <br>Do you think is possible to merge your project with a INKA CALCULATOR ( YUPANA ) <br><br>http://www.quipus.it/english/Andean%20Calculators.pdf
<p>Hi ccarpio2,</p><p>This Inca calculator is a magnificent object! Sure it could be merge together ... if you do it let us know!</p>
Hey, Philippe...<br><br>Congratulations for this awesome project! Answering your question from two days ago, I'm from Rio de Janeiro, Brazil, and I received the link for your project in a Instructable's tweet earlier today. Funny that I only realized that your article was posted a year ago when you mentioned it in your comment. :-)
<p>Oh great! I got more than 30 000 views in a weekend, one year after I published the article! :) Instructables.com is THE place to be in the DIY community!</p>
<p>Awwwh. It's not for sale? I have to build it? I like the pretty colors.</p>
<p>It is actually ... <a href="http://store.basbrun.com">http://store.basbrun.com</a></p><p>Thanks!</p>
<p>I have enough trouble keeping track of all of the Mickey Mouse appendages on my wrist watch, I'm not ready to learn any new tricks. Looks like a nice little DIY though. Thanks for the look into the future.......;) Semper Fi</p>
<p>Thanks!</p>
Cool project! Congratualtions on your Kickstarter campaign. I've posted a linl / pic of your clock on Pinterest, hope it helps!!
<p>Thanks man!</p>
<p>beautiful! </p>
<p>Beautiful, geeky, love it!</p><p>Quick tip, though: Arduino (Atmega328P, whatever) has INPUT_PULLUP, so by just inverting your button logic you can save yourself those (admittedly cheap) pull-down resistors, bit of space, bit of wiring. Not sure if the same applies to your other pull-up resistors too?</p><p>Very cool clock though. I'm just wondering if you should go all the way up to 34 so you don't have to do the &quot;multiply by 5&quot; thing ;-)</p>
<p>Thanks NoseyNick,</p><p>I tried it with more squares but if I keep the same scale the clock would be enormous and to complicate things, you would have more calculations to do in less than one minute! :)</p><p>Thanks for the input!</p><p>Philippe</p>