How I built my Arduino LED Clock

In this post, I will show you how I built this clock which displays the time with 60 RGB LEDs, arranged in a circle. It can be read just like a regular clock, with the red LED indicating the seconds, the green LED the minutes and the blue LEDs the hours. It also has a built-in RTC module which keeps track of the time even when the clock isn’t powered so you don’t have to set it. Since this is only my second DIY/Arduino project (the first being a crude 3x3x3 LED cube), I made quite a lot of mistakes and there’s a lot of room for improvement. You shouldn’t see this article as an exact instruction how to build the clock, but rather as a source of inspiration which you can improve upon.

 

Here are all the parts I needed for the clock:

  • a circular piece of wood (thickness: 14mm, diameter: 30.5cm)
  • a wooden ring with roughly the same diameter as the other piece of wood
  • 60 5mm common anode RGB LEDs
  • perfboard
  • an Arduino Nano
  • a DS3231 Real-Time Clock module
  • six 74HC595 shift registers
  • four BC547B transistors
  • 30 100Ω resistors
  • 15 160Ω resistors
  • a connector for a 9V battery
  • about 8m each of red, green and blue isolated copper wire
  • about 1m of black isolated copper wire
  • silver-coated wire
  • four bolts and nuts for the perfboard and three bolts and six nuts for the RTC module
  • a few spare pieces of wood

These are the tools I used:

  • a soldering iron
  • a wire stripper
  • a drill with 5mm and 6mm drill bits
  • an electric screwdriver (you could also use the drill instead of this)
  • a small saw
  • a glue gun
  • wood glue
  • an acrylic pen

 

These are the two pieces of wood which I used for the clock. Luckily, there were lying around in my garage like that, so I didn’t have to cut them out. The additional flat wooden ring that is attached to the thick wooden ring isn’t necessary, but since it was there, I didn’t bother to remove it and it ended up looking kind of neat in the end.

 

As the first step, I glued the two pieces together with some wood glue, making sure they were aligned correctly. I also treated them with some linseed oil to protect them and give them a darker stain.

 

Next, I prepared the wood for the drilling. The LEDs are inserted through holes from the back of the clock, so I drew a circle and 60 lines from the center of the clock, each line being six degrees from the previous one (6° x 60 = 360°). The intersections of the circle and the lines marked where I would drill the holes.

 

I drilled the holes according to the sketch above: Firstly, I drilled a 6mm hole only about 8mm deep, and then a 5mm hole all the way through. This allowed me to insert the LEDs from the back of the clock so they would stick out a bit on the front, but not fall through the holes.

 

After I drilled the holes, I glued these two pieces made from some spare wood to the back of the clock. The one on the top is for hanging the clock on a wall with a nail, the one on the bottom…

 


…holds the connector for the 9V battery, which I attached to the wood with hot glue.

 

After that, I drew the numbers on the front of the clock using a black acrylic pen.

 

Then, I glued the LEDs in place from the back of the clock with hot glue, bending the anode of the LEDs to the outside and the cathodes to the center. I also fixed four strips of silver-coated wire on the bottom of the wooden ring with some hot glue and later soldered them the anodes. Each strip is for one quarter of the clock so they can be turned on/off independently. Why this is necessary will become apparent later when I explain the wiring.

 

Here you can see the overhang the LEDs have at the front of the clock.

 

With the woodworking and gluing mostly finished, I moved on to the electronics. I soldered all parts to a small piece of perfboard according to the schematic below and also added isolated wire which later leads to the LEDs.

 

 

This is the schematic. I left the LEDs out to avoid it being too convoluted. The shift registers allowed me to turn a serial signal from the Arduino into a parallel output to the cathodes of the LEDs while the transistors can turn the power to the four quarters of anodes on and off.

 

This is the back of the perfboard where I soldered everything. Due to my lack of experience with soldering, it’s not the cleanest job, but it works. Unfortunately, when I was testing the circuit, I accidentally shorted the Arduino and had to replace it, which was quite the ordeal (in this picture, the older one which I shorted is still in place).

 

After the circuit was finished, I connected it to the battery connector and the RTC module and fixed everything to the back of the clock.

 

For the perfboard, I used 4mm bolts. The nuts were used as spacers between the perfboard and the wood (you can’t quite see them in this picture).

 

With the RTC module, I had to get a little more inventive: The module had three holes with a diameter of a little over 2mm which could be used to put 2mm bolts through them. The problem was that I don’t have a 1mm drill bit to prepare a hole for the bolts, so I ended up gluing them upside-down to the wood and using two nuts for each bolt to hold the RTC module in place. It’s not a very elegant solution, but since the bolts don’t have to endure a lot of stress, it works.

 

At this point, it’s time to explain the wiring: The circuit has 15 outputs for each color, which I connected to the corresponding cathodes of the 15 LEDs of one quarter (in the picture, you can see the wiring for the blue LEDs). I then connected the cathodes of the four quarters to each other in the following fashion: The first cathode of quarter one with the first cathode of quarter two, the second cathode of quarter one with the second cathode of quarter two and so on. To complete the circuit, each silver-coated wire to which the anodes are connected was connected with one of the four transistors on the perfboard. This means that I could reduce the 180 outputs you would need if you would have one output for each cathode (60 LEDs x 3 colors) to 45 outputs. To display something on the clock, multiplexing (you might know this technique from LED cubes and matrices) is used: Firstly, the LEDs in the first quarter are powered and receive their signals from the circuit. These signals also reach all the LEDs in the other quarters, but since they have no power, they don’t light up. Then, the power for the first quarter is turned off and the second quarter is powered. It also receives its signals and is turned off again. When the third and fourth quarter have also received their signals this way, the process is repeated all over again. This happens dozens of times in one second and is so fast that the human eye perceives the LEDs which were really only turned on a quarter of the time to be permanently lit. This video also explains the method quite well.

 

This is the finished back of the clock with the green and red wires also connected. Now, everything that’s left is the Arduino code, which you can find here. I used a DS3231 test sketch as a starting point and changed it so it displays the time with the LEDs. It can probably be improved quite a lot, so feel free to change it for your own project.

 

With the Arduino code uploaded, the project was finished! Sadly, after only one day, the battery was already dead, so I’m now powering it with a USB cable. Still, I really like the unique look of the clock and hope that you can draw a bit of inspiration from it!