GPS controlled clock based on Raspberry Pi

This is an adjunct to my previous post on creating a Stratum 1 NTP time server with a Raspberry Pi. I finished this project about a year ago, and I have to say it has been running flawlessly since then. I thought that perhaps the inexpensive GPS module designed to work with drones might not hold up. But it has.

Midnight in London

Wouldn’t it be nice to use this time source, not just to set hardware clocks but also display the time in varous places? Yes, yes it would.

Since most of my ideas are not original, I figured a quick internet search may shed some light on how to proceed. Keith, G6NHU did exactly this a year ago or so. His project can be viewed here: https://qso365.co.uk/2023/05/how-to-build-a-shack-clock-using-a-raspberry-pi-and-a-7-touch-display/

As I suspected, with a few more configuration steps, this NTP server can display the time on the native HDMI port as well as create a simple web page available on the LAN for any computer to access with a web browser. The web server is Lighttpd, which is a low CPU load, low memory demon, perfect for an older Raspberry Pi 3.

The display I chose is a 7-inch 16×9 non-touch purchased from Amazon for $33.99: https://www.amazon.com/gp/product/B0BGXB2Y67/ (not an affiliate link)

When I created the NTP server last year, I named it ntpserver. The unit runs headless (no keyboard or monitor) so I use ssh to get into the command line. Thus, the first command is:

ssh ntpserver@192.168.1.200

Once in, always do an update:

sudo apt-get update
sudo apt-get upgrade -y

The following programs need to be added to the Pi:

sudo apt install xorg openbox xserver-xorg xinit unclutter lighttpd -y

If the OS is off the shelf Raspian, then Chromium should already be installed, but if not, then add it:

sudo apt install chromium-browser -y

Once that is done, some things need to be configured. Using whatever text editor you like the xserver so that anyone can access it. Open the Xwrapper file:

sudo nano /etc/X11/Xwrapper.config

Then add line:

allowed_users=anybody

Exit and save. Next open the xserverrc file:

sudo nano /home/ntpserver/.xserverrc

Add the following:

#!/bin/sh
#Start the X server session with no power management so the display never sleeps
exec /usr/bin/X -s 0 -dpms -nolisten tcp "$@"

Exit and save. Next open the xsession file:

sudo nano /home/ntpserver/.xsession

Add the following:

#!/bin/sh
#Start Chromium at startup
chromium-browser --start-fullscreen --window-size=800,480 --disable-infobars --noerrdialogs --incognito --kiosk http://localhost

Exit and save. Note the display size can be configured to any screen resolution. This affects the HDMI port, not the web page. The 7-inch Raspberry Pi monitor that I purchased from Amazon has an 800 x 480 screen resolution. If you are using a different screen resolution, change as needed. Next open the clock.service file (it will be created when you save the file):

sudo nano /etc/systemd/system/clock.service

Add the following:

[Unit]
Description=Clock
After=network-online.target
DefaultDependencies=no

[Service]
User=clock
ExecStart=/usr/bin/startx
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Exit and save.

The web page that will be displayed on the HDMI port as well as served to local hosts on the LAN is a java script page. It was originally developed by Nayuki: https://www.nayuki.io/page/full-screen-clock-javascript You can download whatever format you like from that site (I copied the page source) or you can download a 24-hour format from Keith’s site:

cd /var/www/html
sudo wget https://qsl.net/g6nhu/clock/index.html

The colors can be edited:

sudo nano /var/www/html/index.html

The background, foreground, and font type can be changed as desired.

Next start the clock service and reboot:

sudo systemctl enable clock
sudo systemctl start clock
sudo reboot now

Here is a quick video of the web page on my desktop computer. I have the GPS monitor from the ntpserver up and running in the left upper corner. That shows the GPS data going into the Raspberry Pi from the serial port along with some scratchy WWV audio. The actual clock sync is from the 1PPS output of the GPS module.

I could see this being used as an inexpensive master clock system somewhere. With an HDMI splitter (or a better name would be Distribution Amp), this could be sent to many locations.

Now all I need to do is figure out how to get a GPS synced 10 MHz output capable of driving multiple devices.

Salvaged classic equipment

During the early days of COVID, we were engaged to move a studio out of an old location in a hurry. There had been a long-simmering dispute with the landlord, who finally changed the locks (illegally), but then gave 30 days’ notice, and so on. Regardless, we were building a new studio a few blocks away and were told to take anything usable, which we did.

I noticed the old RCA on-air light for one of the studios and the owner said he’d like to have that installed at the new place. There were two other ones that were not working. In total, we ended up with three of these:

RCA M-11717 on-air warning light

As far as I can tell, they dated from around 1960 and were filthy. Sixty years of dust, dirt, cigarette smoke, etc needed to be scrubbed off of them.

On-air lights cleaned

The original light bulb was a bi-pin 110-volt incandescent lamp. Over the years, the sockets became brittle and fell apart.

Rather than trying to source replacements for the lamp holder, I figured it was easier to install a 12 VDC LED module. That way this would become a low-voltage device and the LED module should last for as long as the studio is in use.

RCA M-11717 on-air light updated
Bench Test
On-air lights install

I took the two best units and installed them in the new studio. One of those units needed minor touchups to the black paint. The third unit’s paint was in bad shape. I opted to strip off all the black paint and repaint it, this time with red.

Incandescent Indicating lamps

What is wrong with this picture?

WBNR equipment rack
WBNR equipment rack

It is a little bit blurry, but the real problem is that none of the indicator lamps on the phasor or antenna monitor are working.  Those little incandescent 387 bulbs burn out frequently.  It is difficult to tell, at a glance, whether the phasor is in daytime or nighttime mode.  One also cannot tell which tower or mode is selected on the antenna monitor.

It is a small job to replace them, but it does take some time.  They currently exist in older transmitters, studio consoles, meter backlighting, and other control indicators.  Since I began working in radio, I have replaced hundreds of these little lamps.  I would rather spend my time on more interesting projects.

The 387 bulbs cost about a dollar each and last less than a year, in most cases.  Fortunately, there is a solution to all this.  Enter the based LED replacement lamp.  These little guys have the long life of an LED (100,000+ hours) in a package that is a direct replacement for the Incandescent lamp.  They run about $5.31 each.

Dialight makes a very handy cross reference:

Dialight Incandescent to LED cross reference
Dialight Incandescent to LED cross reference

The entire cross-reference section is three pages long and is a part of their PMI catalog.  The full cross reference .pdf can be found here.

Those Dialight LED lamps are available from Mouser, Allied, and Newark Electronics.

Time is money.  There are much better things to be doing than going around replacing incandescent indicator bulbs in various pieces of equipment.  At the same time, it is important to know what the status of that equipment is at a glance, which is the reason for using any type of indicator in the first place.  Using drop-in replacement LED indicating lamps with certainly save time and money in the long run.