TimeDuino- 7 Segment Arduino Clock (No shift registers needed!) by astroboy907

Hey all instructable goers! This is my first project. Yes, I know those words usually get the stereotype "This isn't going to be a good project" attitude, but I have been waiting a long time for a project that is worthy of possibly breaking the first project attitude- at least for a while anyway.

This project would be about medium level for a novice, but *hopefully* still provide somewhat of a challenge for more experienced users, as they get into the code and work on improving this.  "This" that I have mentioned multiple times, is an Arduino clock, based off of a 4 digit display. I have named this project the "TimeDuino". Its a simple 4 digit clock, driven with Arduino and transistors. Well, enough boring you with the introduction, lets get to the project!

Well, a few more things actually :)
1. In the spirit of instructibles and the growing DIY world, feel free to use this project, hack it, open it, tear the code apart, and in any way you want destroy/hack/DIY it to your hearts content. I want everyone to be able to access the project, and not have to worry about proper permissions. I really like the quote from MAKE: Magazine, which states "If you cant open it, you dont own it". So OWN this project! Open it, hack it, tear it apart and make it your own. Go beyond the step by step instructions and really customize it! I really enjoy electronics, and i want to share that enjoyment with others.

2. Feedback is appreciated. Tell what you do or do not like! What needs upgraded and what needs reverted to a previous version? These things (though I might not be able to complete all of them) really help and make it easier to create something that is liked by the community. Have a question? Ask it in the comments, or PM me. I'd be happy  to help as much as I can.

Many thanks, and on to the project! :)
-Astroboy907

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts Needed:

P2150106.JPG


1x Arduino. I used an UNO (but any version should work). Make sure it has a 16MHZ timer chip on it, otherwise timer functions will be off (until I update with an RTC [Real Time Clock].  To tell if it has the timer, it should have a silver oblong piece on the PCB, with 16.000 printed on it.

1x Power supply for Arduino (not shown)

1x Breadboard. A half size board will work, but a full sized one is easier to work with (I'm using 2 half size boards together. 

Breadboard Jumpers - quite a few are needed.

7x 2N3904 NPN type transistors (maybe 8 for AM/PM support, working on that)

8x resistors. Try for a value greater than 200 ohms and less than 1k. I'm using 220 ohms. (10x if I get AM/PM support)

7x 1k ohm resistors. These will keep your Arduino from overheating (8x if i get AM/PM)

1x 4 digit 7 segment display. I used a common anode display (but a common cathode would work with editing the code). Make sure it has a colon! One used in project-  Sparkfun COM-09481
also available in red, green, and yellow (blue costs 50c more than the other colors. I got 2 just in case [but these are almost unbreakable if you remember to use resistors])

*Note that if you want to just build it w/out testing, you don't need the breadboard and jumpers. I wanted to test mine first but I'm gonna build a finished up prototype when I get some other parts.
1-40 of 59Next »
grampafish says: Feb 17, 2013. 8:28 AM
what do i have to modify to work with common cathode display
lolooo says: Oct 2, 2012. 10:58 AM
very thanks for this great project .
but just I have question
Is it work with parallel Linux or processing ??
if it's not can I make this clock with parallel Linux ?

Best regards:
Lolo
astroboy907 (author) says: Jan 18, 2013. 8:37 PM
If the arduino IDE is available for linux distribution (which I think it is at arduino.cc), than yes, it is.
kshowell says: Jul 12, 2012. 4:58 PM
Enjoyed the build. Thanks much for the project. Good luck with school.
astroboy907 (author) says: Aug 2, 2012. 10:35 AM
Thanks... its pretty accurate for the internal clock, but eventually I am going to have to get a clock chip on it... My next project is a watch (why is it that I only build clocks and time-devices?? Odd..) and I will want a clock chip on it, so I suppose I will develop this software with it... I kinda forgot about this and have not updated my stuff in a while.
aclock says: Mar 22, 2012. 3:15 AM
Hi.
Is a good project but i search v.1.8 clock + RTC/Ds chip
Ok for singe full file code .pde or txt (for Software Arduino V.1) .
Please Link download.
Regards.
Eu.
astroboy907 (author) says: Mar 22, 2012. 6:38 AM
I have not built version 1.8 yet, as I am very busy with school. As for now I do not have the time to write it.... So sorry!! I will try this summer when I have extra time...
drbogger says: Jan 25, 2012. 2:18 PM
I noticed there's a bug, where after the clock cycles a few times, the hour1 digit does not turn off when it's suppose to... Any ideas on a fix?
drbogger says: Jan 25, 2012. 2:29 PM
I found a fix!

The issue seems to be with counter2

It sets counter2 = 1, but it never resets it back to 0..

I added the code to reset it here:

if(hour2counter == 25){
hour2counter = 1;
hour2 = 1;
hour1= 0;
counter2 = 0;
}
astroboy907 (author) says: Jan 25, 2012. 2:32 PM
ok. Test and see if that works! I think it should :)
astroboy907 (author) says: Jan 25, 2012. 2:20 PM
about how many cycles? I'll try to take a look through the code. Also- sorry I havnt been keeping up with this. My schedule is shot to heck with school....
astroboy907 (author) says: Feb 23, 2011. 8:05 AM
Hey everyone, sorry for the delays in updating, stuff keeps on coming up, and I came down with something and am not feeling 100%. Hope to update soon though :) Sorry for any inconvenience this causes.
eng.enayyah says: Oct 4, 2011. 12:25 AM
sorry for replaying here and thanks for this great project

sorry again but i need you immediatehelp ,, can you please tell me if it possible to replace the arduino with a microprocessor??
coz i'm working on my first hardware project and i'm requested to use a microprocessor and i like your project very much

if you have any advice or suggestions
for me i would be happy to know them

please help,,too much nerves
astroboy907 (author) says: Oct 4, 2011. 4:38 PM
No problem.

In short, the Arduino is a microcontroller. I think this should work, but ask if you need a microprocessor, or a microcontroller. The arduino is a microcontroller, but I am not sure if your project requires a microprocessor or microcontroller. If it can be either, you can use the arduino. If not, this project should work with a microprocessor. Depending on which one you get, there might be a difference in the code and hardware.

-A907
Robot Lover says: Aug 1, 2011. 9:42 AM
You should totally add a real time clock! 5* I noticed you already ordered the chip, but here is a kit that has all the components for  the clock: http://www.makershed.com/ProductDetails.asp?ProductCode=MKAD19
astroboy907 (author) says: Aug 1, 2011. 10:40 AM
I actually havnt ordered the chip yet :( I was meaning to but my order went crazy and the cart deleted itself. yay. so now I am putting in a new order from the place- will stick a few timers in there- btw, what timer do you think I should use? I can get the DS1307 or the 1302 timer... Thanks for the input!
Robot Lover says: Aug 1, 2011. 4:41 PM
If you got the kit above, it would come with the ds1307. I've never used them but this one looks pretty simple to use.
astroboy907 (author) says: Aug 2, 2011. 9:16 PM
link is taking a while here... will check it out 2morrow
Robot Lover says: Aug 3, 2011. 8:03 AM
You could go to makershed.com and search for it. Talk to you later! ( ;
astroboy907 (author) says: Sep 21, 2011. 1:32 PM
sorry it took so long. ordered chip and it should be here this week. along with some other parts for various ibles...
Robot Lover says: Sep 21, 2011. 3:43 PM
sweet! You should post an update to this instructable!
astroboy907 (author) says: Sep 21, 2011. 5:26 PM
I'm planning on it. Also I got parts for making a 6 digit display from this, cathode display, buttons (for some reason im missing mine), RTCs. Havnt gotten to alarm yet, but that comes after RTC
Robot Lover says: Sep 22, 2011. 9:55 AM
I was thinking of making one of these but for a wrist watch. Can't wait to see your finished clock!
astroboy907 (author) says: Sep 22, 2011. 11:30 AM
Oops! Received order just now in the mail (tayda electronics)- my seconds clock is a bit larger - I guess My display was marked .56" but its really .40" or something, so my seconds display is a little large, but it should work fine. It should be a week or 2 max before i get it to work :)
Robot Lover says: Sep 22, 2011. 6:15 PM
I order from tayda too!
astroboy907 (author) says: Sep 30, 2011. 9:01 PM
Nice- btw update in 1307, its coming along but Im having a hard time finding time cause of school. I think I am going to try to post an ible on how to use a DS1307 too, while im at it ;)
Robot Lover says: Oct 2, 2011. 9:46 AM
Yeah you should! I have never used one before so I don't really know how to interface it.
lissajous1 says: Jul 10, 2011. 6:37 AM
Hi Astroboy907,

Can you please help again? please? You sound so nice. My counter works fine but when I setup a basic 555 to feed into pin(13) pwm. It works good but it runs at same speed as if i was to inject 10 hz versus 10khz. It's weird, it's not faster or slower. Would it be something in the millis area? I can't seem to get it. : (
If you have time, you sounded very busy last time. I apologize for interrupting you. : )

Please can you help me?

Lacy
lissajous1 says: Jul 17, 2011. 6:13 AM
Hi Astroboy907,

My project is a simple vending machine, I've got the basic part finished. 25 cent, 10 cent, 5 cent increments figured out. But when i try to inject a frequency, the counter moves at same speed regardless of 10 hz vs. 1khz. I finally fixed the part when to start and stop the count once the timer signal is removed. This last part I cannot understand or figure out "same frequency speed". Oh I am using the arduino duemilanove. I hope this is enough information. Your the sweetest guy : )
Can you help this one last time?

Lacy
astroboy907 (author) says: Jul 16, 2011. 2:26 PM
Sure I can try to help (I have had absolutely no ex. with 555's but ill try to be as helpful as I can be). First of all, what are you trying to do with this? I understand its a counter, but what are the functions you want? Is it counting down by 25/50 or somthing, and if so how much time in between counts? I'm so sorry I sounded busy. It was actually just me being gone for a while and not having access to my computer (just an iPod) you didnt interrupt me at all. It sounds like you may be able to do this whole thing code only, and no 555 involved. What arduino are you using? and does it have a timing chip on it? Ill be glad to help- actually righte now ill start rewriting the code to time up and down :) shouldnt be that hard because the basic infrastructure is there...

-Astroboy907
astroboy907 (author) says: Jul 17, 2011. 5:44 PM
try dividing millis value by 10 and try that :)
lissajous1 says: Aug 2, 2011. 4:24 PM
Hi Astroboy907,

I tried dividing the millis value by 10 but i got some really weird results. If u could maybe help me with some code and make a very slow signal pulse generator with the arduino duemilanove that would work. Please..... Please......... : (

Please Astroboy can you help me, I've tried everything

Lacey
lissajous1 says: Jul 31, 2011. 12:54 PM
Hi Astroboy907,

I tried dividing the millis value by 10 but i got some really weird results. If u could maybe help me with some code and make a very slow signal pulse generator with the arduino duemilanove that would work. Please..... Please......... : (

Lacey
astroboy907 (author) says: Aug 2, 2011. 9:28 PM
Hey- sorry about my really late reply but Ive been a bit busy (not too busy to help! :) )
Ok, I would be more than glad to help you with the vending machine- its would help greatly when I am writing the code to know some more about the project, if you dont mind.

1. What is this project exactly? A detailed description would be nice and super helpful

2. What do you want the code to do? I understand you want it to count up, but when exactly do you want it to count up? When a coin is detected by a sensor (and if so, what type of sensor), or on a timer.

3. What do you want the timer to trigger when it reaches a certain amount? Is there any user interaction (such as choosing what item, etc)

4.What hardware do you want on this? I understand you have a duemilanove, but any chips/sensors/servos/motors/transistors, etc would be nice to have on hand.

5. Is this any way connected to your computer while running? More so, is the computer going to send or receive text, etc from the arduino.

6. What results do you want to have when the project is finished? A step by step of what you want the machine to do would be great, an example:

I. User inserts coin into machine

II. Machine determined quantity of coin, and adds value to the counter

III. When machine has enough coin values, etc. etc.

7. What is the machine vending? is it large, like candy bars, or smaller like M&Ms?

Sorry if i have overwhelmed you a bit. I have gotten the same thing when I asked questions, and its a bit tough to come up with all the answers
lissajous1 says: Aug 7, 2011. 5:47 AM
Hi astroboy907,

I just wanted to thank you for all your wonderful help, I finally figured out what was wrong. I was using pin input 13 instead of interrupt (0) which of course is pin 2, which corrected everything for me using the RISING command. Now it works great!!! Thank you again for your patience : )

Your a GREAT PERSON : )

Lacey
lissajous1 says: Jul 20, 2011. 6:06 PM
Hi astroboy907,

k, will try thank u sweetie : )

Lace
Vick Jr says: Jun 24, 2011. 9:14 AM
Every other transistor switch circuit I've seen has the emitter going to ground and the collector connected to load,  as in here. Can you explain why yours are backwards with collector to ground?
astroboy907 (author) says: Jun 25, 2011. 1:11 PM
hmm.. ive forgotten the exact reason as of now (its been a few months since ive been able to even work on any of this), but I believe it has to do with the position of the transistor (connected to ground as opposed to V+), and with the diodes. It would work connected to v+, with some alternative programming (and a few more transistors), but I thought it would be easier to use them connected to ground. Could have something to do with the NPN biasing, but im not sure.
So in short, I dont really have an answer as of now. But since now i am able to access my stuff i will be looking for an answer :) Part of it for me, I guess, is that it works when connected that way... so I didnt really wonder about it because.. well.. most of the time my stuff doesnt work so its odd when it actually does what it isd supposed to.
-Astroboy907
lissajous1 says: Jun 8, 2011. 6:30 PM
Hi Astroboy907,

I got it working, it's pretty cool. I changed the coding around a little for my own personal reasons. I changed the code so it would count up from 0 to 9999. I'm having a problem trying to get the code to increment more than just 1 digit at a time. I think its the [ i] counter not sure. I want to increment by 25 or 50 and so on. How would i accomplish this? Please can you help me?

Very nice instructable, works great : )

Lacy
lissajous1 says: Jun 8, 2011. 7:47 PM
Okay I will wait till end of June, Sorry didn't read that post.

: )

Lacy
1-40 of 59Next »
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!