Having a random pattern is a lot less distracting than having numeric digits staring at you...this would also be a great project for adding to the front or size panels of a PC mod.
Step 1: Overview
The design is based around the case, a low profile 'display' case from Jaycar Electronics (www.jaycar.com.au) catalog number HB6083. If you want to put this clock in another case, you'll have to modify the PCB layout.
A zip file with sourcecode, pcb files in EagleCad format and some pics is included in the project.
Some tracks are a bit narrow and have very little clearance. I built this using press-n-peel film, so it can be done....just take a little care not to smudge things and carefully check the result, scratching out any blurred tracks that might be touching another.
The PCB is designed for two layers, however I constructed this on a single sided board to save effort. There are only a few tracks on top, and these can be dealt with by using hookup wire. Note the picture is a little different from the PCB design in the zip file. The changes were connecting the enable pins of the 74hc154 chips directly to ground and an extra diode to step down the voltage across the supercap to make it closer to the 3.3V required by the RTC chip.
Some handy hints when doing double sided board using single layers is to:
- do as much trackwork on the bottom side as possible
- when laying a track on top, always take it to a via, rather than connecting the top layer track directly to a component.
- when using press-n-peel, print out the silkscreen (in reverse) and iron this to the PCB after drilling and etching. This not only gives you component placement, but if you print the top tracks out as well it is an easy guide for hookup wire. Note the black lines in the PCB below....these would be where the top layer tracks would be.
Step 2: Front Panel Design
My little photo printer created prints a little too narrow to fit the entire case, so a little strip was added to fill it out. It looks OK in this case because the front panel is so minimal.
Step 3: Control Switches
The first switch selects the time set mode, the second selects the digit and the third increments the digit. After changing the time select the first switch again and the clock will run.
The ribbon cable from the switch has 5 lines, vcc/gnd and the three switch inputs. Each switch is momentary closed. On size connects to ground, the other to the switch input line and a resistor pullup to vcc. In other words the inputs are normally high, then pulled low to activate. See the schematic for details on the wiring.
On thing that was useful in using veroboard was that the board itself because the drilling template for the switch holes. Small holes were drilled in exactly the right positions, then squared out with a file. It made a nice fit.
Step 4: Final Assembly
The power supply lead was tied around the bottom mounting post as a strain relief. I've just pocked it out the mounting holes, but you can use a proper grommet if necessary.
That's about it really, the device is powered from a 9V plugpack and sits above my dvd player merrily changing patterns.
Step 5: About the Firmware and Supercap Backup
The firmware initialises io, then reads the every ten seconds or so (you can modify this in the code if you want a quicker update or random update times. I found this period to be the least distracting). If keypresses are detected then it goes into the clock time change routine until exited with a press of switch one.
Also in the design is a space for a supercap. I haven't tested this, but installing one should allow the clock to handle power outages for a short period of time.
In the firmware once the RTC data is read, a routine takes the digit values and assigns a random selection of active LEDs to that digit, the same number as the digit value. These are kept in a table. An interrupt routine takes one value out of the table at a time and sends them to the LED driver chips, and an LED is lit (actually two, one per chip). Next entry to the routine gets another and so on. When run fast enough the LEDs active in the table all appear to be lit at the same time. You can change the timing of the interrupt routine to make it faster if you like.
Have fun, and if you build one of these into something cool...send me a picture.