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.

