3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Sleek word clock

Step 7Wiring up the Arduino

Wiring up the Arduino
«
  • DSC_5009.JPG
  • DSC_7157.JPG
  • DSC_7158.JPG
  • DSC_7166.JPG
  • DSC_7175.JPG
  • DSC_7174.JPG
The clock needs some brains, so it's time to hook up the microcontroller.

First, you'll want to program the Arduino before placing it in the circuit.  The code I used (WordClockModified.pde) is a slightly modified version of drj113's original code, updated so that the pinouts match my version and I changed the buttons to be hour-advance and minute-advance rather than minute forward/backward.

Space-wise, you probably won't be able to fit the whole arduino USB board inside the frame, and there's no reason to anyway, so I chose to set up a standalone ATMega168.  If you do this make sure you use a crystal, not a resonator - resonators are simple since you don't need separate capacitors, but crystals tend to be more accurate which is important in a clock.

For the most part I followed drj113's schematic with a few changes:
- I hooked up the output-enable pin of the shift registers to a PWM pin on the ATMega168 (instead of just tying them high) so that I could dim the LEDs programmatically
- I added a potentiometer to an analog input pin for setting the brightness (you might substitute a photoresistor so the lights dim when it's dark)

I've uploaded a mini-schematic I drew to help wire the components (Note: the pinouts on my version are different than those used by drj113)

To start building the controller, you may want to use a breadboard to prototype some of the design (photo 1).  Once you are convinced that things are working as expected, it's time to move to a more permanent layout. 

Start by cutting down a piece of protoboard and laying the components out to make sure everything fits OK (photo 2).  Then start wiring up the components.  I started with the voltage regulator and ATMega168 and made sure that the microcontroller was hooked up correctly before continuing (photo 3 - note: the top of the board was pretty cramped, so I wired up some things on the bottom side).  Then I wired up the shift-registers and drivers, checking to make sure that each set worked correctly before continuing (photo 4 shows the board after two sets of shift-register/drivers have been wired).  The completed controller board can be seen in photos 5 and 6.
« Previous StepDownload PDFView All StepsNext Step »
12 comments
Apr 15, 2012. 8:23 AMremedix says:
Hey all,
I've decided to copy this project but I'm new to arduino and electronics in general. I started gathering all the materials needed for this and before making any purchases I would like to know if it's possible to get a full schematics for this! Your drawing seems to be missing some parts - Is it possible to get the whole schematics ? Thank you in advance!
Mar 17, 2011. 6:42 PMgigsgtox says:
Alls well and good on mine (Thanks for an awesome instruction set and information). I have a potentiometer hooked up, and adjusted the code line and it dims everything EXCEPT the "IT IS" line of code. I currently have this attached to the HIGH as it is always on, however the high is of course, not effected by the PWM. Where should I hook up the "IT IS" LED's to utilize the dimming?
Dec 14, 2011. 9:33 AMRegnillif says:
Hi Scott,

Great tutorial and because of your tutorial I am just finishing up a clock which is my first electronics project. Everything is working correctly except my photo resister dimmer. I adjusted the Arduino code and the lights will dim when it gets dark but after about 7-10seconds the whole clock goes dark. Turn room lights back on and the clock lights up again. Any tips or ideas on what I need to do? I tried a couple different photo resisters but same results.

Thank you
Dec 28, 2011. 8:43 AMpmck says:
I hope this isnt too late you can limit the minimum value of the dimmer in the code like this:

lightLevel = analogRead(**your analog pin IN here**);
mappedlevel = map(lightLevel,0,1000,0,255);

if(mappedlevel<40) mappedlevel =40 ;

analogWrite(**your analog OUT pin here** , mappedlevel);
Dec 29, 2011. 11:04 AMRegnillif says:
Thanks pmck. I did manage to figure it out on my own. Looks like I did something similar to what you suggested. I actually made the clock as a gift so I want to make one for myself now so I will try your suggestion.

Thanks again.
Dec 21, 2011. 10:55 PMTheGeebs says:
Do I just take out the ATmega chip from the arduino and put in the ATMega128 to program?
May 17, 2011. 2:29 AMgeraldongrock says:
Hi all, i basically have zero background on electronics but i really wanna make this for a gift. i need some help here! i understood everything right up till this step. So i have a couple of questions,

1) If i get the Arduino board, i wouldn't be able to fit it inside the frame? Does this mean i have to get the ATMega and all the addons?
2) How does one go about programming the Arduino board?

I'm really confused and don't know what's going on haha, i'll appreciate all the help i can get!
Jun 3, 2011. 10:05 AMmkane says:
You could try make a custom frame for the clock if the arduino didn't fit, the arduino is pretty skinny but I'd say it would be a tight enough fit getting everything to sit nicely inside the frame.
To program the Arduino board you use Arduino software which is very easy to use. You write some code that you want your micro-controller to do and you upload it to the board using a USB.
You should check out the arduino website.. www.arduino.cc! There are also some great tutorials on programming the arduino on youtube!
Sep 3, 2010. 11:05 AMandrea_Stef says:
hello exactly where you installed the potentiometer?
Mar 17, 2011. 6:34 PMgigsgtox says:
Install one lead to High, the other to Gnd, and the analog port to the middle port of the potentiometer.
Mar 10, 2011. 7:11 PMgigsgtox says:
Continuing on Weezie's question, How would you hook it up w/o the ATMega? Should we follow drj's connection showing how the ATMega connects to the Arduino and replace the ATMega points on your freehand sketch w/ the corresponding ones on drj's V2 one-line?

I'm not sure if what I've asked makes sense, I just want to make sure that I get the correct point to point on the Arduino and I'm having a little problem determining how I'd hook it up w/o the ATMega.
Mar 15, 2011. 7:31 PMgigsgtox says:
Nevermind, I figured it out. All works great now, just waiting on the projector sheets to arrive to finish it up and trying to decide if I'm going to add the potentiometer while I wait.
Mar 2, 2011. 6:15 PMtheycallmeweezie says:
Me again! Thanks again for the input on my last question. That was a load off my mind for sure!

Remember how I mentioned that I'm an electronics newb? Yeah, get ready for some more stupid questions!

In the "Materials" step, you mention that one can get an Arduino board or the ATMega. So am I right in assuming that it takes the place of the ATMega, and therefore almost all of this step? Do I still need shift registers, IC's, etc? How about the barrel-plug power connector?

It seems to me that the Arduino already has all of these, though I may just be misunderstanding. Thank you for any guidance you might be able to provide, and for being patient with somebody who's in way over their head here!
Mar 3, 2011. 5:13 PMteebochops says:
If you use the Arduino board instead of the ATMega, you still need the shift registers and driver chips (as these will be used to light your LEDs), but you will not need the voltage regulator, capacitors, crystal, or barrel-plug connector, as these are all mounted on the Arduino board (it has a 5V power pin to power your chips).

And never be afraid to ask questions, it is after all how you learn!
Mar 5, 2011. 10:26 AMtheycallmeweezie says:
Ah, well that actually makes a lot of sense. Thank you very much!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
22
Followers
1
Author:scottbez1(My website)