A couple (cough, maybe three) of years ago, I decided I wanted to build a word clock. I like the idea of something slightly vague about knowing the time, when we have per second accuracy on all internet connected things, and our lives ruled by getting to the next meeting at the right time…
For those that don’t know, a word clock is a grid of letters, with lights behind the letters, that spell out the time. So at 10:34 am it would say “half past ten”. And I’m not talking about a simple LCD matrix display. Something like this:
Being a clock, and fairly simple, word clocks are common(ish) projects, so a bit of google searching can find full up instructables. But, as ever, how much do you learn from following an instructable? Some, but it doesn’t give the opportunity for really getting it wrong and having to figure it out yourself. So I did that instead.
I had the idea of a piece of circuit board, with the letters etched away, and the rest of the copper tinned, and LEDs behind illuminating the required words. And I had access to etching facilities, so I etched some words. The words I laid out using kicad (http://www.kicad-pcb.org/display/KICAD/KiCad+EDA+Software+Suite), having written a piece of Python to arrange the words into different layouts. I also wanted the modifiers to the hours to be first, and then the hours, and then an “o’clock”. The Python code tried a bunch for me, and by hand I picked:
quartertwenty tenhalf5totst pastsixtwelve eighttwoseven tennineeleven midnightthree fouronefive o'clock
I used kicad’s inbuilt fixed pitch fonts, and didn’t want any spaces. It turns out that a full matrix would be 8 x 13 LEDs, so I skimped, deciding that “a couple” of LEDs would be okay behind longer words. This all went well.
I then threw together a PIC + shift register based circuit to illuminate some LEDs.
This didn’t look terrible, apart from the uglyist LED board wiring. I’d already split the concept into an LED board + PIC board, with the idea that the PIC board could fold behind the LED board for neatness in the case.
And, in a crappy cardboard case, it doesn’t look too bad. Lots of bleed between letters, and uneven illumination. Worse, the PIC internal clock didn’t keep decent time over 24 hours,being wrong by at least 5 minutes per day.
And then work got busy, not time for other things etc. etc. The parts then languished in a box for a while, and went through a house move. And then three things happened
- this blog started,
- I played with the LED matrix format, and stopped being scared of it
- I found that RS were doing LEDs at 5p (10p delivered) each.
So I put together an LED matrix, and tried to do it neatly. I didn’t draw up a circuit diagram first, and so went through a number of iterations. The sequence was
- Solder up matrix. Initally I thought I’d have to add lots of links, but forgot that the leads are generally long enough to use as links. I was able to put the entire matrix together without additional wire links.
- Test matrix with battery, be happy with individual wiring and brightness
- Test matrix with PICs + shift registers, be unhappy with overall brightness (too faint)
- Realise that 3 green LEDs (for the “tst” word) had been put in backwards (ie anode/cathode had been swapped)
- Still too faint. Experiment with different flash rates (as individual brightness seemed better) and multiplexing schemes
- Realise that using 74HC595 as current sinks is a bad idea for >1 LED
- Try another multiplexing scheme (ie one LED at a time). Realise that human eye can see flicker with this size matrix if each is driven individually, but too faint if driven in sets of rows or columns. 😦
- Rebuild circuit so that cathodes are all on columns (rather than rows); this involved unsoldering all links and swapping over 😦
- Add ULN2003s as current sinks; still driven by shift registers, but it means that the output of the row driving shift registers sinks into the ULN2003 rather than other shift registers. This allows them to be driven in sets of columns.
Not a trivial amount of debugging. ULN2003 were used because it was what I had to hand.
After all this wailing, and nashing of teeth, the result is:
Doesn’t look as bright as the photos above due to crappy colour balance. But not that there are plenty of LEDs; one per letter! And with the set of words in front:
I feel that this is so much better than the version above. No light bleeding (although that’s mainly a brightness issue; I have a feeling that if I check these cheap LEDs are probably not as bright as the previous ones I used), but very consistant illumination. This is partially down to the fact that because there’s an LED per letter, I can get them all to the same height, not having to move them to illuminate multiple letters.
The PIC board has also been rebuilt; there is a “real time clock” chip present now as well which will provide a hours, minutes and seconds, so the PIC doesn’t have to do any counting at all; all it has to do is ask the RTC chip what the time is. More about this in the next post…