KFRT's Dot Clock
PIC Based L.E.D. Clock

Building the display
Wiring the display
Wiring, Pt 2

When I first got interested in digital electronics in the 70's, this was one of the first things I wanted to build. An analog clock that used LED's for the "hands." I actually got started on it back then; had a circuit roughed out using decade counters and an oscillator. Even started building one when other things in life got more intersting. My idea was to use some copper quilting rings. I soldered the LED's to the rings and used the rings as a common bus, and to keep the LED's in a circle. Never even got real close to finishing it.

In 2006, I wanted to learn a little about PIC's and this seemed like the perfect project. I could multiplex a 12 x 12 array of LED's using 24 output pins to give me a 24-hour display (60 + 60 + 24) for the hands. The PIC16F917 seemed about ideal for this because it has 33 GPIO lines, leaving some left over for time setting buttons and the like.

The packaging is all done in ABS sheet plastic and Plexiglass. These are somewhat "tedious" to build. The clock is packaged in a plastic "sandwich" with the LED's super-glued into ABS plastic. A smoked Plexiglass sheet covers the ABS, and a sheet of clear Plexiglass sits behind the electronics to protect the wiring and allows the clock to sit easily on a shelf. Each sheet is 12" x 12" and 1/4" thick. The front Plexiglass hides any flaws in the ABS and gives the clock a pure black look. Each LED hole is drilled through the ABS and into the smoked Plexiglass just a bit. This is done because the T1-3/4 size LED's are just a little deeper than 1/4". It also helps spread the light a little for a wider viewing angle (or so I rationalize).

The holes have to be drilled almost perfectly, or the finished clock will look pretty bad. For this, I made a paper template. Starting with a 12x12" piece of construction paper, the center is marked and three circles drawn with diameters of 7, 9 and 11 inches. This puts one inch between each "hand" of the clock and leaves a half inch between the outer second hand and the outer edge of the clock. Radial lines are then drawn every 6 degrees on the outer two hands and every 15 degrees on the inner hand. This really requires a compass and protractor and it took me about an hour to make one template. Marks are made in the four corners for the bolts that hold everything together.

Once the template is made, it is glued to the BACK side of the ABS sheet using spray adhesive. It is critical to get the template aligned perfectly. Then, the ABS sheet is lined up with the smoked Plexiglass sheet and taped together on the edges only, with duct tape (it's always handy!).

Drilling the LED holes really requires a drill press with a depth limit. The holes need to be drilled completely through the ABS and into the Plexiglass, but not through the Plexiglass. And, for it to look good, they all have to be the same depth. Once the 144 LED holes are drilled, the third sheet of Plexiglass is taped to the "sandwich" and the four 1/4" corner holes are drilled completely through all three pieces. It's helpful here to put an alignment mark on the three pieces -- just a line on the edge with a Sharpie. This will make it easier to put them back together later.

Once all the holes are drilled, the duct tape and paper template can be removed and the front and back Plexiglass pieces can be set aside. Now, the LEDs can be glued into the holes. The critical thing here is to align them all properly to make it easy to wire. The T1-3/4 discrete LEDs have one lead longer than the other and have a flat spot on one edge of the mounting lip. The flat spot corresponds to the short lead, and the LEDs are mounted with the flat spot towards the outside edge of the clock. After building a couple of these, I found it easiest to put all the LEDs in the holes first, then check them for proper alignment before gluing. Super glue will go into the "cracks" easy enough with the LEDs already mounted. Putting a small drop at the edge of each LED and then putting pressure on the back of the LED with a pen for a few seconds seemed to work well. It will take just about one full 2 gram tube of the glue for this clock. On ABS, Super Glue works as a solvent and will melt the ABS and the LED together. Once the glue is there, the LED is really fixed quite permanently.

The next step is to wire the LED matrix together. This is a long job, and there's no room for mistakes.

The electronics part of the project is very simple. The driver board consists of the PIC processor, an oscillator, a few switches, a pair of line drivers and a few connectors. The second board is just a commercial 5V power supply (the black wires carry the 120 volts from the wall socket). Oh, but WAIT! There's a little more circuitry in the upper left corner of the driver board. We'll get to that in a minute.

This picture illustrates the driver board farily well. There are two switches and three buttons on the left side that are used to set the time and mode of the clock. These are really just inputs to the processor, and what they do is defined by the software. The big IC in the middle of the board is the PIC16F917. To the right of that is a pair of ULN2803A line drivers. The real purpose of these is to keep most of the LED current draw away from the PIC IC. I'm not sure they're really needed, but cheap insurance... There are three connectors on the board. The one on the left (with the red wires) is the 5VDC input from the power supply. This MIGHT draw about a quarter of an amp, but I doubt it's that much. The power supply I'm using is a 2-amp supply, so it's way overdesigned. The 6-pin connector on the upper-left part of the board is a connection to the PIC programmer / debugger. This is how we put the software in the PIC16F917's flash memory. The 26-pin dual-row header on the right is where the display connects. Only 24 of the pins are used, so there's room for expansion! The little square thingy just below the 6-pin connector is a 20MHz clock module. This runs the PIC, and not incidentally, gives us the time base for our clock.

So, what are those extra parts in the upper left corner?

Three components. The blue disk is a .22 farad, 5.5 volt electrolytic capacitor (Newark 27M9819, 96 cents). You have to look to see the watch crystal (Newark 59K7602, 73 cents). The little square IC is a Maxim DS1302S real-time clock chip (Newark 23K3479, $3.48). For $5.17, we get a complete redundant clock circuit. The beauty of this is the Maxim chip manages it all, and runs on nano-power. The little .22 farad capaicitor will run the Maxim chip for days, if not weeks, and the Maxim chip will keep the capacitor charged. This circuit runs with the power OFF (for several days, at least), and requires no batteries, so it's maintenance-free.

What does this mean? Very simply, it means that the clock can lose power and it will set itself when the power comes back on. This is the clock circuit that every VCR ever made is missing!

This site tested with Mozilla Firefox 3.5.6
Page last updated 16 July 2010