My Arduino Binary Clock





Introduction: My Arduino Binary Clock

Hi from Italy
Although many watches are created binary, my project was inspired mainly to this:
http://, very smart and funny.
I tried to improve the design and to add something personal.
I think it's a good result at the end.
The project is not difficult, requires patience, it requires a little knowledge of electronics and the use of Arduino.

Ok, check out the video and if you like it lets start!

Step 1: List of Materials

-n.1 IKEA frame called "Ribba" 13x18 cm
-LED to mark hours and minutes (You have seen the first images of the LEDs that there are different colors, but of course you can change them as you like, now is the reference of the project.):
n.8 green 5 mm
n.3 red 5mm
n.2 yellow 5 mm
-LED to light the words "Hours Minutes"
n.7 white 5mm
-LED to light the numbers 1/2/4/8
n.4 pink 5mm
-LED to light the words "binary clock"
n.4 pink 3 mm
-n.24 Resistor 220 ohm (for 5mm led)
-n.4 Resistor 150 ohm (for 3mm led)
-Cartonboard thicker to make LED holder
(we will Insert the cartonboard between the glass and the bottom of the frame supporting)
-Some acetate (4-5) sheets (for inkjet or laserprint) to create the mask
-a flat wire 26 wire
-3 micro button to set hours and minutes and on/off
-A small piece of prototyping PCB to make the shield (see later)
-Some double strip
-n.1 Arduino Uno/2009 or clone or self made. I've used one Luigino assembled by me
-Power supply 6V 500ma or other Arduino compatible.

Step 2: Goals

At the beginning we try to understand how reading the time, I think it's important to understand the electronic connections.

The first two columns correspond to the hours, the third and fourth to the minutes.

The first column are the units of hours and the second the tens, the same thing for minutes.

For each column must add the corresponding value (displayed on the right with the numbers 1-2-4-8) and reading the following you have the time in 24h format.

It 'very simple, we take the example of the first photo you see above:
-first yellow spot= 10
-3 green spot= 7 (4+2+1)
-first and third red spot= 50 (40+10)
-2 green spot= 5 (4+1)
So , 17:55 ok?

So we have to create a set of LEDs to display the time in this way, the circuit and the program will be managed by Arduino.

The remaining lights (Hours, Minutes, 1/2/3/4, binary clock) are embellishment for the clock (also improve the general understanding) but still managed by Arduino.

Step 3: Schematic

This is the pattern that we must achieve.


All LEDs who rule the time are connected with the cathode (negative -short leg) and a 220 ohm resistor to digital pin, all the anodes (positive-long leg) are connected together with 5v by Arduino. (see photos in the next step)

All LEDs embellishment (words "Hours / Minutes / BinaryClock") are connected in parallel and that all the anodes are connected together with a resistor and goes to the PIN 0 (see photos in the next step), all the cathodes are connected together and go to the GND

The micro buttons are connected to one side to the Analog pin and the other side to GND.

More precisely (see the schematic picture):

units of Minutes

tens of Minutes

units on Hours

tens of Hours

to ARDUINO DIGITAL PIN 0 (all toghether)

As you read above we will have 3 micro button.
1th Button will change minutes, adding one for each time you press it. ANALOG PIN 0
2th Button will change hours, adding one for each time you press it. ANALOG PIN 5
3th Button (optional) will turn ON/OFF the clock LEDs, but keep counting the time. ANALOG PIN 4

Step 4: Lets Start the Constructions

Lets see the pictures in sequence

-Cut the cardboard exactly the same size of the interior of the frame.
-Printed on a sheet of paper the positive mask (as does the attached file), this will help you make the holes in exactly the desired position.
-Attach the sheet printed in a positive view at the center of the frame considering the white passepartout of the IKEA frame.
-Make a hole for each LED you need to installI, i've used a a drill with a bit of 5mm for all LED except those that make up the word "BINARY CLOCK" where i've used a bit of 3 mm.
Always test the operation of the LED before proceeding with the next


-As shown in the picture, bend down the anode and up/bended left the cathode.
-Trip leaving 2-3 mm the cathodes and the 220 ohm resistor and sold it toghether.

-For these LEDs you can find the layout you like best, the important thing, as explained in a previous step, is to cut a portion of the anodes and solder one 220 or 150 ohm (depends the led size) resistor, the goal is to have all the LEDs in parallel connection, all the anodes soldered together, and all the cathodes soldered together.
All the secondary lights are switched on simultaneously.

Write on the cardboard the number of each pin and the words, it will help to sold the wires later

Add some buffles to prevent the light from bleeding between words and number.
Cut the buffles about 1 cm hight, the goal is to have enough space for the wires and the back of the frame.
I've used hot melt glue to do attach these.

Step 5: Connect the Wires

I've used a flat wire of 26 wires removed to an old computer.

You need 23 wires for this project, I chose this solution for comfort but of course you can use a single wire for each pin or group.

Be careful to count in sequence to connect the wires on the right LED, wire 1 on LED1 to Pin 1, wire 2 on LED2 to Pin 2 and so on.

Let the last wire (6) to connect the micro buttons on the left (see in later)

Add some separators with rubber adhesives, cutting them (adjust the height) so that the back of the frame is perfectly suited to the edge (see the pictures later)

Step 6: Insert the Mask

Print the attached picture (negative) on a lucid (acetate) paper with a Laser print (better) or Ink Jet printer .

Cut out the attached picture (negative) leaving 0.5 mm for side and place on the passepartout of the frame with some piece of adhesive tape.
Make the first tests of illuminating LEDs to get the perfect alignment with the mask.

For a better spread of light and have a solid black I have three layers overlapped acetate, at the end I put a layer of gray and a white matt for better light diffusion.

Step 7: Layout

Step 8: Create the Arduino Shield

If you want you can buy a card that is already ready, but it is very simple and useful to make it at home.

Cut a piece of prototyping PCB exactly the width of the pins on the card.

Sold only the strips those that correspond exactly to the pins we're going to use: Pin0 to Pin13- Analog 0-4-5- 5v- GND

The position of the pins can change, depending on the card we're going to use, Arduino, Luigino and so on, but the goal is clear.

Once you have made the shield, you will have more space to sold each wire on the corresponding pin.

Will also be much more convenient to leave the Arduino connected on the back (see later) only by detaching the shield if you do the maintenance in.

Go on!

Step 9: Connect the Micro Buttons

As you have read, the micro button are 3:
-set hours
-set minutes
-set on/off light (but the clock goes on) (optional)

Choose the location of the buttons, personally I preferred the one you see in the picture for a better use and arrangement of internal wires.

The buttons are of 6 mm square, draw a picture in trackbacks for precise positioning.

Drilled in the center with a 4 mm tip of the squares drawn.

Use a little square file and patience, it is better to close that hole too wide, go step by step and try the size.

When the buttons are positioned solder the wires as explained in the previous step

Cover with hot glue the buttons to prevent from leaving the site and protect the solder joints.

Step 10: Place the Arduino

Make four holes on the back of the frame pannel to match up the card, and fastened with screws and little bolts under the frame stand.

Step 11: Upload the Sketch

The method can be different, depending if you use an Arduino (USB), Luigino (I removed the chip and I programmed with another arduino), and so on, but this is another instructables..

Thanks for watching

Step 12:



  • Clocks Contest

    Clocks Contest
  • Water Contest

    Water Contest
  • Creative Misuse Contest

    Creative Misuse Contest

35 Discussions


2 years ago

I built your clock and it worked perfectly.Then I decided to build another one only this
time displaying seconds as well as minutes and hours. It work perfectly as far as the time goes but
it has one problem that I can’t figure out for the life of me. Maybe someone here who has built this clock
might have an idea.

Here’s the problem. I
am using standard 5mm diffused LEDs.The LEDs
for the hours and minutes work fine. For
the seconds, from 1 second up to 10 seconds, the LEDs light normally but when
it gets to 20 seconds, that LED lights but is quite dull. When
it gets to 30 seconds both the 10second and the 20 second LEDs light
normally. When it gets to 40 seconds,
again, that LED is quite dull but once it gets to 50 seconds, the 10 second and
the 40 second LEDs both light normally.

All of the resistors are the same at 220 ohm.Anyone have any ideas as to what might cause
this problem?

sir may i ask on how did you solder or how did you put the flat wires in the pb or in arduino thanks

Oh,yes thanks.. That was my Issue.

New to arduino, I loaded the sketch to a Nano. I can get the secondary lights to work, but only pin 1 seems to be flashing in some sort of fashion. Is there something I need to change in the sketch?

Hey,i got a problem:

If i´ve already made the Arduino Shield,but where to connect the 26 pin flat wire at the Arduino?(maybe i´m dumb^^) (Sorry for my bad english..) I hope someone can help me..

1 reply

Did you read the instructables?




to ARDUINO DIGITAL PIN 0 (all toghether)

I made it after your good instruction. I made also a small circuit for the atmega 328. I soldered the led the other way, cathode (negative -short leg) to GND and the anodes (positive-long leg) to the to digital pins, didn’t read carefully, so I had to switch digitalWrite in the sketch.


Grazie. gentilissimo! E complimenti per i tuoi progetti di orologi. Sono bellissimi.

ciao, non mi è chiaro"a layer of gray and a white matt" te lo chiedo in italiano perché in inglese non ho capito :-(.
Sono due ulteriori strati? Quello bianco è la carta da disegno opaca, mentre quello grigio?

1 reply

In sostanza devi fare in modo di evitare che la luce dei led si "diffonda" e si concentri solamente solo sulla lettera da illuminare. Per ottenere questo io ho adottato del bianco opaco, che limita la diffusione, e uno o più strati di grigio che smorzano l'intensità, fai le prove comunque. A presto

that is really beatiful, I made it, but I have some problems with the software. effectively, my clock is low, I lost 7minutes in 3days! have you a solution? have you modified the soft? thx for all

5 replies

The loop is losing time. Imaging that lastTick is on 901 and the next loop() doesn't come around for 101 ms, then you'll be at 1002ms by the time you reach the if condition. What happens to the 2ms? They are lost. It can be even worse; you are at 999ms and the next time takes 101ms, you would end up at 1100ms, losing a whole 100ms!

Also, since you are calling millis(); twice in the original, there is a chance that the second call is further forward than the first comparison.

Try this fix:

int temp = millis();
if (temp - lastTick >= 1000) {
lasteTick = temp;

I saw online that when creating a clock this is "normal" because of voltage difference and things like that... there is a "Real Time Clock" module that exists that makes sure that the time stays accurate, I don't know how it works exactly, but it could fix your problem... but hopefully you fixed your problem in the last 2 years ;)

Ty for reply
No, i'm sorry, as explained there is a version 12 hours and at 24, I used the version in 24 hours and is perfect.
Sometimes there can be problems if there are changes in Arduino voltage double check if the power supply is ok.

Thx for responding so fast!
My power supply is 12V for my arduino, but I don't know how it can be the problem?
you have no delay problems on yours?
excuse me, I'm french, and my english is not fluent!
May be I can see inside the following boucle to send lasTick by serial port.
"if (millis() - lastTick >= 1000) {
lastTick = millis();
Like that, I'll see if it is really 1000 between two values.

>>Thx for responding so fast!
I'm in Italy, yours email comes faster here....;-)

>>you have no delay problems on yours?
No, i'm sry
I told you about power supply is important because it is stabilized by 7 to 12 volts, power surges can cause delays.