Post navigation

Binary-Clock Shield for Raspberry Pi

After completing the GPS-Controlled Binary Clock, I was interested to make a version that synchronised itself with time pulled via the Internet. I reasoned this would be of more interest to people whose offices were buried deep inside buildings, away from any view of the sky. The sensible way to do this would be by connecting the clock to the home or office network, and using the NTP protocol to get the time.

I had a play with ESP8266 modules, which were quite fun (I’ll certainly be using those in a future project or two!) but realised it would be a substantial amount of work to implement a web-based config (configuring access to the Wifi network, and setting the timezone). And it would have potentially been a more complicated circuit than the GPS-version, and wouldn’t have been all that friendly to set up.

Instead, I experimented with turning my Binary-Clock into a shield for a Raspberry Pi. The resulting project is a considerably simpler alternative to the GPS version!

The schematic

The build

I’ve adopted a similar form-factor to the GPS-clock: the front PCB is the same (the matrix of LEDs) so I can use the same board design for both projects.

The rear PCB is a new design. It needs to hold only the MAX7219 display driver, and a socket for the Raspberry Pi. I’ve added mounting holes so that you can fit any model of Raspberry Pi to it. This gives you the choice about whether you’d like to connect the clock to your LAN with a standard Ethernet cable (in which case: choose a Pi with an ethernet socket) or via Wifi (in which case: choose a Pi with wifi support, or add a USB dongle).

I’ve added all the pads for a 40-way connector, but I only use the first 26 of them. So the circuit is compatible with all Raspberry Pi variants, but the extra pins add a bit of extra strength to the mount.

By putting the MAX7219 on the other side of the rear PCB, the components sit nicely between the two PCBs (a bit more “centre-mass”, if you like), leaving the back of the PCB for just the Raspberry Pi.

The component side – just the MAX7219, supporting components, and the DC barrel socket. The front PCB (with the LEDs) drops onto this.

The rear of the clock, where the Raspberry Pi is mounted. The six holes are mounting holes for the Raspberry Pi Zero, or the larger models (but not the very earliest, as that didn’t have any mounting holes).

As you can see – the new PCB design is very simple, and much less stressful to build than the GPS-clock.

I’ve also been able to remove the pushbuttons for adjusting timezone, which feels neater. Instead, the software just uses the Pi’s “local time” – which means that if you’ve configured your Pi to handle daylight savings time for your locale, it’ll switch over automatically.

The support software

It’s dead-simple, and might be useful reference if you want to do GPIO-control with C or C++.

Kit for sale

There’s all the information here if you’d like to build your own (with my blessing!) … but a kit is now available to purchase on Tindie. I have lots of spare boards, and thousands of LEDs to shift! 🙂 The PCBs are nice and easy to solder, and a manufactured PCB always looks nicer than something you put together on stripboard. All profits from these kits (and I’m telling you now: that aint much) goes back into funding more foolish projects for this blog! 🙂