My SO’s been bugging me for a while to find a decent, highly visible clock for the loungeroom. I’d seen some fancy new segmented LED displays from Adafruit appear online, and wanted to try them out, I decided to take the complicated route with the clock and build one myself – here’s the journey.

Here are the displays – the 0.56″ 7-segment LED backpack (two of these) and the 0.54″ alphanumeric LED backpack. They’re almost identical in size (a couple of millimetres difference, depending on how accurately you solder the displays to the backpacks), and look great together in a project.

These displays use I2C, a 2-wire serial interface. I2C uses two pins (SDA and SCL) to sync up and transfer data back and forth, and each device has a unique ‘address’ that each command is sent to – these displays use solder jumpers on the reverse side to set which address from a preset list they will respond to. If you have multiple I2C devices that use the same address, or use enough of the same device that you run out of unique addresses to use, I2C multiplexers do exist – but for a tiny project like this, that’s a bit overkill.

The alphanumeric display has an additional fifth pin, which is Vi2c – you can power this display from 5V, but control it from a 3V logic level, if your microcontroller runs from less than 5V. Everything in this project is 5V though.

This little gadget is a DS3231 real-time clock module, another recent Adafruit part. I bought this one specifically because it breaks out the positive side of its coin cell, and I was going to use that to power another (much tinier) clock, but that’s a story for another post. The DS3231 is another I2C device, so it will work well in this project.

The last piece of the puzzle. This is a cheap clone of the Pro Micro – it’s powered by an Atmel 32U4, the same as a Leonardo, on a tiny board. You can get these pretty cheaply – I pay about AU$12 each from a local seller on eBay. You can never have enough of these – they’re great for little one-off projects, and can be easily soldered to small protoboards, or just kept on a breadboard…

…which is exactly what I did. Here’s the entirety of this project’s electronics – the Pro Micro and RTC fit perfectly on a half-size breadboard, with plenty of wiggle room for a micro-USB cable to run in and power the whole thing. Here’s where the whole project sat for a couple of weeks while I planned out the enclosure.

(I’m Australian, by the way – that date is the 4th of May, not the 5th of April.)

These displays can be a little difficult to photograph – any ISO level above about 100 and they’ll flicker like mad on-screen, and appear dim or partially off in each photo.

The 3D model is pretty terrible, especially with the electronics, but it gave me enough of an idea to be confident it would all go together. My chief concern was where the jumper wires and their headers would be, as there wasn’t going to be room inside to have one above the other. All the header pins on the LED displays are somewhere down the middle of everything, with the breadboard connections off to either side, so it all worked out in the end. I could’ve had a PCB designed and made, and hard-wired everything to it to save space, but with the clock the way it is, practically everything is removable and reusable (if I wanted to swap out the LED displays with different coloured ones, or something).

The enclosure is basically a sandwich of laser-cut acrylic parts – a front plate with 3 large openings for the displays and six 3mm screw holes, a set of inner surrounds that would fit around a set of M3 standoffs, and a backplate for everything to screw into, and for the breadboard to stick to.

Here’s what was actually sent off to be ‘cut’ – the pink and red lines form the actual cutting instructions, while the black outline on the backplate was a small engraved area to help me accurately stick the breadboard into it. You can see a small cut-out on the bottom edge of the backplate – this is the gap for the USB cable to escape the enclosure.

The parts arrived, cut from a single sheet of clear acrylic. (The brown is just protective paper on each side of the sheet – after peeling this off, the parts are crystal clear.) Laser cutting is a subtractive manufacturing process, so if you specify a hole of a particular size, what you’ll get back is a hole that’s very slightly larger by a few tenths of a millimetre – this means a 3mm hole will perfectly fit an M3 screw, and a 5mm wide standoff will sit perfectly inside a 5mm cutout as well.

I ordered two copies of the face plate, because I was a little worried about how the LEDs would fit…

But I shouldn’t have worried – they fit like a glove. They slide in easily, but jam up at even the slightest angle; they’re never going to fall out on their own.

Early on in the project, I’d considered adding a way to adjust the brightness of these displays, either with a dial of some kind or something automatic with a light-dependent resistor. I could’ve done it the latter way, especially with the transparent enclosure, but I eventually decided to just keep it simple.

I’m using “4.5mm” clear acrylic, which is actually closer to 4.3mm in depth. I’ve had a few parts cut before, so I had them on hand to measure. Nine of these parts stacked together combine to about 38mm in height, so I ordered some 38mm standoffs… which was a journey in itself – at first they were out of stock, then they took forever in the mail, then they were opened and inspected by customs, then they took more forever before finally arriving.

Totally worth the wait though – they’re perfect for this project. In the first photo here, the breadboard is already on the backplate, with the six standoffs already screwed down. Then, one ‘middle’ is threaded onto the standoffs, and the USB cable is neatly tucked through its hole in the backplate.

More middle pieces going on. I was pleasantly surprised with how well everything fit together.

All nine middle pieces in place. The top of the 9th piece is about a millimetre taller than the standoffs, in the end – it was pretty perfect.

The LED displays plugged into the breadboard. I love I2C – it’s almost like USB for microcontrollers, just the same four wires over and over. You’ll notice the date has jumped forward more than a month from the previous photos – those standoffs really did take ages to arrive.

Things are really taking shape here. The LEDs are tucked into the faceplate and the remaining hardware is ready.

I’d originally ordered some fancier-looking, 20mm long bolts to hold everything together, but the standoffs aren’t threaded through the whole length, so the bolts just didn’t go far enough in to hold everything together. So instead of waiting any longer, I just used these spare M3x10mm screws I had lying around.

And here it is, finally assembled and powered on! The neat little red sockets are there just for a bit of flair. They only came in a pack of 10, and were for another project initially, and I couldn’t be bothered with ordering more and waiting yet longer for them to arrive, so there’s only the six on the front.

Still life with desk clutter. This clock will eventually live on the bookshelf out in the loungeroom, acting as a lighthouse for midnight kitchen wanderers.

The whole thing pulls 150mA at 5.1V, or at least it does at 2 in the afternoon on a Friday. Any wall charger with a USB port should be able to run this, and if I ever want to reprogram it (or fix the time after replacing the battery), I can just plug it directly into my PC.

The acrylic casing (about 5mm thick at the edges, and each layer is 4.3mm deep) does add some heft to the clock – the whole thing is about 233 grams, or just over eight ounces. It feels way more solid than any breadboard-based project has any right to be, and thoroughly outweighs the USB cable attached to it, so it’s not going to fall over of its own accord.

I’ll post the code below once I’ve tidied it up a bit (it was written over a month ago and needs some cleaning).