Building an APRS Tracker

I’ve been running an APRS RF-to-internet gateway for a few months now. It uses javAPRSSrvr as the gateway program and soundmodem as a soundcard modem, both running on a remote Linux machine. Both programs are very reliable, running for months without a fault. I spent a bit of time trying to get the two programs to communicate over a virtual serial port, but this did not work, so I eventually switched to AX25 kernel-mode support, which worked out of the box on Ubuntu Linux.

I want to track myself using APRS, so I needed a tracker.There are several published hardware and software designs on the Internet, and I originally considered building a tracker based on one of these designs. But I eventually decided to build a tracker that is not based directly on any existing design. Mostly, I wanted to end up with a high-quality and flexible code that could be easily ported to different hardware platforms and to different uses. I’m not yet there, but I’ve got a working prototype that’s running my own code.

One thing I knew I wanted to do was to avoid a modem chip. Some APRS trackers and digipeaters use a modem chip, normally the mx614. A modem microcontroller would be able to produce and decode a 1200b/s AX25 signal in software. There are several trackers that do that already, like Gary Dion’s WhereAVR and Byonics‘ TinyTrak3 and TinyTrak4.

The prototype is running on an microcontroller development board that I use at work for teaching a course on embedded computing. It has an LPC2148 microcontroller, which has an ARM processor, and lots of on-board peripherals. The tracker currently uses almost none of the on-board peripherals except for the LCD screen. The board is connected to a GPS module and to a VHF radio. The GPS is a NEO-5Q module from ublox; it’s mounted on a board that also has a microcontroller and a bunch of other components (a prototype from an old wifi-based tracker project I participated in), but I’m only powering and using the GPS module on this board. The GPS is connected to an external active patch antenna. The radio I’m using is a Baofeng UV-3R, which I bought mainly for this purpose. It cost less than $50 including shipping, considerably cheaper than some dedicated VHF tracker transmitters. The radio is connected to the microcontroller through a little interface board that I built. Both this interface board and the GPS module are currently stuck into a breadboard, with wires connecting the microcontroller board to the breadboard.

The interface board performs 3 functions. It connects the DAC output of the microcontroller to the microphone input of the radio. This signal is routed through a trimmer resistor, to adjust modulation in the radio (it needs a much smaller amplitude than the DAC produces), and though a DC blocking capacitor. The board also routes the audio output of the radio to an ADC pin of the microcontroller, but I haven’t tested this yet. Finally, an open-collector NPN transistor switches the radio to transmit. I had some trouble with this transmit-receive switch: RF would get into the circuit and would keep the radio transmitting long after the microcontroller tried to turn the transistor off. I solved this with two 0.01μF decoupling capacitors on both the base and the collector of the switching transistor.

I used my own software drivers for the microcontroller (for it’s UARTs, DAC, etc.), but I used code from other APRS open-source projects for building up packets and for producing the audio output of the modem. I will release the software once it is more or less stable. I used three codes: Tracker2’s code by Scott Miller of Argent Data, the AX25 code in BeRTOS (a real-time operating system), and soundmodem. I have a lot of positive experience with soundmodem running on the Linux box, so hopefully it will work well on an embedded system. Fortunately, it uses fixed-point arithmetic, rather than floating point which is not supported in hardware on small microcontrollers, so it should work. But I have not tested the demodulator yet. The parts of soundmodem that I’m already using required quite a bit of hacking, unfortunately. I initially tried to keep the modem code as is, but I gave up after a while; the over structure does not work too well in an embedded setting.

I’ve been working on the tracker for a few days, and yesterday it got to the point where it was working on the bench: parsing GPS data, producing packets, and sending them to the radio. The packets were well-formed and my gateway decoded them (actually just some of them;  I’m not sure if the 2W signal from the radio was too weak, or the transmitted audio is not good for some reason). It was time to take the tracker for a ride. I took it to the car and hooked it to the cigarette-ligher’s socket. The LPC2148 board can be powered by up to 15V, and it can produces enough 3.3V power for the GPS, so I assumed everything would work. It did for a while (you can see some position spots in the aprs.fi map on the right), but after a few minutes the tracker started rebooting itself every second or so. I touched the regulators on the board and they were pretty warm, so I’m assuming that one of them overheated, shut down, and caused the system to reset. I guess I can’t power this unit directly from the car’s battery; I’ll need to drop the voltage with an off-board regulator first.

Next, I’m going to work on the AX25 demodulator, hopefully producing a tracker that can also decode packets.

Two Monoband Magnetic Loop Antennas

I recently built two more magnetic loop antennas, both for single bands. I built the first one mostly in order to find a good use for a piece of Heliax (coax with a solid copper shield) that I found discarded. Copper tubing is an excellent material for small loop antennas, so building a loop seemed like a good idea. The Heliax was only 1.60m long, so it only made sense to build a loop for one of the higher HF bands. The main difficulty in building a small loop is to find a suitable capacitor to resonate the loop. I decided to try to build the loop using two capacitors in parallel: a piece of coax that will form a high-voltage fixed capacitor and a small butterfly air-variable capacitor that I had. The butterfly capacitor had too little capacitance to resonate the loop alone. The coax would serve as a fixed capacitor, but I would be able to easily rough-tune it to the band by trimming it.

I decided to build the loop for the 21MHz band, because when I built it a couple of months ago, the higher bands were not open for significant periods of time (this changed later and I re-tuned the loop for the 28-29Mhz band). I soldered the ends of the Heliax to the butterfly capacitor and to a piece of RG-58 coax. This was not easy; I did not have a high-power soldering iron, and the excellent heat conduction of the Heliax’s shield made it difficult to heat it up enough to solder. I eventually managed to solder the capacitor, coax, and Heliax using short pieces of house wiring. It’s not pretty but it worked.

I trimmed the coax capacitor to the correct length using a borrowed antenna analyzer. I tuned earlier loops without one; it’s definitely easier with an analyzer. The coupling loop is the one I use with the coax loop. It’s larger than 1/5 the diameter of the Heliax loop, but it still resulted in impedance close to 50Ω. I set the air variable capacitor to maximum capacitance and trimmed the coax until the antenna resonated just below 21.000MHz. I could now resonate the antenna anywhere on the 21MHz band by tweaking the air variable. I made several contacts on 21MHz with the loop, but after a few days I re-trimmed the coax capacitor all the way to the 28MHz band, which was more active.

The loop with the RG-213 coax capacitor

I noticed something strange in JT65, a mode that transmits for 50s at a time. I would tune the antenna low SWR and transmit. At 10W or below, everything was fine. But at 20W and up, the SWR would rise from near perfect to horrible after a few seconds of transmission. The rise in SWR was rapid but not sudden; it would take several seconds. This was very consistent and it happened on both 21MHz and 28MHz. I realized that the power was doing something bad to the antenna, so I went out to check. There was a slight odor, and the end of the coax stub was burned (and warm). The high voltage across the capacitor was causing current to leak between the inner and outer conductors of the RG-58 coax, and that current was heating up the coax, burning it, and changing its capacitance (which is what caused the antenna to de-tune and the SWR to rise). I replaced the RG-58 with a much more robust RG-213. I tuned it to the band but kept the inner conductor longer by about 1cm than the outer shield, to separate the two conductors even more. The antenna can now withstand high power. I made many contacts with it.

I hoped that the antenna would be better than my coax loop, which is made with LMR-400 coax and N-type connectors, thanks to the solid-copper outer conductor and thanks to the soldered connections between the loop and the tuning capacitor. But on the air, there didn’t seem to be a significant difference between the two. The coax loop is a little larger (80cm diameter vs. 52cm), so maybe that compensates for its disadvantages. The coax loop is more flexible, since with a large air variable and a vernier dial I can tune it all the way from 7MHz to 29MHz, so I don’t use new Heliax loop much any more.

It was still fun to see that I can have reliable SSB and FM contacts (not to mention PSK31 and JT65) using such a small antenna.

An Update: I’ve finally soldered the Heliax directly to the tuning capacitor. I did well with this antenna during a recent contest, in which I made quite a few SSB contacts including to Australia, China, Japan, and quite a few other countries. I’m pretty happy with the antenna now.

The second small loop I built is a PCB loop for 144MHz. I envisioned it as a way to build APRS trackers that are really small: that is, have a small antenna, perhaps in the same plastic enclosure containing the transmitter and the GPS receiver and antenna. Furthermore, if an effective VHF loop can be built on a PCB, the antenna could be etched by a commercial PCB manufacturer, making is relatively easy to duplicate. PCB antennas are very common on UHF. They are also common in RFID tags, some of which work at 13.56MHz (where they are very inefficient but still good enough for RFID). For APRS, the antenna can be fixed-tuned to 144.800MHz, so the tuning capacitor can be fixed rather than variable.

I designed the loop to be a square with beveled edges. The square is 10cm-by-10cm, and the copper loop is 1.5cm wide, to make losses low. I am not actually sure that making the PCB conductor so wide would actually keep losses low, but it seems like a reasonable bet (if somebody can run simulations to determine this, I would be happy to read the results). I was hoping to tune the loop to resonance using a sliding capacitor that I would form from the two open ends of the loop itself and another piece of PCB material sitting on top of it, separated by either a small air gap or some polyethylene. I ended up, however, using a coax-stub capacitor, which you can see in the picture. I also used a gamma match to feed the loop, rather than a coupling loop.

The small piece of PCB was designed to form a tuning capacitor with the ends of the loop, when mouned on top of it

I had a lot of trouble tuning this loop. I started by installing the PCB air capacitor, which I fixed to the loop using nylon screws. My intention was to make slots in the PCB material that would allow me to slide the small piece of PCB up and down to change the capacitance, but initially I used simple holes that fixed the capacitor at maximum capacitance. I connected the loop to an antenna analyzer and tried to find the resonance point. I could not find any resonance point. I moved the gamma match up and down and tried again and again. I replaced the gamma match by a coupling loop. No resonance. I abandoned the project for a few days.

Prototyping the loop took quite a bit of work, to cut the PCB and to file away some of the copper using hand tools, so not being able to get it to work was frustrating. After a few days, I decided to use methods that worked for me on lower bands and to try again. I took apart the hand-made air variable capacitor and soldered a short RG-58 coax stub to the loop. And instead of the antenna analyzer, I used a receiver (in SSB mode) to search for a peak in the noise. I was able to find a weak peak below 144Mhz. I repeatedly shortened the stub and searched for the peak, which slowly rose toward 144MHz. Once it was near, I was able to transmit and to trim the coax to low SWR. The antenna is now tuned to 144.800MHz and gives acceptable SWR over a range of about 0.5Mhz.

The back of the loop, showing the SMA connector

I did some non-scientific comparisons of the loop and a short flexible handy-talkie whip, the 15cm-long Diamond SRH-815. There didn’t seem to be a lot of difference between the two antennas, which was a bit disappointing. So either I didn’t do the comparison properly (entirely possible), or this loop is not much more efficient than a short whip. For most uses a short whip is more practical, so right now I can’t really think of a good reason to use a small PCB loop on VHF. But I’m still happy I was able to get the antenna to work.