Freeform LED clock with GPS
Well, clocks are fun to make and can take so many forms, so for now I guess I’ll be making clocks…
This one is less involved than the previous one in terms of components, as it didn’t require anything special for power, but I wanted to do something with a little style, and hopefully a bit of a vintage feel.
This will have no controls, the time getting set automatically using GPS.
Components used:
Attiny85 (more on this later)
IS31FL3731 controller and 16x9 LED matrix, like this one from Adafruit (need both LED matrix and controller)
Small GPS module like these
USB-C module like this one for power supply
Some resistors, I used 2x 4.7K ohms and one 10K ohms
A couple capacitors, 0.33uF
1/32” (0.8mm) and 1/16” (1.6mm) brass rods
Plenty of flux
Display
The 16x9 LED matrix is a neat little panel that can used for all kinds of effects and pixel animations, but I’ll just use it to display a few digits :)
It mates directly to the IS31FL3731 driver board and I soldered them together using some male headers so it’s nice and compact.
TIP!
Cut the header pins before soldering and you might be able to make nice little dome-like joints so it will look super clean and not stick out on either side.
Putting it together
Starting to form the connections, having a plan in my head but then making it up as I go.
For the display, I decided to design a 3D printed bezel that would contain the panel and controller, and provide a thin diffused front. These LED matrices don’t look great without some sort of diffusion.
Turning it over, here are the connections to the display panel, and the GPS breakout attached to the back of the display with a bit of plumbing.
Frame
The frame is made from 1/16” rod. Using a print of the display bezel and some persuasion to form part of the frame/stand. The same method is used for the base, bending the 1/16 rod around a 3D printed pattern.
Finish bending it by hand, a bit of soldering, and the stand comes together.
The required GPS antenna gets attached to the back using a little bracket.
Final result
Resistors, capacitors, and power connector attached. I used 4.7k pull-up resistors for SDA and CLK, and one 10k for RX.
And this is the “I hope it works!” part.
Code and software considerations
I’m not sharing any schematics here, this is pretty simple and they weren’t needed. On the ATTiny85, pin 5 (PB0) is SDA, pin 7 (PB2) is CLK, going to the display, and pin 6 (PB1) is the RX pin for the GPS module. There is no need to deal with a TX pin, since we’re only reading data from the GPS, not transmitting.
I’m using Spence Konde’s ATTinyCore, and that automatically defines a Serial instance with RX on PB1. This is important because we don’t have to use the SoftwareSerial library.
The code is fairly simple, but the biggest issue with using an IC like the ATTiny85 is the limited storage and RAM, with only 8k and 512 bytes respectively. The lack of an easy way to debug (can only do so much with a blinking LED) makes it trickier.
Pro tip: sometimes, things might look alright from the perspective of the compiler, but if your device seems to lock up for no apparent reason, suspect it might just be running out of RAM.
For the display driver, I’m using the library made by Adafruit, but that library comes loaded with their GFX library, which is much too heavy for this little chip, and not needed here, since we’re not using graphic functions or fonts. I modified the library to get rid of all GFX and SPI parts to save some space.
For GPS, I’m using the excellent NeoGPS library. It’s pretty lightweight and super practical, but for the Tiny85 I modified GPSPort.h to disable all specific serial includes and let it default to the built-in “Serial” that’s emulated by the core.
And finally, we’re not using the time library. It’s much too heavy and would not fit, and since this will always be kept in time via GPS, we don’t need to keep time in any other way, or even use a crystal, we’ll just refresh from GPS often enough. We’re only displaying minutes.
And that’s about it :)