What time is it?

This is an important question these days. We are running into more situations where timing is important, especially when audio and video codecs are concerned. If there is too much time differential, the codec will unlock. More often, digital transmission methods require precise timing to prevent jitter and dropouts. Some equipment has 10 MHz or 1PPS inputs. Some equipment does not and relies on NTP to keep things in sync.

While searching online for GPS time sever, I came across this post where Austin built a Stratum 1 level time sever with a Raspberry pi and an inexpensive GPS receiver. I thought to myself; damn that sounds interesting. While a Raspberry pi is a hobbyist toy, the same setup can be done with a more serious computer to create a solid NTP server for a facility or LAN.

A little about NTP time servers; Stratum 0 server is directly connected to an atomic clock. Since GPS satellites have atomic clocks, that makes them a Stratum 0 server. Stratum 1 servers are connected to Stratum 0 servers. Stratum 2 servers are connected to Stratum 1 servers and so on. The time accuracy for a Stratum 1 server is 10 microseconds.

First, I wiped my SD card and loaded a fresh install of Raspberry pi OS. Then followed along with the instructions. For this install, I opted for the cheaper GPS receiver, the GT-U7 (not an affiliate link) from Amazon for $10.99. It comes with a cheap little antenna, which actually worked sitting inside on my desktop while I was configuring the software.

This little module is designed for a drone but works well in this application. The 1PPS output looks clean on the scope. Here is the pinout between the GT-U7 and the Raspberry pi:

GT-U7 pinpi pinUseColor
vcc1+3.3 vdcGreen
gnd6groundBrown
txd8rxdOrange
rxd10txdRed
pps12GPIO 18Yellow

I found this really nice aluminum case in a pile of disused junk at a transmitter site. It used to be for a digital TELCO STL circuit. I figured it would be nice to put the Raspberry pi and GPS receiver in a suitable home.

Raspberry pi 3 is mounted on a piece of scrap sheet steel designed to slide into the aluminum case.

We have several of these nice Panasonic GPS antennas left over from various installs. I pressed one into service on the roof of my house.

Panasonic CCAH32ST01 GPS antenna

I think a high-quality antenna is pretty important to get consistent good performance from this setup. There are three slight problems, however. Unfortunately, this antenna has been discontinued by the manufacturer. Also unfortunate, the GT-7U boards have one of those little IPX RF connectors. Fortunately, I found a short jumper with an F SMA connector. Finally, it requires +5 VDC and the GT-7U runs on 3.3 VDC. The pi does have a 5-volt rail, so I used this 2-way power divider to feed 5 volts to the antenna from one port and the received RF from the antenna goes to the GT-U7 from the other port.

If you are interested, here are the commands to get this thing running:

sudo apt get update
sudo apt get upgrade -y
sudo apt install pps-tools gpsd gpsd-clients chrony

The next step is to make sure the serial port is turned on and enable the ssh login shell since this is going to live in the basement and I don’t want to run down there to fool around with it.

sudo raspi-config

Then go to interface options, serial interface, and enable. The login over the serial interface can be left off. If ssh access is needed, enable ssh, then exit.

Once those packages have been downloaded and installed, some config file editing is needed. You may use whichever method you like, I tend to use nano. First, the /etc/config.txt and add the following to the file:

‘dtoverlay=pps-gpio,gpiopin=18’
'enable_uart=1'
'init_uart_baud=9600'

The uart needs to be enabled if you want to receive NMEA data (NMEA stands for National Marine Electronics Association) It is helpful to see if or how the GPS is working.

Next, the /etc/modules and add:

'pps-gpio'

Reboot, then see if the pps module is working:

lsmod | grep pps

The output should look like this:

Next, there are a few more configuration files that need to be edited.

/ect/default/gpsd – there is a default file that comes with the package, it needs to be modified to start the daemon automatically and look for the pps signal on ttyS0.

START_DAEMON="true"
USBAUTO="true"
DEVICES="/dev/ttyS0 /dev/pps0"
GPSD_OPTIONS="-n"

Reboot

Now check and see if the GPS module is working by typing cgps or gpsmon. The output should look something like this:

It did not take the module too long to find and lock onto GPS. If you don’t see something like this in five minutes or so, go back and check your wiring, and make sure that the data connections are made right. The GT-U7 has a little red LED that is lit when the PPS pulse is not being sent. If this light is not on at all, check your power connection. If it is on steady, check your antenna. If it is flashing, but you are not seeing any output in cgps or gpsmon, check your data connections.

Next and last configuration file is the /etc/chrony/chrony.conf file. At the top of the file, I added the following lines:

#custom lines for PPS
server time-a-g.nist.gov iburst
server time-d-g.nist.gov
server 3.us.pool.ntp.org
server time.windows.com
server time.apple.com
# add refclock pps
refclock SMH 0 delay .1 refid NEMA
refclock PPS /dev/pps0 refid PPS
#my home network
allow 192.168.1.0/24

Leave the rest of the file alone. Basically, the time servers are added to compare the GPS time and act as a backup. The hosts on my home network are allowed to query this host and use it as an NTP server.

Restart Chrony:

sudo systemctl restart chrony

Wait a couple of minutes and check the chrony console to see what is happening: chronyc sources. Should look something like this:

This was after the server had been running for a day. Chrony is great because it measures the hardware performance and creates a delay file. This is used to anticipate any hardware-added delays that the system might have. The last sample column is of interest, the number indicates the offset between the local clock and the source at the last measurement. The far column is the margin of error or greatest variation +/- of the expected values. A value of 0.0000000042 seconds or 0.042 microseconds is pretty good for an $11.00 piece of hardware. Now every host in my house is syncd to satellite within 0.042 microseconds, in lockstep through the time-space continuum.

If I were to do this professionally, I would use better hardware. I think the pi 4 has better serial and ethernet interfaces, more RAM, and a quad-core processor. Last I looked they were $75.00 at Newark.

The GPS module was the cheapest I could find on Amazon. I am slightly concerned about the longevity of this device. Perhaps it will run for a long time, or perhaps not. A quick search brought up several “hats” (plug directly into the 20-pin header). These range in price from about $30.00 to $60.00. What is required of any GPS module is 1PPS output. The configuration would be about the same although some use GPIO 4 instead of 18.

HF VHF receiver diplexer

UPDATE and bump:  This post is from eleven years ago, but I have been working on an SDR project using one of the RTL- 2832 chips.  I had to make two more of these units, so the prices and part numbers have been updated.

I have acquired one of those broad-banded software-defined radios, an Icom PCR-1000 to be precise, and all is well.  I am enjoying listening to various MF, HF and VHF radio stations.  However, there is a slight problem.  Very slight, almost too small to even mention, more of an inconvenience than a problem.  Still, if I am being inconvenienced, then others are too.  This issue is with the antennas.  My K9AY antenna works wonderfully from 500 KHz to 25 MHz or so.  My discone antenna works wonderfully from about 30 MHz all the way up to about 1 GHz.  In order to enjoy the full range of the receiver, I need to switch antennas.  I have a small switch on my desktop, but it seems inconvenient to reach over and switch it when going from the AM band to the FM band or something similar.  Therefore, I have decided that I need an HF/VHF receiver diplexer.  One would think that such hardware is ready-made for such instances.   However, nothing I could find commercially would do the trick.

Thus, since I could not buy one, I decided to build one to add to my collection of receiver doo-dads and nick knacks.  The design is relatively easy, a back-to-back low pass/high pass filter system with a 50-ohm impedance throughout.  Something with a sharp cut-off around 30 MHz or so:

Diplexor plot
Diplexor plot

Looks pretty good, 5th order Chebyshev filter, perhaps .1 dB ripple in the pass bands if well made.  Schematically:

HF VHF diplexor schematic diagram
HF VHF diplexor schematic diagram

Then it comes down to the building. Since this is going to be used in the UHF range, care and attention needs to be paid to the layout of the components and the design of the circuit board.  Some of those capacitance values are not standard, however, by using two capacitors in parallel, one can get pretty close.  Since this is going to be used for receiving only, I may be splitting hairs, however, I have found that well-designed and built equipment is worth the extra effort.

The board layout looks like this:

HF VHF receiver diplexer board
HF VHF receiver diplexer board

I tried to keep the traces as close to 50 Ohm impedance as possible.

As one may be able to discern, C2 and C3 are in parallel to make 192 PF, C5 and C6 are in parallel to make 60 PF, and C7 and C8 are in parallel to make 163 PF.

The input and output RF connectors are whatever the builder wants to use, however, I would recommend at least BNC or type N for the VHF/UHF side.  My unit has all type BNC female connectors.   Parts list:

Nomenclature Value Mouser number Cost (USD)
C1 150 PF SMT 581-12065A151FAT2A 0.72
C2 12 PF SMT 581-12061A120JAT2A 0.26
C3 180 PF SMT 810-CGA5C4C0G2J181J 0.27
C4 68 PF SMT 77-VJ1206A680FXACBC 0.59
C5 50 PF SMT 581-12062A500KAT2A 0.41
C6 10 PF SMT 80-C1206C100J2G 0.54
C7 3 PF SMT 581-12061A3R0CAT2A 0.34
C8 160 PF SMT 581-12065A161J 0.34
Case Diecast, 4.3 x 2.3” 546-1590WB 10.71

I chose a smallish, diecast aluminum case, which matches my other receiver gear.  The circuit board noted above is 2.9 x 1.7 inches, which is a little bit small.  I used 18 gauge wire between the input/output connectors and the board.

The inductors were made by hand.  I used a small screwdriver as a winding form, making the turns tightly and then spreading them out to the proper distance.

Inductor chart:

Inductor Value (nH) Diameter (mm) Turns Length (mm)
L1 173 8 6 9.5
L2 468 8 10 9.8
L3 414 8 9 8.7
L4 146 8 5 7.2
L5 186 8 6 8.6

The most expensive part was the circuit board, which cost about $16.00.  The rest parts were about $22.00 including shipping.

As built photos:

HF VHF diplexor with components installed
HF VHF diplexer with components installed

HF VHF diplexer input side
HF VHF diplexer input side

HF VHF diplexer completed.
HF VHF diplexer completed.

I have installed this already and it works great. I will need to get the spectrum analyzer out and run some signals through the various ports to see the attenuation and 3 dB roll-off points.

Making a notch filter

One small RF project that I am working on; a 770 KHz notch filter. I always figure if I am having this problem, then others may be having it too. This is a relatively simple idea, a resonant LC circuit (AKA a tank circuit) tuned to the carrier frequency. It should have a bandwidth of +/- 15 KHz of the design frequency. Another requirement; use the parts I have available. Finally, the environment in which this is to be used is a high-noise room; with lots of computers, LED lights, etc therefore it needs to have excellent RF shielding.

Something like this would work well for anyone that lives around an AM transmitter site and is having problems with receiver sensitivity or transmitter intermodulation.

The basic design looks like this:

Parallel LC tank circuit

Time for a trip to the local storage facility known as “The Barn.” In my backyard, there is a small agricultural structure that is used for storage of just about everything. In The Barn, I found several parts salvaged from an old Energy Onyx Pulsar AM transmitter. As such, they are more than capable of receiver operation and could likely handle a fair amount of RF power in the transmit mode.

CDM F2B 0.01 uF capacitor with back of N connector inputs

Finding a type F2B 0.01 uF capacitor, rated at 2000 volts and 11 amps, the value of the inductor was calculated. For the inductor, a 20 uH coil with taps will work great. For receive-only applications, much smaller-sized components can be chosen. Also, there are many bandstop filters with multiple poles. Those are great, but I like the simplicity of the parallel resonant LC circuit.

20 uH inductor salvaged from Energy Onyx transmitter

The N connectors were salvaged from I don’t know where and the enclosure used to house a power supply for a Radio Systems console.

N connectors for input and output.

For shielding, I sanded the paint off of the enclosure where the lid is attached and tacked some brass screen down with gorilla glue. This will make a good RF contact surface. The outer of the N connectors are bonded to a piece of copper ground strap which also has a grounding lug on it.

Enclosure lid with brass screen to make contact

I used the Libra VNA to tune it up:

S12 shows return loss, S21 shows Phase

The scan shows it is -31 dB on the carrier frequency. It is -17 dB on 760 KHz and -20 dB on 780 KHz. This is good, because I may still want to listen to the station on the remote receiver. According to the smith chart, it is actually resonant on 771.5 KHz, but that is close enough for this application. I think the resonance went up slightly when I put the cover on after the tune-up.

There are several tank circuit calculators online. It is best to have more capacitance and less inductance to keep the Q of the circuit low and suppress the sidebands as well as the carrier.

Who has time to troubleshoot?

The model for Radio Engineering these days is such that one engineer is covering multiple stations in various locations. At the very least, this person has a full (if not overflowing) plate. Thus, when something breaks, the procedure very often is; to pull the suspected module or board, call the manufacturer and order a replacement. That works as long as the manufacturer supports the model in question or has parts. As we all have learned by now, replacement parts are subject to the global supply chain, which is tenuous.

Then there is the question of AM transmitters. Is it worth it to replace an AM transmitter these days? I suggest it would depend on the market and revenue. In some cases, yes. In other cases, keeping the older equipment running makes more sense.

Troubleshooting is becoming a bit of a lost art. In addition to the time it takes, we tend to be unfocused and obsessed with rapid gratification, ready for the next social media post. What is lacking is the ability to take apart the layers of a problem, accept our initial analysis may be flawed, move beyond those assumptions, and work until the issue is solved. Troubleshooting is often like a crime scene investigation. There are several logical steps;

  • Assess the current situation; take steps to ensure it is safe to proceed. Remove all power from the transmitter and don’t work on failed transmission equipment during thunderstorms
  • Gather evidence; look for fault indicators, alarms, automated log entries, burned components, abnormal meter readings, etc
  • Check external factors; power failures, lightning or storm damage, excessive heat, moisture, etc
  • Check internal factors; aged components, bad cables or connectors, improperly seated boards or components, and obvious signs of damage
  • Work from one side of the issue to the other
  • Check the maintenance logs (if there are any) to see if this problem has occurred before and what was the fix
  • Use available resources; troubleshooting guides provided in equipment manuals, factory support, and available test equipment
  • If a failed component is found, make sure that it is the problem and not a symptom of something else

Here is a good example of a recent troubleshooting evolution; I went to change over to transmitter #2 and these fault lights appeared:

DX-50 transmitter, faulted, no power output

The conversion error on the A/D converter indicates why the transmitter power output is zero.

The first step; secure the transmitter, remove all power, etc. Next, consult the book!

The Harris DX-50 manual gives good troubleshooting guidance. This transmitter was manufactured on March 22, 1990. It has been a reliable unit, to date. Section K.4 Analog to Digital Converter (A34) of the manual suggests loss of audio clock frequency sample due to the following;

  • Loose connection with the carrier frequency sample cable coming from the RF drive splitter (A15)
  • Bad or missing jumper connections on P-10, frequency divider section
  • Bad U-29 (74HC161, 4-bit binary counter, only in use if the carrier frequency is above 820 KHz, Not Applicable)
  • Bad U-12 (74HC14, Schmitt trigger)
  • Bad CR13 or 14 (1N914)

Fortunately, there was a working DX-50 about 15 feet away, so I was able to make some measurements at various places on the A/D converter board.

On the working transmitter (DX-50-1), at the RF sample input (input of R83) on the A/D converter board, I see a nice strong sine wave, on frequency:

Carrier from RF drive splitter to A/D converter board
Carrier frequency

Second, I measured the logic pulses on TP-6, as described in the manual. Those look good.

On the non-working transmitter, I made the same measurements and found a fuzzy sine wave way off frequency on the input of R83. The logic pulses on TP-6 was normal.

Definitely lost the RF sample. Since the transmitter is 32 years old, I suspected the cable (#92, RG-188 coax) between the RF drive splitter and the A/D converter had gone bad. Perhaps rubbed through on a rough metal edge or something like that. Several checks with a Fluke DVM showed that there were no shorts to ground or internal conductor shorts. End-to-end checks on both the shield and inner conductor proved good. So, not the cable…

I then went on a bit of a wild goose chase suspecting the output from the oscillator to be low or the drive regulator power supply was defective. The drive level going into the PA was close to normal but slightly lower than the previous maintenance log entry. Also, drivers 8A and 8B were both on, which is not normal and made me suspect the drive regulator.

I made a call to GatesAir and spoke with a factory rep, who had me swap out the A/D converter, oscillator, driver power supply regulator board, and the buffer amp/pre-driver module between the working and non-working transmitter (while the low-power aux was on the air). With the working transmitter close by, I was able to confirm that these boards or modules were not the cause.

Finally, I went back to the RF drive splitter and use my camera to take a picture:

DX-50 RF drive splitter (A15) J-17, board side

There is a 6-pin connector on the underside of the board (J-17). Pin 2 (from the right) is the center conductor and pin 1 is the shield of the cable going to the A/D converter board. Upon closer examination, the solder joint on pin 2 is suspect. I re-heated this connection with a soldering iron and viola, the transmitter started working again.

DX-50, returned to service

The extenuating circumstances; the air conditioning at this site was slowly failing and that part of the transmitter was subjected to heat cycling several times. More recently the HVAC system was in the process of being replaced, of course, on one of the hottest days of the year. This pulled a lot of warm, humid air into the room. Also, as this is transmitter #2, it was not in regular use until recently (we began a procedure for operating on alternating transmitters for two-week periods).

All of this work took place over the course of two and a half days or so. That would be a lot of time for the module swap guys who tend to move on to the next outage quickly. On the other hand, buying a new 50 KW AM transmitter is an expensive proposition these days and there are very long lead times on some of these units. Being persistent and focused paid off in the end.