Introduction: LED Binary Clock

Picture of LED Binary Clock

A Binary Clock!

I was recently looking at some binary clocks and I felt like Why not? I have everything to make one and I don't have a clock in my room.
So I decided to build one and here it is. Hope you Like it and maybe build your own.

It's a cool project because it's your very own, unique clock, it's easy to make, it's highly customizable in both size/shape and firmware/functions, it is Arduino based/compatible AND it looks good. 

Step 1: What You'll Need

Picture of What You'll Need
for this project you will need the following things;

  • cardbord/wood box(you choose the size)
  •  DC WallWart 5V out at least 250 mA
  •  Arduino or Atmega328/168/88/48
  •  (if not using an Arduino) 16Mhz crystal and caps (the more precise, the better).
  •  13x 220 Ohms Resistors.
  •  13x LEDs (your preferred color)
  •  A lot of Wire.
  •  3x pushbuttons (PCB mount)
  •  (optional) 1x LDR (light dependant Resistor) OR 1x Pushbutton (enclosure mount)

  •  Soldering Iron and solder.
  •  Cutter/Xacto Knife.
  •  wire strippers.
  •  Computer (I guess you have one if you're reading this).
  •  (if not using an Arduino) USBtiny ISP.

Step 2: Selecting Your Box

Picture of Selecting Your Box

The easiest and simplest enclosure is a cardboard box, you could also use a nicer plastic or wooden box, it's up to you.
Select your box, remove the back part from it.
if it's a cardboard box, you might want to disassemble it and reassemble it inside out, like I did, that way its easier to paint or, leave it like that and it looks great!

Step 3: Mark Your Box.

Picture of Mark Your Box.

You need a 4x4 grid, but don't make holes just yet, as you won't fill it all the way.
in a cardboard box, I four it's easier to just make some small holes for the LED legs and insert them from the outside, other ways the cardboard will look awful and your LEDs won't be "snapped to grid".
At first, I marked my box on the inside, but later on I decided that I actuallly liked those Grid lines, so I did them on the outside too.

Step 4: Add Your LEDs

Picture of Add Your LEDs

Place your 13 LEDs in your 4x4 grid as shown in the image above.
from the inside, Bend all the Leads and place a drop of hot melt glue on top of each (Bottom, actually) (see image 2).

Step 5: Wiring 1

Picture of Wiring 1

connect together all the POSITIVE leads (the longer ones) from each LED.

Step 6: Wiring 2

Picture of Wiring 2

Add one wire to each LED's NEGATIVE lead. instead of the positive lead, connect the NEGATIVE ones, contrary to the diagram above. Remember, all the POSITIVE ones are connected together, contrary to what the diagram shows.

Step 7: (If Using an Arduino)

Picture of (If Using an Arduino)
simply add one resistor to each wire going to each LEDs leads and connect them to the corresponding arduino pins, then connect a pushbutton to Arduino's digital pin 14 (Analog 0), one to digital pin 18 (analog 4) and another to digital pin 19 (analog 5).
  • the 14 pushbutton will change minutes, adding one for each time you press it.
  • the 19 pushbutton will change hours, adding one for each time you press it.
  • the 18 pushbutton (optional) will turn ON/OFF the LEDs, but keep counting the time, this is useful for sleeping time. :)
  • the 18 LDR (optional, instead of the pushbutton) will turn the LEDs when ther's no light, e.g. at night. but keep them on when there is, like in the day or at night, when you turn on the lights.

the proper LED to Arduino pin diagram is shown below, remember that it´s the other way around, instead of all to Gnd, all to 5V, etc.

Step 8: (If Not Using an Arduino) Assemble the PCB

Picture of (If Not Using an Arduino) Assemble the PCB

I added the 2 time setting pushbuttons on the PCB, all the 13 resistors and the reset pushbutton. 
place your crystal, remember, the frequency is not critical, as long as you specify it on the arduino software, if you don't know how to do this, stick with 16Mhz, also, if you´re using another frequency, remember that its recommended that it's a multiple of 8, e.g. 16mhz or 8 Mhz because Atmega chips are 8Bit micros.

if you're a beginner, it's recommended to use an arduino, or at least an arduino ready, pre-bootloaded chip.
the advantages of using an Atmega48 instead of an atmega328/arduino is mainly the price;
an arduino costs about USD $30, an arduino pre boot loaded chip costs about USD $6, and an Atmega48 costs only about USD $1.5.

NOTE: to be able to program Atmega chips without boot loader, using ISP from the arduino IDE you need to make some modifications to  the IDE (I will not cover that in this guide).

if you use an Atmega48/88 without bootloader, you need to have some basic knowedlage on AVR fuses and how to work with the bare chip and program thru ISP.

remember to add  a 2 pin header for power and, mark which pin is Gnd and which one is 5V and add a 3 pin female header for connecting the (optional) pushbutton or LDR. one pin to Gnd, one to 5V and the other one to digital pin 18 (analog 4).

Step 9: Test Your Clock.

Picture of Test Your Clock.

Download the firmware below, there are 2 files, one for 24 hour mode and one for 12 hour mode.

At this point it should be (almost) fully assembled, but already fully working, so flash your micro controller and try adding some minutes/hours and check if it changes every minute. also check that the numbers it displays are correct, if not, check all your connections, check that the program you uploaded is the correct one and check for power good (green LED on Adruinos).

if you don't manage to solve your problem, post a coment describing it or email me at and I will try and help you.

the video shows the programming and testing process.

Step 10: Glue Your Pcb/arduino in Place

Picture of Glue Your Pcb/arduino in Place

at this point, your clock should be allready tested and working, because, after this step, you won't be able to make any soldering or other kind of rework.

Step 11: Power Supply.

Picture of Power Supply.

for the power supply I used an old WallWart I had lying around that outputs 5 volts regulated DC, I also made a power extension (for the 5v side) because the wallWart's wire wasn't long enough.
To be able to plug it in, you just need to cut the tip and exchange it for a 2 pin female header (in case of using your own pcb) or a male header (in case of using an arduino).

Step 12: How to Read It

Picture of How to Read It

the secret lays in understanding how it works, it's really simple!

It is a binary clock, it's a bit harder to read but that makes it cooler, you'll get used to it.

the first 2 colums correspond to hours, toe 3rd and the 4th correspond to minutes. the 2nd and 4th colums are units and the 1st and 3rd ones are 10 of the corresponding units (hours, Minutes).

you need to add the lit up LEDs to get the time, see image 2 for an example (it's not as hard as it might seem, it's actually really easy)

remember , if you make the 24 hour version, you will have a 12:00+ hour in the afternoons, with the 12 hour one, you will have the normal time. (i think everybody understands this part).

It'l get really easy after a week or two of reading your new super, unique cool clock.

Step 13: Finally, Place It!

Picture of Finally, Place It!

Finally, place it on the wall and enjoy!

remember to set the correct time.
also remember that, if the power goes out, the current time will be lost.

Step 14: Future Additions!

Picture of Future Additions!

 - add an RTC (Real Time Clock) so it doesn't loos the time every time it is unplugged.
 - add a day of the week function.
 - add an alarm function that has day-dependant alarms and multiple ones.
 - something else I will think of.


DUlschm (author)2011-09-17

Neat use of Arduino / Atmel. The Arduino boards are nice, but this shows that you don't have to surrender them to your projects. Just use the Atmel chip and keep the Arduino dev board around so you can debug your next project.

I wonder how long it would last on batteries. Maybe if the LEDs were PWMed above 60Hz you could save some power. And that way you could dim it at night.

Well done. Any thoughts about upgrading to a wooden box?

Also, this version is a prototype, the next one will have tons of extra functions and be a neater build.

yes, one of the future additions is actually a LDR, Light Dependant Resistor, to use as a light sensor and dim the lights accordingly to the outside light, that way, it would never be too bright or too dark.

Build_it_Bob (author)2011-09-16

Excellent job! Very unique and well written.
I still have to look through the code to see how you made this work!
Thanks for the share!

Question333 (author)2016-07-25

Hey, I was just wondering if anyone knows how to change the time so that I could connect the LED Binary Clock with a real time clock. I want to try to make it so I don't have to press buttons every single time I unplug it. Thank you!

bimbopan2295 made it! (author)2016-01-20

I used and arduino pro mini because it is smaller, and smoked window film for cars(for the glass of the frame) works great. Remember all switches are conected to an analog pin and ground; all leds are connected to 5v form arduino.

Sankalp Mahajan made it! (author)2015-09-09


I had to change pin 14, 18, 19 to A0,A4, A5 resp.

Also the pushbuttons other end has to be connected to the gnd.

martinhui (author)2015-07-19

I made your code but found all leds on, I pressed the button confused a while, later understood the led off made sense of it, i.e. 1110 means 1, 1101 means 2, I reverse the code changed HIGH to LOW and LOW to HIGH made me more comfortable, so just want to ask if you are the same idea?

cutlercollin99 (author)2015-02-11

Hey, is it possible for me to get the code and sone tips for the hardware for your clock?

kCuHcii (author)2014-10-16

I used this instructable as a basis for my one of my school requirements. I made it using a matrix board and a picture frame! I tweaked the code a little bit in such a way that I understood it better. And I added a blinker to signify that the seconds were counting. Thanks for this! ?

Shortcircui (author)2014-09-11

Although i have not yet made this, I am looking forward to making it. This is a brilliant project for begginers at Arduino, and electronics.

I take my metaphoric hat off to you. good job sir!

wlayton (author)2013-03-25

Great project! Where do I find the schematic for the Arduino & Atmega328/168/88/48 portion of this clock project.
Also what would it take to add the seconds to this clock.
I realize that the seconds change faster than is reasonable to read but they do represent a binary counter that is fun to watch.

Well, as for the seconds, you would have to modify the code yourself, you just need to duplicate the minutes portion and set it to count every second instead of every minute, the problem is that an arduino doesn't have enough pins of that, so you would either have to use an arduino Mega or an arduino clone with a chip like the Atmega1284

Or shift registers

starwriter34 (author)2014-06-18

I would love to see this built using charlieplexing. Basically it will use 6 pins for all the leds instead of the 13 you need.

anouskadg made it! (author)2014-05-09

Made a wooden version.

Thanks :)

Fizza Tahir (author)anouskadg2014-05-10

can you please show the logic diagram for this clock. i am new to electronics and I want to understand the logic first.

Fizza Tahir (author)2014-05-10

can you please show the logic diagram i am new to digital designing i want to understand the logic first.

RIJO VADAKKAN (author)2014-04-07


agowda2 (author)2014-03-17

can u tell me overall cost

MaxTreck (author)2013-10-17

hello I have a problem with the code when I turn on my clock all my LED are on, the adjustment make them go off, why everything is reversed?

Foo_Plinger (author)2012-12-09

I am not sure how, but when I run the 12hr code, all the led's that should be off, are on, and all the ones that should be on are off. For instance, the clock starts at 00:00, which means no led's on, but instead all my leds are lit.

Hi, this is probably due to a reversed polarity on the LEDs, there's 2 things you can do;
1. de-solder all your LEDs and connect them reversed, then disconnect them all from ground and connect them to Vcc.


2. you can edit the code, changing all "LOW"s to "HIGH"s and vice versa.

hope this helps

j41697 (author)2012-09-27

where is the code

Emiliano Valencia (author)j416972012-09-28

Step 9, here's the link aswel.

j41697 (author)Emiliano Valencia2012-09-29

Sorry, I didn't see it. I'm thinking about doing this for a science apps. project. Could you please explain steps 5 and 6? I don't fully understand.

Emiliano Valencia (author)j416972012-09-29

Step 5: you just need to connect (solder) together all the positive (longer) leads from ALL the LEDs.

step6: add a resistor to each NEGATIVE lead of all LEDs and then connect each one to the corresponding arduino pin, see schematic for this.

i'm not sure how I could explain t better, did you understand them now?

j41697 (author)Emiliano Valencia2012-09-30

So every positive lead needs to be connected to every other positive lead?

Emiliano Valencia (author)j416972012-09-30

yes, and to the positive lead of the arduino aswell

j41697 (author)Emiliano Valencia2012-09-30

Sorry im new to this. Where is the positive lead on the arduino?

Emiliano Valencia (author)j416972012-09-30

well if you are using an Arduino board, it's the on that's labelled 5V, if you use the bare chip, it's the one that's labelled VCC on the pinout diagram.

j41697 (author)Emiliano Valencia2012-09-30

Okay i think i understand everything now. Thank you.

j41697 (author)j416972012-11-02

okay. One more thing, I'm almost done making it, but the buttons have to be grounded dont they? And if so, does it need to be grounded to a specific place?

Emiliano Valencia (author)j416972012-11-06

Yes, the buttons have to have one side connected to the corresponding pin and the other side connected to ground, it doesn't matter where you cnnect that ground, as long as it is directly connected to the ground of the arduino chip

aselker (author)2012-07-09

I tried adding a photoresistor, but I had to do some tinkering in both code and hardware. I ended up stringing about 410kohm of resistors with a photoresistor and adding a button that switched the "leds on" input between a button and the photoresistor. I also used PWM to dim a few of the LEDs because I used one RGB LED for each of the tens digits (I was short on LEDs). If anyone wants my code or schematics, ask.

rubanman (author)2011-10-26

This is awesome, I am going to try 25 wooden blocks, probably cutting them and then sanding it down, then adding a thin coat of clear lacquer. Make it look a little more luxurious

mpepino (author)2011-10-10

Ok, very well done indeed a nice tutorial, very cool but I think you forgot the seconds plus is there any way for using only 1 resistor in the +5v making the Gnd... (Don't know if you understand me but I can't Explain this better I'm a n00b at electronics)

I didn't forget the seconds, i Just didn't put them, think about it; it takes a few seconds to read it, so by the time you read the seconds, they have already changed.
Also, as I said below, you cannot use only 1 resistor, each LED needs 1 because LEDs are not plain resistive loads, they are semiconductors and have a dropout voltage.

ok thanks, I'm making a clock rigth now

David97 (author)2011-10-09

Could I add one resistor before ground to save resistors instead of 1 before each led.

no, each LED needs it's own resistor because, other ways, when 2 LEDs are lit, they would be only half of the full brightness and do on, meaning that, if you use only 1 resistor, the LEDs could get as down as 1/13 of full brightness.

dunnos (author)2011-09-15

perhaps find a way to get cheap lasers? projectable binary clock!

danbinder (author)dunnos2011-09-17

If it were to be projected, would it not be backwards when you read it?
unless you make it backwards so it projects the right way

dunnos (author)danbinder2011-09-18

What if for each dot you use a different laser? That makes it aimable!

Emiliano Valencia (author)dunnos2011-09-15

That would be cool, please post images if you build it

jonrb (author)2011-09-16

It strikes me that you only need 10 LEDs (Assuming you're using a 12-hour clock... otherwise you need 11). Why do you have so many?

Have I got my binary mixed up or am I just barking up the wrong tree?

Monsterguy (author)jonrb2011-09-17

Each vertical line of LEDs is one digit of the time, the first picture shows the time as 16:52. I assume this is done to make it rather easier to read.

Tomasauk (author)2011-09-09

That is cool. I would make one... eventually, but I think I would find it tricky to read.

It's easy, ill already got used to it, and I only have 1 week with it.

its a bit strange at the beginning, but you'll get used to it, i did! :)

About This Instructable




Bio: Interested in all kind of projects, mainly electronics but other stuff too! I try t publish everything I make. CONTACT: BTW, please ... More »
More by Emiliano Valencia:Prehispanic Laser Cut Leather WalletDIY Rooftop Urban GreenhouseCNC Wall Mounted Desk
Add instructable to: