Make A Digital Clock From Scratch

 by Syst3mX
PICT0008.JPG
 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.





 
Remove these adsRemove these ads by Signing Up

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




1-40 of 120Next »
simbrose says: Apr 28, 2013. 1:24 AM
actually, scratch that. The clock seems to be working fine (for now) after I accidentally removed the button-cell battery connected to the 8-pin chip. Not sure why this seems to fix it but whatever, I'll take it.
simbrose says: Apr 28, 2013. 12:56 AM
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.

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.
jukees says: Feb 28, 2013. 9:46 AM
I want to thank you for not making a stupid american 12-hour clock.
jpc41 says: Jan 17, 2013. 3:46 PM
Wondering if PDF is still available to help me build this circuit.
kingdir3 says: Aug 8, 2012. 8:40 AM
how meny amps this board will draw? (130x0.02)=2.6amp
am i right?
what kind of power supply to use to connect to 7805
kingdir3 in reply to kingdir3Aug 14, 2012. 2:20 AM
in clip i see u connect it to external dc power supply howmeny ampsdose it drew from sorce
kingdir3 says: Aug 8, 2012. 8:49 AM
help me with calc of resistor for led raw is my calculation is correct?

vcc=5v
vled=3.2v
llled=0.02a
R=(5-3.2)/(0.02*3)=30ohm

i will use 43ohm resistor
leighbran in reply to kingdir3Aug 10, 2012. 6:56 AM
Hey,

Calcs look right to me, however, a 33Ohm resister would work also. I like this calculator,

http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator#parallel

kingdir3 says: Aug 6, 2012. 4:02 AM
can i use this prog on uno R3 board?
leighbran in reply to kingdir3Aug 7, 2012. 2:28 PM
Yes! I am using the same board and it worked. However, you need to go to Arduino, and download Arduino-0022 version, and use it to load the chip. Also, in the code, there is a line - " pinmode = SET.read();If it was pressed you will exit the while loop "

In front of the "if" needs two slashes, like so, pinmode = SET.read();//If it was pressed you will exit the while loop

HOpe this helps!!
carouselification says: Oct 20, 2011. 4:17 AM
Hey! Nice Tutorial! I am going to try and use this for a school physics prac, and i was wondering if you could possibly email me the pdf of this? Thanks!
Syst3mX (author) in reply to carouselificationOct 20, 2011. 4:22 AM
yeah sure give me your email
mubin_sheikh in reply to Syst3mXAug 3, 2012. 10:34 PM
RTC is not synchronised with real clock time
I set time of RTC as per real clock but when real clock complete one hour RTC
get let at least 4 minute.
can u solve this issue
mubin_sheikh in reply to Syst3mXAug 2, 2012. 4:29 AM
thanx i made it my clock thanx agai
mubin_sheikh in reply to Syst3mXJul 30, 2012. 3:55 AM

In file included from sketch_jul30a.cpp:3:
D:\arduino-1.0.1-windows\arduino-1.0.1-windows\arduino-1.0.1\libraries\DS1307/DS1307.h:47: error: 'boolean' has not been declared
D:\arduino-1.0.1-windows\arduino-1.0.1-windows\arduino-1.0.1\libraries\DS1307/DS1307.h:48: error: 'boolean' has not been declared
D:\arduino-1.0.1-windows\arduino-1.0.1-windows\arduino-1.0.1\libraries\DS1307/DS1307.h:55: error: 'byte' does not name a type

i don't know how getrid off this problem
can u help me
can u send me pdf at mubin04sheikh@gmail.com
dimitarmrmeski in reply to Syst3mXNov 14, 2011. 2:06 AM
Hey :)) could you please send me schematics in original resolution and the hex file,my email dime_mrme@yahoo.com ,:)) thanks anyway
carouselification in reply to Syst3mXOct 20, 2011. 6:32 AM
31771@cggs.act.edu.au :) Thanks!
leighbran says: Jul 27, 2012. 8:45 AM
Hello. A bit of a newbie. Having all kinds of errors while trying to program the chip.

In file included from sketch_jul27a.cpp:1:
C:\Users\Leigh\Documents\arduino-1.0.1\libraries\DS1307/DS1307.h:47: error: 'boolean' has not been declared
C:\Users\Leigh\Documents\arduino-1.0.1\libraries\DS1307/DS1307.h:48: error: 'boolean' has not been declared
C:\Users\Leigh\Documents\arduino-1.0.1\libraries\DS1307/DS1307.h:55: error: 'byte' does not name a type
sketch_jul27a.cpp: In function 'void set_time()':
sketch_jul27a:258: error: 'If' was not declared in this scope
sketch_jul27a:258: error: 'it' was not declared in this scope
sketch_jul27a:258: error: expected `;' before 'was'


Can anyone steer me in the right direction?

Thanks,
mubin_sheikh in reply to leighbranJul 30, 2012. 4:05 AM
use arduino022 for development this code
leighbran in reply to mubin_sheikhJul 30, 2012. 6:53 AM
Also,

It highlights this line,



pinmode = SET.read();If it was pressed you will exit the while loop




Thanks,
leighbran in reply to mubin_sheikhJul 30, 2012. 6:49 AM
Hi mubin_sheikh,

Thanks for the suggestion. I tried it, and this is what I get,

sketch_jul30a.cpp: In function 'void set_time()':
sketch_jul30a:248: error: 'If' was not declared in this scope
sketch_jul30a:248: error: expected `;' before 'it'

Any thoughts?

Thanks,
mubin_sheikh in reply to leighbranAug 2, 2012. 4:23 AM
you should cmment
// If it was pressed you will exit the while loop
like that statement
leighbran in reply to mubin_sheikhAug 2, 2012. 8:58 AM
Worked perfectly!!

Thanks so much!! Was becoming a bit discouraged.

Have a great day.
alsatel06 says: May 26, 2012. 1:16 PM
Hey :)) pourriez-vous s'il vous plaît envoyez-moi des schémas de résolution d'origine et le fichier hex, mon e-mail www.alsatel06@yahoo.fr) Merci quand même

www.alsatel06@yahoo.fr

plz
Sophia Almstead says: Dec 25, 2011. 4:29 AM
Hi been awhile.
The script you added to upload to the atmega328 does not work with Arduino 1.0.
Can you make an updated version of the code.
Sophia Almstead in reply to Sophia AlmsteadJan 4, 2012. 8:24 AM
nvm, already worked it out.
fox-dyed in reply to Sophia AlmsteadApr 29, 2012. 2:51 PM
How did work this issue out? I'm running into the same trouble trying to get the program to work with 1.0
fox-dyed in reply to fox-dyedApr 29, 2012. 5:32 PM
Figured it out and here's how:

There's an outdated standard library in his libraries called WProgram.h and in the original program.

All you do is edit the name to Arduino.h which is the name of the new standard library, but to do this you need an editor program like microsoft's visual studio to open, edit and save the new libraries. Once you've done that it should compile with no issues in 1.0.
acao says: Mar 29, 2012. 8:21 PM
I don't know what libraries to install to the Arduino... Are all the library included in the attachment above?

Thanks
shonkhonil says: Mar 15, 2012. 4:09 AM
I need pdf file.plz help me.my email address is
zahidhasan19@gmail.com
dsteven says: Dec 10, 2011. 8:43 AM
Can you send me complete source code, please... (not hex)
dave_steven1102@gmail.com

thanks!
wellydenny says: Sep 23, 2011. 7:16 PM
Please I need Schematics ....
Syst3mX (author) in reply to wellydennySep 24, 2011. 12:31 AM
http://www.instructables.com/files/orig/F4D/9X92/G9XBM588/F4D9X92G9XBM588.bmp
sevencore says: Sep 18, 2011. 11:51 PM
I'll try this one for next. I already done with Syst3mX 24x6 LED Matrix for my first new hobby and success.

Thanks Syst3mX.
electronic boy says: Aug 26, 2011. 5:11 AM
Your circuit diagram shows that 9 PNP transistors and 6 NPN transistors are needed, so why in the parts list is it stated that 15 pnp to be used ?
please respond soon
Thanx
Syst3mX (author) in reply to electronic boyAug 26, 2011. 5:22 AM
They are all PNP transistors, NPNs got their arrow going inside the transistor.
electronic boy in reply to Syst3mXAug 26, 2011. 9:35 AM
Yes but your (GND driver) would require NPN transistors, wouldn't it or am i missing something, also every transistor on your circuit diagram is an NPN, hence no variation in the arrow, the arrow points away from the transistor(NPN)
Syst3mX (author) in reply to electronic boyAug 26, 2011. 1:29 PM
oops sorry I used all NPN transistors I always mix up the names
heema says: Aug 22, 2011. 12:01 AM
Hey, could you please send me schematics in original resolution and the hex file and can i use white led's ? , thanks :
ph-heema@hotmail.com

sorry but just one more thing how many days it took from you to make it ?
cbadrilaa's says: Jul 9, 2011. 7:54 PM
can u send me complete steps n schematics plzz..:D
membrane_owner@yahoo.com
1-40 of 120Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!