retroclock
home | about | click me

Overview

This is an electromechanical 7-segment retro nightstand clock. For this project, I wanted to experiment with embedded hardware, real-time-clock (RTC) modules, and printed circuit board (PCB) design. A simulated demo can be found here.

After coming across a video by Proto G Engineering, I was immediately enamored with these displays. I requested a quote from the company AlfaZeta, which makes them.


Originally, I wanted to make an HH:MM:SS clock, which would have needed 6 modules. I only ended up using 4 of them in an HH:MM format because the sound of updating the displays every second would surely drive anyone crazy.

Segment Control

Think of each segment as a solenoid. The polarity across a segment needs to be flipped in order to change its state. Once changed, it stays like this indefinitely. This is why in the thumbnail photo it displays a time, even when not plugged in. This polarity flipping device is called an H-bridge:


Imagine if I powered both A transistors, current flows through the resistor rightward. On the other hand, If I powered both B transistors, current would flows through it leftward. Most simple motor drivers use this circuit to flip its direction.

Module Control

Since each module has 7x 2-pin solenoids, I tied one of each of their pins together. This means I have one common pin, and 1 pin per segment. Then, I can use a half-h bridge on each one of those connections. This is because the logic signals run at 5V, and the segment needs 12V to flip. I ended up using two L293D quadrpule half-H chips per module.

To combine the above logic and display the individual segments into legible numbers, I need a segment layout:


Then a simple truth table denoting which segments should be on for each hexadecimal digit can be made. I didn't end up using this as it defeated the purpose of the artistic aspects of the project. However, it is nice to have this here as a reference. Isn't it a strange coincedence that 7-segments can also display the first 6 letters of the alphabet?


But for my case, I wanted the number display scheme to be more aesthetic. So for each digit, a list of segments can be turned on in a specific order, so it looks like they are being written. Then they can be turned off in that same order to look like they are being erased. (note: -1 is the stop flag)


Here is a video of that fancy writing order in action. Notice that after each segment flips, the program uses purposeful delays so that the display isn't instantaneous. I have a single module counting from 0-9, then a-f, then it repeats. (hint: turn on the audio, it sounds very satisfying!)


To wire up the modules for testing, I soldered a harness using screw terminals that just so happened to fit perfectly. The white wire is the common connection that I talked about earlier. This photo does a good job of also showing the solenoids on each segment.

Multiple Modules

Each module needs 8 logic signals, and there are 4 modules, which means the Arduino doesn't have enough pins to run everything. So for each module, I used an MCP23008 input/output (io) expander. This allows me to hardwire a seperate address offset for each module. Then since all three modules are on the same signal bus, I only need 5 wires to go to all of the modules: Ground, 5V, serial clock (SCL), serial data (SDA), and 12V. The following videos respectively show three and four of said modules counting fast. (photosensitivity warning: flashing lights)

RTC Incorporation

To store the time even when unplugged, a RTC must be used. This works because it has its own clock and battery, which is always on. Every minute, the program gets the time from the clock, and if it is a multiple of 5 minutes, it clears the old time and writes the new one. I did this because while satisfying, even having them update every minute is loud. I also added a check for when it is nighttime(9PM-8AM) and it will only update on the hour. Integrating the clock module was a pain because every time there was an error in the code, I had to update the time of the RTC such that it wasnt a few minutes behind. Here is a video of it changing from 1:59 to 2:00.

PCB Design

Each module needs a PCB to rest on, and each one of those needs to house the control logic. I chose to make a PCB that fits onto the display, and uses pin headers to connect the the controllers. The controllers house the half-h-bridges and the io expanders. Here is my handmade version of the driver:


This was a real pain to solder together, so I figured I should use a service like PCBWay to make the traces for me. I did like the layout of it, and that can be seen in the layout of the final PCB. I also chose to add light emitting diodes (LED) to all of the signal lines. This choice was for both debugging and I thought it looked cool. I designed the following using KiCad:



I had to lift each io expander up from the PCB and solder jumpers to its power input because I made a small mistake with the PCB. Somewhat of a hacky fix, but it ended up working out in the end.

Then those 4 controllers each sit on a frame that holds them all together. While testing, this is the setup that I used to lay them all out. I didn't end up ordering a PCB for this since there would only be one of them. Notice the green wires being used as the address offsets.

The Enclosure

I knew acrylic would be the right way to go because it is simple enough to laser-cut. My first go at the enclosure was not very promising. I was mainly trying to see if the laser cutter worked, and the types of tolerances that I would need to account for in the final design.


I modeled all of the components in OnShape, and then blocked out a simple boxy enclosure to contain everything. Then I thickened each face into its own part. I used the LaserJoint addon to create simple panels with puzzle like joints. Then I used the AutoLayout addon to flatten them onto a sheet to export to the laser cutter.


If you are wondering why the side view is C-shaped, do not fret! It is very intentional. Since this is a nightstand clock, I was planning on having this be a place where I could place my watch:


Also, while some have said it looks tacky, I like the idea of being able to see inside the clock. I spent a lot of time on it, and its cool to see whats going on inside, even if its just electronics. Here is the exploded view: