A colleague wanted to build a clock. He had a case with a bit of history and wanted to put a simple digital clock inside. A couple of 7 Segment display elements and a ESP8266 should have done the trick. The problem was that he did not find those display elements in the size that would have fit properly. When he told me about it I also searched for a bit and then thought about what it would take to build one myself.
The Plan
I have access to a 3D printer at work that I can also use for random experiments. So I started to play around with a small model that was about 1cm in width and had a recess on one side for a LED and on the other side an opening in the correct shape needed for the 7 segment display.
The seconds part was the electronics. For hours and minutes 4 elements with each 7 LEDs are needed. The ESP8266 that I wanted to use does not have enough pins to address that many directly. To solve this a couple of shift registers can cut down the number of pins required to 3.
If you are wondering why I wanted to use the ESP8266 here are the reasons. First one is that I still had some laying around. They are also small and cheap. But maybe the most important is that they are WiFi capable. That means its easy to connect the the the WiFi to get the time from an NTP server so I would not have to worry about the correct time or what happens if it got unplugged or something.
All in all not to difficult. I tried the 3D printed part with a single LED. The shape of the LED and the openings of the segments are quite different. That leads to a rather incomplete illumination of the segment. One thing that reduces this problem is the Plexiglas that would be in front of it in the end. Even if that did not diffuse the light enough a bit of hot glue to fill up the segment opening would diffuse it enough to get decent looking display.
Building It
First I soldered a resistor to each LED and then put them into the 3D printed base. Then I connected the ground pins of all the LEDs to reduce the clutter a bit.
Of course I added two additional LEDs as a separator between the hour and the minutes. They would be on permanently and did not need to go through the shift registers.
Next step was preparing the shift registers. I thought about addressing them each individually but then decided against it. It would not have made anything easier. So I just chained them all. That felt like a much more streamlined design.
As you can see I am not the most proficient wire organiser. But the whole thing would end up in a case in the end anyway so that is not too big of a problem.
The next part was connecting the LEDs and the shift registers. Without making too many mistakes. It took me a while but I managed to connect everything correctly.
Only thing left was connecting it to the micro-controller. And of course to write the program to actually show the current time. But its just showing the time so that went rather quickly.
As you can see it is sometimes not clear enough which segments are on and the ones that are lit up are unevenly lit. With two layers of Plexiglas in front of them it did look a lot better. Sadly I don’t have pictures of that. If I remember to make some I will add them later.
I really enjoyed making this clock. It was quite a bit of work but it was straight forward, all the components are cheap and it was fun soldering everything together. I also like the look of all the wires going somewhere. Might not be for everyone but I like it.