Friday, 4 November 2011

Word clock

As part of the HackLlan show-and-tell session, we're hoping to get a number of projects finally finished (or at least in a presentable form) and so we're furiously cutting and making, every time the laser cutter gets pulled out of the HackCupboard.

Here's the internal guts for a word clock.

Here it is assembled (missing the top and right-edge struts)

The idea is to place this structure over an array of LEDs (90 in total) which are charlie-plexed by a single PIC 18F2455 microcontroller.
Using the formula pins required = n(n-1) we can work out that we're going to need 10 pins to drive an array of 90 LEDs (10 * (10-1) = 10*9 = 90). It may be possible to drive this array from a cheaper, lower-spec PIC, such as the 16F628A and our chosen chip is probably a bit of over-kill for what we need, but it'll be nice to have extra i/o pins if needed, for extra functionality in future.

Here's how we're driving 90 LEDs:

And the truth-table (which pins to activate) to turn on each individual LED

How does a matrix of 90 LEDs become a clock then?
By simply placing our cell-structure over the leds (so we don't get any light-leakage) and fitting an etched piece of glass/perspex like this over the top:

Light up the LEDs depending on the time - so for half past four, we'd light up LEDs numbered 1,2,3,4,5,6,7,33,34,35,36,64,65,66,67. We'll put a watch crystal inside to keep accurate time, then just convert the current hours and minutes into a selection of LEDs to light up - and use the charlie-plexing routines to make the appropriate lights come on at the correct times. Easy huh?