The "CT" MedFER Beacon
A PIC-Based MedFER beacon operating PSK31
on 1704.963-ish kHz

Update:  Software version 2.0x is now available:  The message is now programmable via an RS-232 port.  Newer version 2.04 is now available-

See below for more details!

Abstract:

These pages describe a means whereby a PIC16x84 processor may be used to generate a PSK31 or FSK31 signal.  This could be used for beacon transmissions (as described here) or they may be used for telemetry, experimental, or even QSOs - the latter being true if you are willing to put up with a few "quirks":-) 

Comment:

 

Why tie up an entire computer/radio to set up a PSK/FSK MedFER/LowFER beacon?

This is the question that I asked myself.  While my HF rig is capable operating in the MedFER frequency range, it seemed foolish to tie it up in this fashion, and it would tie up an entire computer/sound card/ect.  Having operated beacons in the past, I feel that the lower the "hassle factor" involved in operating the beacon, the more likely it is that you will keep it on the air - and that is the entire purpose of even attempting to operate a beacon.

When I decided to put a PSK31 MedFER beacon on the air this time around, I decided to follow my previously-established philosophy:  I wanted a beacon that could send a message in PSK31, and just work when plugged in.  To generate the PSK31 data, I decided to utilize the now-ubiquitous PIC processor and incorporate it with other fairly simple circuitry.

(As for the question of "why operate a beacon, anyway?" - I don't really have a good answer...  Take a look at the "CT" Lowfer Beacon archive page for a possible insight as to the psychology of it all.)

The new (and old) software versions:

There are now two versions of the software available:  The "Legacy" version 1.0, and the "new" 2.0:

To jump to the source code links, click here.


Designing the circuit - using it for both PSK31 and FSK31:

FSK31 exciter:

When I originally designed the circuit,  several steps were involved in the development.  The first PSK31 transmitter prototype did not have any amplitude modulation:  The "Data Output" (varicode) bit was simply applied to one input of an XOR gate, the RF carrier was applied to another, and a receiver was coupled to the gate's output.  The result of this is a PSK31 signal - but a very dirty one!  Using this method every time the phase shifts there is a "click" that produces a splatter far and wide.  The intent of this circuit was simply to verify that the varicode generator routines were operating properly.

As it turns out the "Data Output" bit in the original prototype is still present:  You can find this bit on PB3 (pin 9) of the PIC and it is active in either the "Balanced Modulator" mode or the "AM" mode.  While using this bit to generate a PSK signal would require additional filtering (hence the PWM method described below) it is perfect for generating FSK31:  One need only apply this signal to a frequency-shifting network and you have an instant FSK31 transmitter!  An example is shown on the FSK31 Exciter pageThis page also gives an example of how one may interface the PIC with an RS-232 serial connection using the Version 2.0x software.

FSK31 isn't recommended for particularly critical or uses where the best weak-signal performance is required.  It is most appropriate where one needs to use the simplest circuit due to space or time constraints.  For an explanation of how FSK31 differs from PSK31 (and its deficiencies) read FSK31 Explained and FSK - both are messages posted by Peter, G3PLX, the inventor of PSK31 as we know it.

I also wanted to be able to generate as good quality a PSK31 signal as full-blown hardware did, so it would be necessary to amplitude modulate the signal as well has phase modulate it.  There occurred to me to be at least two ways that this could easily be done.

PSK31 - The Balanced Modulator Method:

Using a balanced modulator is an obvious solution:  It can modulate both amplitude and phase in exactly the way that is required for PSK31:  One need only apply RF and the appropriate baseband modulating signal and the result is a PSK31 signal. This can be done with either a diode modulator (a singly or doubly-balanced modulator) or an IC of similar function, such as the venerable '1496.

This method works well to generate low-level RF signals, but linear amplification is necessary to develop additional RF power.  If, as in the case of a LowFER or MedFER beacon, transmitter efficiency is highly important (keep in mind that Part 15 specifies input power and not output power!) linear amplifiers would result in 1-2 db lower output power than could be obtained from a high efficiency switching-type P.A.  A description of the prototype "balanced modulator" exciter (with schematic and pictures) is available here.

PSK31 - The Amplitude Modulator Method - Schematic Diagram:

Simply shifting the phase of the carrier by 180 degrees instantaneously (i.e. using an XOR gate for BPSK modulation) results in the generation of considerable sideband energy (i.e. clicking.)  If one were to lower the power to zero, do the phase shift, and then return the power to normal (using a cosine envelope to do the modulation,) the effect of the click is eliminated and one may use an efficient (but nonlinear) power amplifier.  This scheme is used on the transmitter described below.

In the simplest sense, this modulation scheme somewhat resembles the HELAPS (High Efficiency Linear Amplification using Parametric Synthesis) scheme devised originally by AMSAT for use on the OSCAR spacecraft where the highest power efficiency was required in that the amplitude and phase information are modulated separately.  While it wasn't required that power consumption be absolutely minimized, it was convenient to use an efficient and simple means of generating the RF.
 

To do either the "Balanced modulator" or "Amplitude modulator"  methods there need to be some carefully constructed baseband signals applied to the appropriate circuits.
 
What is baseband, anyway?

A "baseband" signal, simply put, is that which is applied to a transmitter/modulator to impose information on the carrier being transmitted.  An example of this would be the on-off signal of a CW transmitter, the audio of an SSB, FM or AM transmitter, the video of a television transmitter, or the "raw" data in a modem.  In a more complex modulation scheme (such as QPSK) there may be even be more than one baseband channel.

Generating the Baseband Signal:

The above are but two ways to generate the properly-shaped BPSK signal.  How does one go about generating the proper baseband signal to modulate the data onto the carrier?  Clearly, when you use a computer, some means of Digital to Analog (D/A) conversion is required.  Here are several ways to make a D/A converter:

When Peter Martinez, G3PLX, devised PSK31, he made the job of designing the transmitter simpler by decreeing (in the article PSK31 Fundamentals) that the transmit waveform be cosine-shaped.  Unlike other digital modulation schemes (such as 9600 baud packet, some of the satellite modems, etc.) where the shape current bit being transmitted is influenced by previous (and future!) bits, one doesn't need to buffer the bits to keep track of what is to be sent with PSK31.  This greatly reduces the resources required of a fairly "small" processor like a PIC.  The onus is placed on the receiving system to provide the "matched" filter required to extract optimal performance from the received signal.

Generating the Actual Bits:
 
For more specific information on the inner-workings of PSK31, visit the  The PSK31 Official Homepage - Articles about PSK31 and read the articles posted there.

There is the issue of generating the actual bits to send data.  This, too, is done by the PIC.  Fortunately, this is a fairly simple part of the puzzle:  Converting ASCII data into the PSK31 Varicode is only moderately more difficult than looking the codes up in a table:  One simply needs to follow the rules that govern the varicode's construction (i.e. no character contains two consecutive zeros, etc.)

In the case of this beacon, the message is sent from the EEPROM contained on the processor (a PIC16x84) which allows for up to 64 characters.  In addition to this, the start of the message is preceded by a "preamble" of about 80 "zeros" (i.e. phase shifts) to permit programs so-equipped to display an intermod measurement. This preamble also makes for a very distinctive "warble" that allow easy identification of the PSK31 beacon's signal if all you have is your ear to listen for it.

Description of the transmitter:

A schematic of the actual AM-type PSK31 transmitter may be found here.  This is the schematic of the actual prototype shown in the pictures on the PSK MedFER pageNote that this schematic (version 1.01) has been slightly modified:  A series diode has been added on the "tuneup" jumper to more closely resemble the "peaks" of the transmit waveform.

The PIC processor:
 
"Why not use the processor crystal as the transmit crystal as well?"

I thought about this (especially for the "balanced modulator" version) but there are several things to consider: 

  • The processor crystal precisely determines the bit rate of the PSK31 signal.  If you change the crystal frequency, you will have to (carefully!) recalculate and adjust the timing in the software to accommodate the change.
  • For a Class-E amplifier, you need the proper duty-cycle for it to work at best efficiency.  Achieving this with some frequency/divisor combinations will likely require a complete redesign of the amplifier.
Since the source code/schematic is available, you could certainly do these things, but in the interest of "replicatability" I decided to use separate oscillators.

A PIC16C84 was used for the processor (the 16F84 will work fine:  It's just that I bought a rail of 16C84's a couple of years ago and I use them whenever I can...) and it is clocked at the NTSC colorburst frequency of approx. 3.58 MHz.  This processor uses PWM techniques to generate an analog voltage at pin PA3.  A simple 2-pole R/C filter follows to both provide integration/smoothing of the PWM voltage as well as provide lowpass filtering.  The PWM sampling rate is 1 kHz which is 32 times the bit rate.  Therefore, every bit transmitted is represented by 32 discrete voltages before filtering/smoothing.

U1, an LM324 quad OP amp amplifies the PWM-generated analog voltage:  The LM324 is chosen for its ability to swing down to the negative supply rail.  The GAIN control and OFFSET are used to amplify the voltage swing of the PWM-generated voltage to 0-10 volts (approximately) for modulation of the final stage.  These two controls should be adjusted such that the RF power just goes to zero on the bottom of the modulation swing and the waveform does not clip on either extreme of the modulation swing (an oscilloscope is a MUST for proper adjustment.)  The "tuneup jumper" may be installed to aid in setting the GAIN control to provide a +10 volt output.

The RF chain:

The RF chain begins with a crystal oscillator operating at 4 times the operating frequency.  Q1 and Q2 form the oscillator and buffer/amplifier (respectively) and feed U3, a 74HC4017 decade counter.  U3 is wired as a divide-by-four counter and it provides two 25% duty cycle waveforms that are 180 degrees apart.  U4 is a 74HC00 quad NAND gate that selects which of the two phases produced by U3 are to be fed to Q3, the P.A. and is the means by which the RF is modulated with the BPSK signal.

Q3 is the final amplifier.  In this transmitter, I used a BS170 HEXFET - but practically any N-channel power MOSFET will work (like a 2N7000, IRF510, etc.)  If significantly lower efficiency can be tolerated, an NPN bipolar transistor (such as a 2N3904 or 2N2222) may be substituted if a 100-330 ohm resistor is put in in series with the base.

The P.A. stage is operated in a class-E switching mode to achieve maximum efficiency.  In this mode the object is to not switch the transistor on while current is flowing:  The resonant circuit (consisting of the 125 uH inductor and the variable capacitor) is tuned such that just as the RF "flywheels" to zero the transistor is switched on, avoiding the resistive losses in the transistor.  The 25% duty cycle RF drive signal provided by U3 is crucial to the proper operation of this amplifier in class-E mode to "time" the turning-on of the transistor just as the voltage hits zero.

The final amplifier inductor is tapped in numerous places to provide a match to the antenna system's feedpoint impedance which will probably not be 50 ohms!  The 125 uH inductor should be fairly low loss (I used a fairly large toroid) and it isn't ultra critical.  This value is chosen to provide maximum efficiency in the 1600-1700 kHz frequency range at 0.1 watts of input power.  If reasonable care is taken, well over 90% P.A. efficiency may be expected.

The rest of the circuit:

Since one of the intents of the beacon is to "set and forget" it, it is best to have some sort of protection to maximize reliability.  For the P.A. this is provided by the 1 meg bleeder resistor and the neon lamp on the antenna output to discharge antenna wind static as well as clamp any nearby lightning strikes.  The power supply is protected with inductors and capacitors:  These prevent extraneous RF from being conducted into/out of the transmitter and go a long way to prevent nearby lighning-induced spikes from the power supply line from getting into the transmitter.

The output of U4 is isolated from Q3, the P.A. transistor, by a capacitor.  A diode and resistor keep the transistor from being "stuck" in an on state and keep the drive signal in "positive" territory:  Without these components the current could destroy Q3 and the 10 ohm resistor in the drain supply line should the oscillator stop and leave U3 in the "on" state.

The emitter-follower Q4 gives the LM324 enough current capability to drive the P.A. as well as protect it somewhat from lightning/static discharge.  The 10 ohm resistor is used as a shunt resistor to provide an easy means to measure the current being drawn by the P.A.

Setting up the transmitter:

Tuneup of the transmitter is fairly simple:

  1. The capacitor in series with the crystal is used for "netting" the operating frequency precisely (if desired).
  2. The gain and offset controls are adjusted iteratively so the emitter of Q4 just reaches 10 volts on the high side and zero volts on the low side.  This adjustment is most easily done using a calibrated oscilliscope but may be done with reasonable success by watching the IMD reading on a PSK31 receive program.  Note that when the "tuneup jumper" is connected, the emitter of Q4 should be 10.1 volts.
  3. The P.A. is tuned up as follows:  With no antenna load connected, connect "tuneup jumper" and measure the voltage across the 10 ohm resistor (to measure current) and adjust the trimmer capacitor at the drain of Q3 to minimize (null) the current consumption.  (Hey, this is like "dipping" the final...)
  4. Upon installing the transmitter, connect the antenna loading coil to a midpoint tap and tune the loading coil of the antenna for maximum current flow (i.e. resonance) with the jumper (mentioned above) installed.  At this point, measure the voltage across the 10 ohm resistor.  Change the coil tap for 100 millivolts (10 milliamps through the resistor) and readjust the tuning of the loading coil.  Repeat this iteration until, when the loading coil is tuned for maximum antenna current, the voltage drop across the resistor is 100 millivolts, corresponding to 10 milliamps of drain current (100 milliwatts input at 10 volts.)  As it just happens to turn out, this results in a pretty good match when properly done.


NOTE:

Additional comments:

There are numerous modifications that may be made to this circuit.  Here are but a few possibilities:

Actual off-air display of IMD reading using this transmitter.
Actual off-air IMD reading of the PIC-based transmitter as displayed by the PSK31SBW program, Version 1.08



On the air:

On the air, this transmitter sounds as good as the best signals on the air. Originally, the IMD reading generated by the PSK31SBW program during the "zeros" portion of the transmission showed only 18 db or so.  This wasn't particularly good, compared to the average number of 25-30 db or so as found with typical HF gear.  Finally, I got around to fixing the problem:  The AM waveform was incorrect - it was a complete sine wave:  It should have been a "half" sine wave.  This problem was first suggested by another amateur (thanks Johan) and was alluded to in G3PLK's documentation (I should have read this more closely...) and, after only a year or so, I finally got around to fixing it.

This fix wasn't simply a matter of calculating a new table and sticking it into the program:  The very simple R/C lowpass/data filter has very poor characteristics (owing to its extreme simplicity) and some inherent nonlinearity in the PWM D/A conversion caused a bit of distortion with the "half-sine" waveform.  The simple fix was to "predistort" the waveform going into the filter to account for the filter's distortion.  The result?  A waveform that comes out just as it should.  Because of this predistortion it is important that the specified component values be used in the lowpass filter.

The results of this effort were gratifying:  The IMD reading went from 18 or so up to 32 (ranging between 31 and 35 db) during the "warble" period where the string of zeros are sent.

Filtering on the output:

You'll no doubt notice that there is no lowpass filter per se on this transmitter.  To be sure, the raw output of the transmitter itself contains harmonics that are much higher in level than the 20db attenuation required by the FCC.  Since this transmitter is intended to be used with a series-connected loading coil, it is expected that the loading coil will provide more than adequate harmonic rejection.  In real life, this works well as the Q of even a very mediocre loading coil will provide much more harmonic attenuation than required.

This doesn't mean that the harmonic content, while perfectly legal, may not pose a few problems.  On my beacon the harmonics are well below the levels required by Part 15:  They aren't even audible a few blocks away from the beacon.  They are audible on HF at my QTH, but they are few enough (being about 1.7 MHz apart) that none of them actually land in any ham band (except on 10 meters.)  There are a few weak beacon appearances that show up due to some birdies or intermod products but these are generally extremely weak (weaker, in fact, than the birdies generated by the computer in the shack) and tend not to mask real signals.  Even if they did, I could simply unplug the beacon transmitter for the time I wanted to use that frequency.

There is an annoying problem that occurs higher up in frequency, though:  The beacon causes some slight interference with low VHF TV reception (i.e. channels 2-6.)  This occurs because the loading coil itself is physically large and it is itself capable of radiating a little bit of energy at these frequencies.  This sort of thing may or may not bother you if you have cable TV, for instance, or if your beacon is not located in front of a broadcast TV antenna's beam pattern.  If it does bother you, then some filtering could be added - if you keep a few things in mind.

The nature of this Class-E power amplifier makes it somewhat awkward to simply throw a lowpass filter on the output.  One of the problems is that the Class-E amplifier isn't too happy when the impedance at frequencies other than the designed output frequency is low.  One of the ways around this is to put a simple low-Q (a Q of 5 or more should do) series-tuned L/C circuit in series with the output.  Following this L/C circuit with a lowpass filter - designed with the antenna feed impedance in mind (assuming that you have gone through the trouble of figuring out what it is...) - should do the trick.  In the case of my transmitter, the impedance at the input of the coil is around 15 ohms, so I would have to design the L/C series circuit and the lowpass filter with those parameters in mind.  For more information about the "care and feeding" of the Class-E amplifier used in this transmitter, read "Optimizing the Simple Beacon Transmitter."

 
"But I don't have a PIC programmer!"

You may want to build a beacon (or do a PIC-related project) but just don't have a programmer for a PIC.  What to do? 

BUILD ONE! - If you can build the beacon, you can certainly build a simple programmer!

The PicBlaster Programmer.  This derives voltage from and connects to the serial port of a PC-type computer and consists of a dozen or so parts. 

The Minimized PIC16C84 Programmer has very few parts and attaches to the parallel port of a PC-type computer. 

A page describing  In-Circuit PIC16F84 Programmers gives more detail as to how to program the PIC - even with the serial port. 

For a variety of PIC-related links (including simple hardware and software for PICs) go to the David Tait archive on the Dontronics web site.

"Where's the software for this?  (And I want the NEW version, too!)":

Update:

As of 7 November, 2000, new code was released that greatly improves the IMD (intermod) performance of both transmitter types (i.e. the "Balanced Modulator" and "AM" versions.)

There are two versions of software now available:

These links not only point you to the source code, but to .HEX files that you may use to program the PIC yourself without needing the C-compiler.

References:

"Optimizing the 'Simple Beacon' Transmitter" by Mark Mallory -  This article originally appeared in the Western Update (#59, September, 1988).  This is the original article describing a high-efficiency Class-E LowFER transmitter.

For additional links/information on PSK31, MedFER, and LowFER operation, refer to those at the bottom of the PSK MedFER page.

Additional references are as follows:

Return to the PSK MedFER page

Any comments or questions?  Send an email!

This page copyright 1999 - 2011 and maintained by Clint Turner, KA7OEI and was last updated on 20110606


Since 12/2010: