Professional Documents
Culture Documents
Clock Duino
Clock Duino
Clock Duino
Technology
Play
Workshop
Living
Outside
Food
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!
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.
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.
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.
***WARNING!! The following section may contain science relating to electrical components and
how to use them. Continue at your own risk. Thank you.***
Basic transistor lesson. To use an NPN transistor, placing current on the base pin lets proportional
current through the collector pin to the emitter pin. Very basic, as transistors have different
minimum currents, maximum ratings, and different current capabilities, along with much else.
Luckily, a 2N3904 is very kind to us, and perfect for small scale, high frequency switching with a
low power source, such as an Arduino. Yay!
For segment A: connect pin 12 (on Arduino) to the first (leftmost) 1k resistor (connected to
transistor base [middle pin])
For segment B: connect pin 11 (on Arduino) to the second leftmost 1k
For segment C: connect pin 10 (on Arduino) to the third 1k
For segment D: connect pin 9 (on Arduino) to the fourth 1k
For segment E: connect pin 8 (on Arduino) to the fifth 1k
For segment F: connect pin 7 (on Arduino) to the sixth 1k
For segment G: connect pin 6 (on Arduino) to the seventh (rightmost) 1k
For segment H: connect pin A3 (on Arduino) to the 1k on your H segment transistor. This is not
actually used in the test.
You should see a variety of patterns and tests go on the digits. If anything seems out of place,
check your wiring. Here's a video showing you what an ideal test should look like. UPDATE: I got
video embed to work :) My thanks to user Burf for guiding me to the right page.
If all goes well, skip the next step and continue on. If it doesn't seem to work, go to the next step.
Full7SegTest.pde11 KB
*Note. Its best to blank your Arduino, it makes it easier to upload the next sketch (sometimes it
freezes). To do this, go to File>Examples>Basics>BareMinimum (or equivalent) and upload it to
your Arduino.
So here goes.
Seg A to pin 12 on Arduino
Seg B to pin 8 on Arduino
Seg C to pin 7 on Arduino
Seg D to pin 5 on Arduino
Seg E to pin 4 on Arduino
Seg F to pin A0 on Arduino
Seg G to pin A1 on Arduino
Seg H where it is
To use the code, download the file included below. It should download as a .tmp file, just rename
it as a .zip file. Unzip the file into your arduino sketch folder. In arduino, go to
Sketchbook>TimeDuino_v1.4 and open it. It should have a program with 3 tabs in it. Go to the
third tab to set your variables. Make sure to read the comments!
TimeDuino_v1_4.zip4 KB
v1.3 - Blinky colon support, will blink the colon every second (like some clocks)
UPDATE! Blinky colon support (read through code to see how)
v1.6 - Possible seconds addition, using another 2 digits, making it a 6 digit display
v1.8 - RTC support (I have a DS1307 clock chip on order, as well as the needed extra components
to get it to work, but it will take me a while to get it and make it work) This will (hopefully)
eliminate the timing problems (the display goes a bit fast, testing to try to lessen the effect)
another few updates would maybe include common cathode display support, thus eliminating the
need for a specific display, and adding an alarm and snooze.
*Final note:
If you wish to use your Arduino for another project, it helps to remove all the wires from it, and
then upload your desired sketch. If you don't remove all the wires, it sometimes freezes up and
won't let you load anything.