It's often said that within ones respective field, building a clock is a worthy test of skill.
For mechanical engineers and machinists, there are challenges abound in the required precision when milling and turning the components that make up a clockwork mechanism. Escapements must be exquisitely balanced. Bearings and bushings bored truer than a barrel. Rough cuts and parts have no place to hide if the mechanism is on show, which you'd hope it is.
For the electrical engineers among us, the challenges in making a truly functional timepiece that can stand alone are still stacked.
There's no point in a clock that needs to have it's time set by updating the Arduino sketch on it every few days, so you'll need solid code.
If your clock does crash, the RTC probably will hold the time, provided your battery backed domain has been properly maintained. Let's hope your setup routine can figure out what's going on when it runs again.
Oh, you checked for all those edge cases that crop up in code when dealing with leap years and daylight savings adjustments, yeah? Even if you think you did, a functional UI should probably make the design spec, just in case you somehow loose the .ino file and need to adjust a slow-running RTC crystal oscillator layout.
I've been caught by every one of those. I think I'm on my fourth clock at the moment. It happens, even when designing something that initially seems quite simple.
Anyone can print numbers to a display, but I think I've made my point that this isn't the deliverable of this exercise.
A well designed clock serves as a worthy reference, so I'm always happy to see timepieces pop up on my timeline, and when I saw the photo below on my feed from Loial Otter, I had to know more about this beautiful build!
At first glance, this project visually resembles something of a steampunk light-saber, but the function is suggested by the first — and initially, only — immediately visible component, the IV-21 VFD (Vacuum Fluorescent Display) tube, with its eight 7-segment digits tucked neatly away within the brass cage work.
The IV-21 is a distinctive bit of glass work, packing eight beautiful, glowing phosphor digits into a 21mm diameter package — it's a striking display, one we've seen on Hacksters pages before, in this ATmega-powered clock that instead uses its PCB substrate for mechanical form.
Speaking of PCBs, it's initially hard to spot where the components charged with controlling the tube are concealed. With the brass cylinder reserved to hold a rechargeable cell, there's little room for anything else inside.
The astute eyed of you may have noticed the familiar, orange tones of polyamide — often found in FPC substrate — peeking out from the structural plates in the assembly. Yup, that's FPC, but those aren't structural plates!
Sandwiched together in a serpentine stack of back-to-back, gold and black semi-flex PCBa are all the hidden parts that are needed to make this clock tick.
This is a complex panel, and it looks like PCBWay have really got the process licked. The design pack for such a board is going to require quite a lot more effort, as does the successful interpretation by the fab house producing it.
We've seen this PCB fabrication method used recently by Carl Bugeja, and his FlexLED project we recently featured. While the work done by Bugeja is of a more experimental track, this project has been an iterative path through design optimization.
With all the family proudly on display for a photo above, we can see that Otter is no stranger to this party. This has been a design subject to a lot of considered thought, and the effort displayed in the design is plain for all to see.
Suffice to say, there aren't many clocks that have a legitimate use for the USB-C connector, as originally specified. As you'd expect, there's no PCI-E or Thunderbolt signals passing through this connector. Instead, Otter has enlisted it here for it's high density pin count, using it to pass not only the USB 2.0 lines to the STM32, but also offer a convenient interface for the SWD lines required for programming and debugging, and of course, to provide a power input.
Driving a VFD tube isn't exactly as straightforward as interfacing to an OLED or LCD with a similar layout. The unique and characteristic glow of a VFD tube is due to the way they work — by slinging electrons at a light emitting phosphor.
For the more curious, there is a great primer from one of the most well known VFD manufacturers here.
The takeaway for us is that you will need to generate a stack of microcontroller-deadly voltages in order to not only heat the cathode filament, but also drive it to the required potential, relative to the the phosphor doped anode.
The conventional way of doing this would be to use a transformer, with the appropriate secondary windings to tap the required rails from. Unfortunately, efforts to source a suitably sized part to fit this design were unsuccessful — it appeared that this part just didn't exist to buy.
There's a great app note from International Rectifier on flyback transformer design, that covers a theory you'll need for your own transformer designs, and it reminds us that at the end of the day, a transformer is really just an inductor with secondary windings.
With this in mind, Otter managed to source an appropriately sized 100uH, un-shielded ferrite-core SMD part, and above, we can see him hand-winding the required secondary coils, in a hack documented in PoC||GTFO19 — the best hacker publication since 2600 in my opinion.
Despite the IV-21 and it's clever power supply perhaps being the most unusual talking points of the design, there's still plenty else here that's noteworthy!
The STM32L496QGI6 running the show has a bevvy of features that make it an obvious choice for this application:
- A Cortex-M4+ processor, clocked at 80MHz
- 1Mbit of co-packaged Flash, and 320Kb RAM
- Up to 136 I/O signal pins, most with 5V tolerance
- An internal RTC provides battery backed timekeeping and 32, 32-bit registers at just 320nA!
That flash comes in pretty handy for Otter, as he's chosen to get this clock counting using CircuitPython — the memory is something of a requirement for the Python platform, but seems to be a worthy trade-off when working with new parts, as Otter raced through the board bring-up, with only the vibration actuator and VFD power supply remaining on the to do list.
While the details of this project are to currently be found on a few Twitter threads, we hear Otter is making way towards making this available as a kit build, once he is happy with the design!
If you're keen to get your hands on one of these magnificent bits of design work, I'd suggest keeping tabs on what he's up to over here.