loading
 In some point in the life of every electronics hobbyist the need to make a clock is borned, in my case it was about a month after I soldered my first part on a board, but back then I didn't have the right tools, parts and knowledge to do such a thing.
But after about 2 years I got all the things I didn't have back then and I was ready to make my first digital clock, and with all the LEDs I had left over from my 8x8x8 LED cube project I decided to make my own custom LED clock.

So join me and build your own custom LED digital clock powered by our favorite little micro-controller the Arduino.





Step 1: What Do We Need?

 Here is what tools you will need to make this:
  1) Soldering Iron.
  2) Some solder wire.
  3) Small needle nose plier
  4) Small cuter
  5) Wire striper

I made my clock with a stand alone arduino without the original board because I wanted to make a finished project.

Now here are the parts you will need to make the clock:
  1) 130 LEDs.
  2) 15 2N4401 transistors.
  3) 20 1K resistors.
  4) about 10 resistors for the current protection(more detail in step 2). I used 150Ohms.
  5) DS1307 real time clock IC.
  6) one coin cell battery holder.
  7) 4 Tact switches.
  8) Prefboard (you would like to get along one for the display about 8inch*3inch)
  9) ATMega328 with arduino bootloader.
  10) A programmer for programing the chip. 
  11) 7805 voltage regulator.
  12) 16MHz crystal.
  13) two 22pF caps.
  14) 28 pin IC socket for the ATMega328.
  15)10 uF cap.
  16)0.1 uF cap.
  17) 4017 counter
  18) 32.768KHz crystal




Step 2: The Seven Segment Display

The clock is made of six seven segment displays which make up the display.
Each digit made of seven segments and every segment made of 3 LEDs in parallel.
So a simple calculation gives that there are 21 LEDs in each seven segment display.
And all six digits take 126 LEDs.
But as I said In the parts list you will need 130 LEDs and the other 4 LEDs are going to be used as dots that separate the hours, minutes and the seconds.
I made a common cathode display which means the all the negatives leads are connected together.

Now you will need to choose the right resistor for current limiting to 3 LEDs in parallel.
The calculation is simple and gos like this : 
R=(Vcc-Vled)/(Iled*3)
R= the resistor value
Vcc = The voltage that is supplied
Vled = the forward voltage on the LED
Iled =the current the LED takes

You should always take a value a little bit bigger then the one in your calculation just to be on the safe side.
 

Step 3: So How It Works?

This kind of display calls for a large amount of pins to power it out so a special technique is needed.
I used multiplexing.
Multiplexing works by switching between the digits one by one very fast and by so creating a illusion that all of the displays are working in the same time.
This works by connecting each segment to the same one on a different digit  and by so you will have only seven segments that are all the same for all the digits.
And you can choose what digit you want to power by connecting the negative leads of the display to ground and sending the data to the positive segment leads.

The scanning of the display is accomplished by the 4017  decade counter because I wanted to save some pins on the arduino, to control it you will need just 2 arduino pins.
The 4017 connects the grounds one by one and by so it scan the display.

Step 4: The Schematics

I did the best as I could to make a good schematic, I hope you will understand it.
(Note  : That I forgot to add the resistor to the reset pin in the schematic so you will need to add a 1K resistor  to the reset pin and Vcc)
To see the schematic better download it.
Some things I didn't added in there and they are the connection of the transistors to the display.
Now for the transistors that are connected to the 4017: There are just one unused pin in there and thats the collector and you need to connect it the ground of the seven segment display, each resistor is for one digit.

The transistors the are connected to the micro-controller has the emitter pin unused and you need to connect is to the segments via a current limiting resistor, each segment gets one transistor.

The 2 transistors that have a LED connected to them represent the 4 dots in the display you can see how to connect in the display picture.

Look at all the pictures in this step to know what goes where.

Step 5: The Program

Now it's time to program you ATmega chip.
But first install all 3 libraries that I have given like so.
Take your chip and put it in the arduino board and put the program I have added with this step.
The program is a bit messy but I did as best as I could to make it clean.
You ca set time and date in this clock so no time setting is needed when you program.

Time setting mode:
Press the "start/end setting mode" button, use the up and down buttons to set the time and the "next" button to move to the next part( it goes like this : hours, minutes,days, mouths ,years).
when you are done press the "start/end setting mode" button again.

Date:
Just press the "date/next" button.

Note:
There is no comments in the code, I will add them latter on.

Step 6: Your Done

 Now you have your own working clock to tell you the time and date.
Now you can make or buy a nice box to close all the wires and make a cool finished project.


<p>Where will we put the pins of the 7 segment from the LEDs to the circuit..?</p>
<p>Hey Guy's -</p><p>is there anybody willing to custom build an LED - Controlling Unit to </p><p>build an LED - Clock simmulation an Analog one ?</p><p>I wan&acute;t to build a clock like that - but don't have time to aquire the necessary knowledge....</p><p>Just give me a rough quote..... mojo100@me.com</p>
<p>will you plz give me a error less complete code for arduino 1.0.6 my email address is wajahatatif@yahoo.com</p>
http://code.google.com/p/arduino/downloads/detail?name=arduino-0022.zip&amp;can=2&amp;q
jz02bdn Reply<br>I made it..... use Arduino-0022 to upload the program you can download here<br><br>http://code.google.com/p/arduino/downloads/detail?...<br><br>in the code, there is a line - &quot; pinmode = SET.read();If it was pressed you will exit the while loop &quot; <br><br>In front of the &quot;if&quot; needs two slashes, like so, pinmode = SET.read();//If it was pressed you will exit the while loop
<p>I WANT THE SCRATCH FOR THE ARDUINO UNO3. </p>
<p>Hello Sir when i compile the code it says exit status 1</p><p>'RTC' was not declared in this scope please what is wrong with the code i need help please</p>
<p>Hello Sir when i compile the code it says exit status 1</p><p>'RTC' was not declared in this scope please what is wrong with the code i need help please</p>
<p>Hello!</p><p>Where in the code is the value of the seconds, according to which the display displays the current Date after pressing a button that is connected to pin A0?</p>
<p>I have a problem! if I look at the date, one dot LED is not lit .. but when back to clock mode, the LED dot lights up</p>
<p>When i upload cods, lot of errors come. if you can upload your code please</p>
<p>Would you mind sharing the PCB design you used? I am having troubles getting my cad software to work. Any response is appreciated.</p><p>Thanks, Adam</p>
<p>check your wiring...may be 'short' with others segment. use your multimeter</p>
<p>But this error</p><p>Arduino: 1.6.9 Hourly Build 2016/04/08 08:33 (Windows 7), Board: &quot;Arduino/Genuino Uno&quot;</p><p>C:\Users\BASNAY~1\AppData\Local\Temp\arduino_modified_sketch_155777\sketch_apr12b.ino:1:22: fatal error: WProgram.h: No such file or directory</p><p> #include &lt;WProgram.h&gt;</p><p> ^</p><p>compilation terminated.</p><p>exit status 1</p><p>Error compiling for board Arduino/Genuino Uno.</p><p>This report would have more information with</p><p>&quot;Show verbose output during compilation&quot;</p><p>option enabled in File -&gt; Preferences.</p>
<p>How can I fixit it? Tell me pls</p>
<p>this means that the Wprogram.h library is not installed. </p><p>Copy the 3 given folders to Documents\Arduino\libraries</p>
I dont know where do i download this library. can you give me the link to download it?
<p>Actually, just replace &quot;Wprogram.h&quot; to &quot;Arduino.h&quot; in the code.</p>
<p>any one can help me with this error?</p><p>In file included from sketch_jan10a.ino:3:<br>C:\Program Files\Arduino\libraries\DS1307/DS1307.h:47: error: 'boolean' has not been declared<br>C:\Program Files\Arduino\libraries\DS1307/DS1307.h:48: error: 'boolean' has not been declared<br>C:\Program Files\Arduino\libraries\DS1307/DS1307.h:55: error: 'byte' does not name a type</p>
<p>wprogramer.h not found error comming ..what i will do now????</p>
<p>Me too, i dont know how to fix it. the code is error</p>
<p>Me too, i dont know how to fix it. the code is error</p>
Hi, i have finished making the circuit and i uploaded the program to my atmega328 chip.<br><br>But there's a problem. When i connect a 9V battery to it, only the 4 dots lit. I am confused maybe it's because of the wiring but i definitely did what it is written in there and in the diagram. Also maybe because of the resistors i used? By the way i used yellow LEDs and i used 150ohms resistor for current limitting. Can you help please? Or anyone? Thanks.
Also i am wondering. You use 150ohms for current limitting for 3 blue LEDs in parallel. But when i compute it with what formula you gave i only got 20ohms. (Vcc-Vled)/(Iled*3)
<p>i saw this tutorial for few years ago, and i want to built it, but i don't know what i'm doing. i don't know about microcontroller. and i learn about it, and now i'm made it!!! thanks for the tutorial...i change the LEDs to seven segment and different display. on the left side i use common cathode seven segment, and the right side i use commond anode 4x seven segment with 2pcs smallest seven segment display..... :)</p>
<p>hi peppy..would you mind sharing how you modified the display using a common anode?..pls..i really need it.</p>
<p>sir how to set the time</p>
<p>please sir give the code which will run in the latest versoin of arduino</p>
<p>that's totally sick! looks like a LOT of work. great job! i &quot;may&quot; consider doing one if i can't find a cheap-o quartz jobbie from hellmart ;-)</p>
<p>Can you send me complete source code, please</p><p>minijame21@gmail.com</p>
<p>i have a problem, error</p><p>RTC.get(rtc,true);//get the data form the RTC IC</p><p>download failed</p><p><a href="https://www.instructables.com/files/orig/F7P/G6B3/GA8NEH74/F7PG6B3GA8NEH74.zip" rel="nofollow">DS1307 and More.zip</a>291 KB</p><p>how do that ?</p>
<p>I have mounted the circuit 7 displays business segments and transistors are 2N2222A.<br><br> The problem is that lack luster to segments.</p>
<p>Tengo montado el circuito con displays de 7 segmentos comerciales y los transistores son 2n2222A.</p><p>El problema esta en que falta brillo a los segmentos.</p>
<p> i have used blue LEDs,To work 4 leds need 12v so can i give 12v through that transistor.</p>
Having some problems with the finished clock. The first time I powered it up, I set the time and date, and it ran great. After an hour though, it seemed to reset itself and displayed the zero digit on each of the six numbers (like it was before I first set the time and date). Now whenever I set the time again, it runs for about 4 seconds then resets to zeroes again. Sometimes, it won't display the time or date after it has been set. <br> <br>Anyone having a similar problem? any suggestions on how this could be fixed? I've tried disconnecting the reset pin from the circuit, but that didn't make any difference.
<p>i have the same problem ..n i used the uno board but the things went good for the first time n next time it doesnt store time it just diplays 000000 and notinhgs goes on n wen i set the time it take all input but wen pressing setting butoon the display shows the same 000000 ... any solution u found</p>
try taking out the button battery, i think that worked for me. It seemed to run fine with just the 9V
Try putting pull up resistors to the DS1307's data lines. <br>2.2kohm, read datasheet for further ado.
<p>used the uno board but the things went good for the first time n next time it doesnt store time it just diplays 000000 and notinhgs goes on n wen i set the time it take all input but wen pressing setting butoon the display shows the same 000000 ... any solution my problem n if i use stnad alone arduino it just show zero on the first digit...</p><p>plz help i have to it do it by dis year 2014 or else it will affect my grades.... </p>
<p>you could save a digital output by connecting pin 5, the Q6 output of the 4017 counter directly to its reset pin 15. This creates a 1 of 6 counter.</p>
<p>just wondering what is the approximate cost of this project?</p>
<p>Hey</p><p>A problem bumped up when I started programming. When compiling I get next error message: <br>This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p><p>Arduino: 1.0.6 (Windows 7), Board: &quot;Arduino NG or older w/ ATmega8&quot;</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::read()':</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp:48: error: 'class TwoWire' has no member named 'write'</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp:61: error: 'class TwoWire' has no member named 'read'</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp: In member function 'void DS1307::save()':</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp:74: error: 'class TwoWire' has no member named 'write'</p><p>C:\Users\Kaarel\Documents\Arduino\libraries\DS1307\DS1307.cpp:82: error: 'class TwoWire' has no member named 'write'</p><p>I am currently using USBasp programmer to program the circuit, Also I use new DS1307 library a good man provided in comments but I still can't make it work. I anyone able to help me with that problem?</p>
<p>sir i have a problem using arduino 022. are you have a sketch for arduino 1.0.5? thanks.</p>
<p>in the above circuit diaram where does the pin of clicok ic goes ......</p><p>do we have to cinnect all the small boxex or we have to just leave those pin as it is</p>
<p>in the above circuit diaram where does the pin of clicok ic goes ......</p><p>do we have to cinnect all the small boxex or we have to just leave those pin as it is</p>
<p>Got it working, but there is one problem left. The dots keep flikkering like every second. Any idea what could cause this?</p>
<p>Do you have to connect you're DS1307 to the 5V? It isn't connected in the drawning </p>
<p>Nice clock! and nice tutorial!</p><p>Have a look at this website, they are selling the DS1307 real time clock: <a href="http://voltatek.com/en/sensors/34-i2c-rtc-ds1307-at24c32-real-time-clock-module-raspberry-pi-arduino.html" rel="nofollow">http://voltatek.com/en/sensors/34-i2c-rtc-ds1307-a...</a></p>
<p>I made it..... use Arduino-0022 to upload the program you can download here </p><p><a href="http://code.google.com/p/arduino/downloads/detail?name=arduino-0022.zip&can=2&q" rel="nofollow">http://code.google.com/p/arduino/downloads/detail?...</a></p><p>in the code, there is a line - &quot; pinmode = SET.read();If it was pressed you will exit the while loop &quot; <br> <br>In front of the &quot;if&quot; needs two slashes, like so, pinmode = SET.read();//If it was pressed you will exit the while loop</p>
<p>Yea I figured it out already but thanks</p>

About This Instructable

219,117views

142favorites

License:

Bio: Electronics and LEDs what can be better ?! :D
More by Syst3mX:Make a Desktop Tamagotchi LED Binary Calculator Make a 24X6 LED matrix 
Add instructable to: