<-- Back to homepage

GPS Accurate Clock with Timezones - 2025-03-25

I have created a clock which is always accurate down to the second, and will never drift or need setting. This is possible due to the fact that all GPS satellites broadcast a hyper-accurate time signal from an atomic clock on board.

IMG_0301.webp

The device uses 4x MAX7219 8x8 displays (purchased 3 of them for $26 AUD on amazon). All four 8x8 modules are controlled via an i2c interface. This was connected to a Raspberry Pi 4. A button was then soldered directly to the RPI 4's headers. The GPS module simply plugged into USB. The components were then hot glued into the 3D Printed case.

IMG_0290.webp

The following pin setup was used:

functiongpiophysical pin
VCC (For display)5V2
GND (For display)GND6
DIN (For display)GPIO1019
CS (For display)GPIO824
CLK (For display)GPIO1123
Button InputGPIO2140
Button GroundGND39

The display displays "HH MM SS GG", where GG is the current number of satellites the device is receiving a signal from. It is best to place the device on a windowsill or near outside in order to receive a signal. If the GPS signal is lost, it continues counting up time until it receives another GPS signal to re-update the time, however the time should not drift unless signal is lost for weeks.

IMG_0295.webp

The RPI 4 is running Raspberry Pi OS Lite 64-bit, and the actual programming of the device is contained inside main.py, which is scheduled to run on boot using crontab ("sudo crontab-e", add the line "@reboot /usr/bin/python3 /home/USER/main.py" replacing USER with your actual user, assuming the script is stored in the home directory.)

Once plugged in, as soon as a GPS signal is heard, the exact time gets displayed. However, despite GPS transmitting an atomically accurate time, due to the overhead of USB and the RPI 4's processing, the time will only be accurate to the second.

The soldered button changes the time-zone. In the script provided, the time-zones available are:

THE END

<-- Back to homepage