WSPR transmitter

(Please note that this program will not run without a valid GPS signal)

The WSPR transmitter program makes the RFzero capable of transmitting on any frequency from 2290 Hz to 200 MHz and beyond.

The transmission takes place in 15 time slots repeated twice per hour. There are two different transmission sequences that can be used in straight order, randomly or in a day-and-night sequence.

Up to 15 frequency, control bits and power combinations can be used. The combinations can be made either manually for each of the 15 combinations or filled in one go using an audio offset frequency from 1400 Hz to 1600 Hz. The filter bits can control external antennas, filters, relays, matching, … via the ULN2803A driver IC on D6 to D0 or an analog voltage on A0.

The transmitted WSPR message can be either Type 1 (call sign, square and power, e.g. OZ0RF JO65 13) or Type 2 (compounded call sign and power, e.g. OY/OZ0RF IP62). Please see the WSPR documentation for more details.

The configuration is done via the USB port. The square, used in message Type 2, can be be updated either manually or automatically. It is possible to wait for the RFzero to warm up for up to 255 s before starting to transmit.

When transmitting the TX LED will flash at half the symbol rate, i.e. about 0,7 Hz.

When GPS signals are received the PPS LED flashes once per second and when the status of the GPS signal is valid the Valid LED is lit.

A PA can be controlled on/off on D7, i.e. off during no transmission to save power.

Block schematic presentation of the WSPR transmitter functionality.


Users

OZ0RF

From time to time OZ0RF is active from Copenhagen in JO65FR. The equipment is an RFzero directly into a 1:9 UNUN connected to a 16,2 m longwire antenna. Sometimes the output is boosted to 27 dBm/500 mW. The actual location is nothing to brag about.

The RFzero running as OZ0RF during the development of the WSPR transmitter program. The picture shows the RFzero, LCD and low pass filter bank.

You can see the latest spots of OZ0RF on WSPRnet.org here.

It is easy to make an HF all-band antenna using e.g. a 16,2 m long wire, an Amidon FT-114-43 as the 1:9 UNUN and Amidon FT-114-177 as choke that are good for 25 W even into a bad SWR.

Example of a 1:9 UNUN and choke for an HF longwire antenna.


Display

To setup the type of display used please use the “wr display” command see details in the configuration. If you want to change what is shown on the display please edit the display.cpp file.

Please see the display page for more information.

LCD 16×2

The display shows the GPS status, the number of satellites, the  HDOP, the UTC minutes and seconds, the transmission status (frequency, waiting or skipped), the sequence number and the transmission mode.

Example of an LCD 16×2.

LCD 20×4

The display shows the UTC, the transmit frequency/skip and sequence, the transmitted message, the GPS status, the number of satellites and the  HDOP.

The LCD showing the UTC, sent message, the frequency and sequence, N = night, S = straight sequence, the GPS status, number of satellites in use and the HDOP.

The LCD while waiting and not transmitting using sequence0 in straight sequence.

The LCD when skipping a time slot and randomly using the data from sequence1.


Configuration

The configuration of the program is done via the USB port, 9600 Baud, 8 bits, no parity and one stop bit, using a terminal program (e.g. Arduino IDE Serial Monitor, Termite Terminal (Windows), CuteCom (Linux) or Terminal (Mac OS)). Please connect the RFzero via a USB B cable to your computer and connect the terminal program to the right COM port in the terminal program. The RFzero identifies itself as an Arduino Zero (Windows Device Manager).

If you don’t see the RFzero> or RFzero config> prompts please press the enter key. When you want to execute a command you don’t have to enter the prompt but only the command and parameters after the >.

All input to the RFzero must be in lowercase.

To enter the configuration mode please enter   config   at the RFzero> prompt, i.e.

RFzero> config

To see the available commands please enter   ?   at the RFzero config> prompt, i.e.

RFzero config> ?

To leave the configuration mode please enter   exit   at the RFzero config> prompt, i.e.

RFzero config> exit

When in configuration mode, i.e. when you see the RFzero config> prompt, the most frequent commands are

rd cfg

to see the configuration that will be used after exiting the configuration mode.

wr defaults

to set most of parameters to their default values. Please see the actual program for the specific default values.

wr t1 MODE

to set the T1 H/W mode where MODE is

  • 0: Transformer (default)
  • 1: Combiner
  • 2: None

wr display MODE

to set the display mode where MODE is

  • 0: None
  • 1: LCD 16 characters and two lines, HD44780 interface
  • 2: LCD 20 characters and four lines, HD44780 interface
  • 3: LCD 16 characters and two lines, HD44780 via I2C PCF8574 interface
  • 4: LCD 20 characters and four lines, HD44780 via I2C PCF8574 interface
  • 5: Graphics display, ILI9341 SPI interface
  • 6: Graphics display, ILI9488 SPI interface

wr warmup SECONDS

where SECONDS is the number of seconds to wait for the RFzero to warm up.

More commands are available so please enter a question mark (?) at the RFzero config> prompt to see them.

wr bcn CALL

where CALL is the WSPR TX call sign. The maximum length for WSPR Type 1 messages is six characters and it must include a number. The maximum length for WSPR Type 2 messages is ten characters and it must include a number. Please see the WSPR specification for more details about the message types.

wr loc LOCATOR

where LOCATOR is the locator up to eight characters, however, only four i.e. the square is transmitted and only for WSPR Type 1 messages.

wr locator

to automatically let the GPS data set the locator, however, only four i.e. the square is transmitted and only for WSPR Type 1 messages.

wr locauto ONOFF

to turn on or off the manual or automatic locator updating where ONOFF is either 0: for off/manual updating, or 1: for on/automatic updating.

wr data INDEX FREQ CONTROL POWER

to fill one record in the transmitter data array with frequency, control bits and power, where

  • INDEX is the transmitter array index 0 to 14
  • FREQ is the frequency in Hz from 2290 Hz and up. The frequencies don’t have to be in increasing order, and the same frequency can be used more than once
  • CONTROL is the bit pattern on D6 to D0 in hex, without the 0x preamble. D6 is the same as bit 6 … D0 is the same as bit 0.
    E.g. 0101011 => 2B (bin to hex table), where D6/bit 6 is 0, D5/bit 5 is 1, … D1/bit 1 is 1 and D0/bit 0 is 1
  • POWER is the total system power level in dBm, i.e. after further amplification and cable loss etc. The RFzero doesn’t change power. Only the values below are valid. If you can’t find an exact match pick the closest one
    • 0 dBm = 1 mW
    • 3 dBm = 2 mW
    • 7 dBm = 5 mW
    • 10 dBm = 10 mW
    • 13 dBm = 20 mW
    • 17 dBm = 50 mW
    • 20 dBm = 100 mW
    • 23 dBm = 200 mW
    • 27 dBm = 500 mW
    • 30 dBm =  1 W
    • 33 dBm =  2 W
    • 37 dBm =  5 W
    • 40 dBm =  10 W
    • 43 dBm =  20 W
    • 47 dBm =  50 W
    • 50 dBm =  100 W
    • 53 dBm =  200 W
    • 57 dBm =  500 W
    • 60 dBm =  1 kW

e.g. to fill index 7 with 14 097 123 Hz, 0101010 control bits (bin to hex table) and 40 dBm as the power level

wr data 7 14097123 2a 40

will make a single entry in the transmitter data array like below.

Example of the transmitter data array after using the wr data 7 14097123 2a 40 command. The gray cells are not affected.

It is possible to fill the transmitter data array with the same frequency more than once, e.g. if you want to test different antennas or power levels. This can be managed by using different control bits for the same frequency.

Example of the transmitter data array with the same frequency and power twice but with different control bits for index 7 and index 8.

The control bits (bin to hex table) are connected to D6 to D0, i.e. D6 to bit 6 … D0 to bit 0, are also connected to the ULN2803A, that can be used for controlling e.g. a low pass filter bank. See more about the ULN2803A in the tutorials.

For more information on how to use the control bits to control e.g. a filter bank please see the “Control mode and control bits” section below.

wr auto OFFSET POWER

to automatically fill the transmitter data array with the default WSPR HF frequencies and where OFFSET is the audio frequency (AF) offset from 1400 Hz to 1600 Hz and POWER is the total system power level in dBm, e.g.

wr auto 1456 13

will make the transmitter data array look like below. Only one frequency per band is filled into the array. If you need a more detailed transmitter data array please use the “wr data” command.

Example of the transmitter data array using the wr auto 1456 13 command.

The control bits (bin to hex table) are connected to D6 to D0, i.e. D6 to bit 6 … D0 to bit 0, are also connected to the ULN2803A, that can be used for controlling e.g. a low pass filter bank. See more about the ULN2803A in the tutorials.

For more information on how to use the control bits to control a filter bank please see the “Control mode and control bits” section below.

wr control MODE

to set the control MODE where:

  • 0: no control
  • 1-7: the number of bits to use from the control values in the transmitter data array
  • 8: analog voltage on A0 in seven bits resolution taken from the control values in the transmitter data array

The control bits (bin to hex table) are connected to D6 to D0, i.e. D6 to bit 6 … D0 to bit 0, are also connected to the ULN2803A, that can be used for controlling e.g. a low pass filter bank. See more about the ULN2803A in the tutorials.

If using control mode 1 to 6 the unused D#-pins may be used for other purposes.

wr seq NUMBER INDEX0 … INDEX14

to set which INDEX to use from the transmitter data array. Use “s” to  skip the time slot/start minute. Values for all 15 time slots have to be included in the sequence command.

The order of the index values and skip(s) in the sequences can be anyway you like. E.g. to configure sequence 0 with index values, in a nice and increasing order, from the transmitter data array and skip every third time slot:

wr seq 0 2 3 s 4 5 s 6 7 s 8 9 s 10 11 s

Example of sequence 0 using the wr seq 0 2 3 s 4 5 s 6 7 s 8 9 s 10 11 s command. The gray cells are not affected.

If you want to transmit using the same index, i.e. frequency, control bits and power level, all the time the command will look like

wr seq 0 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7

if you want to transmit using data from index 7 otherwise select a different index.

rd sec

Lists the complete commands for all the current sequences and transmitter data array. You may then copy these commands, modify the relevant one(s) and enter it back into the RFzero. This was it may be easier to get the syntax and correct numbers in place.

wr tx MODE

where MODE is the transmission mode number

  • 0: transmit using sequence 0 in straight order
  • 1: transmit using sequence 1 in straight order
  • 2: transmit using sequence 0 in random order
  • 3: transmit using sequence 1 in random order
  • 4: transmit using sequence 0 during the day, and sequence 1 during the night both in straight order
  • 5: transmit using sequence 0 in straight order from minute 00 to 30 and random order from minute 30 to 60 during the day, and sequence 1 in straight order from minute 00 to 30 and random order from minute 30 to 60 during the night

The day/night transitions happen when the sunrise or sunset occur, and is automatically calculated based on the time and location coming from the GPS.


Control mode and control bits

The WSPR transmitter has the possibility to control external devices such as PA(s), when to transmit with the selected PA, which antenna to use, matching network, relays and filter to select. There are three different ways to control the devices.

  • Digital
    • One bit per device. There are up to seven bits, D6 to D0, available resulting in max seven possible combinations
    • Encoded bits that are converted at the devices’ end. There are up to seven bits, D6 to D0, available resulting in max 128 combinations
  • Analog
    • An analog voltage on A0, in seven bits resolution, resulting in max 128 possible combinations

The control mode manages which way is used, and how many bits are used in the digital modes. How the bits are used is entirely up to you. The bit are set using the

wr data INDEX FREQ CONTROL POWER

MMI command where CONTROL is the bit pattern/analog value (bin/analog to hex table).

Digital control

If digital control is used the ULN2803A, on the RFzero, may be ideal, because it can be used to control filter relays in a safe way.

Unless the ULN2083A is being used please remember that the RFzero operates on a 3,3 V level. Therefore some kind level translation, to increase the voltage to e.g. 5 V or 12 V, may be necessary.

Example of a digital 3,3 V to 5 V level translation. The 5 V can safely be changed to 15 V if required.

In case the devices are controlled when “active low” you may have to invert the bit patters, i.e. 010 (active high) becomes 101 (active low).

A more advanced way to use the control bits is to use some for filter control and others for antenna control, even on the same band, e.g. three bits, D6 to D4 are used for antenna control, and four bits, D3 to D0, are used for amplifier band and filter control.

A little bit of a lesson

If you are not familiar with binary numbers and bits please remember, that they always start with the most significant bit first. This is not special to the RFzero or Arduino but a general principle. This is in fact similar to the decimal system, where we also start with the most significant digit first, e.g. 7042 is seven thousands, zero hundreds, four tens and two ones which is equal to 7 x 1000 + 0 x 100 + 4 x 10 + 2 x 1 = 7 x 103 + 0 x 102 + 4 x 101 + 2 x 100.

Bit numbering, and the control bits in the WSPR transmitter, always starts with the highest bit number, Most Significant Bit (MSB), first. D7 or bit 7 is used for the PA PTT.

If we have the binary number 1000101 we can do the same principle break down as we did with the 7042 decimal number above. But instead of the base being ten (10) in the decimal world, it is two (2) in the binary world, i.e. 1000101 can be expressed as 1 x 26 + 0 x 25 + 0 x 24 + 0 x 23 + 1 x 21 + 0 x 21 + 1 x 10 = one sixty-fours, zero thirty-twos, zero sixteens, zero eights, one fourths, zero twos and one ones.

Oh, please remember always to multiply/divide before adding/subtracting! Otherwise your old math teacher will be after you.

Binary, decimal and hexadecimal conversion table.

BinDecHex BinDecHex BinDecHex BinDecHex
000000010044100088110012C
000111010155100199110113D
001022011066101010A111014E
001133011177101111B111115F

Converting binary bits to hex is easier than you may think. Simply take four bits starting from the right, and convert them to hex, then take the next group of four bits moving left and so on, until there are no more bits left, see the table below.

Examples of converting binary numbers to hexadecimal.

DecimalBinaryGroups of fourHexHex notation
0000000000000 00000 00x00
22000101100001 01101 60x16
69010001010100 01014 50x45
255111111111111 1111F F0xFF

If there is less than four bits just imagine that the missing bits to the left are zeros, e.g. 110100 => 00110100.

You may also use a program to do the conversion for you. In Windows and Mac OS there are programs called Calculator, that can be changed to Programmer mode. In Linux there is to many to mention.

Example of the Windows Calculator in Programmer mode (Menu | View | Programmer).

Generally when programming in C and variants

  • Binary numbers must be prefixed 0b, e.g. 0b10101111
  • Decimal numbers are often not prefixed but can be 0d, e.g. 0d7042
  • Hexadecimal numbers must be prefixed 0x, e.g. 0x1F
  • If a number begins with zero (0) it is an octal number, which is not used very often. But take care not to write e.g. 01011111, and think it is a binary number because it isn’t
One bit per control

The simplest way to control the filter bank is using one bit per filter. In this case the seven control (bin to hex table) values are:

  • 0x00 (D6:D0 000000)
  • 0x01 (D6:D0 000001)
  • 0x02 (D6:D0 000010)
  • 0x04 (D6:D0 000100)
  • 0x08 (D6:D0 001000)
  • 0x10 (D6:D0 010000)
  • 0x20 (D6:D0 100000)

Example of a filter bank controlled using seven bits, i.e. one bit per filter. The filter mode is 7. The RF path is not shown.

Encoded bits control

The digitally encoded bits control is a bit more complex at the device(s) side. This is because the encoded bits need to be converted to control the right device(s). So a decoder is needed, e.g. the 74138 that can convert up to three bits into eight positions or the 74154 that can convert four bits to 16 positions.

Example of a filter bank controlled using three encoded bits. The filter mode is 3. The RF path is not shown.

If using three bits the control (bin to hex table) values are:

  • 0x00 (D2:D0 000)
  • 0x01 (D2:D0 001)
  • 0x02 (D2:D0 010)
  • 0x03 (D2:D0 011)
  • 0x04 (D2:D0 100)
  • 0x05 (D2:D0 101)
  • 0x06 (D2:D0 110)
  • 0x07 (D2:D0 111)

If using seven bits some of the 128 combinations of control (bin to hex table) values are:

  • 0x00 (D6:D0 0000000)
  • 0x01 (D6:D0 0000001)
  • 0x18 (D6:D0 0011000)
  • 0x7E (D6:D0 1111110)
  • 0x7F (D6:D0 1111111)
Using Yaesu band data

If you want to use your RFzero together with Yaesu four bits band data compatible devices you will have to set the control bits accordingly, and set the control mode to 4.

The Yaesu band data and the control bit values.

Band
[m]
Control
[hex]
Band D
D3/bit 3
Band C
D2/bit 2
Band B
D1/bit 1
Band A
D0/bit 0
None000000
160010001
80020010
40030011
30040100
20050101
17060110
15070111
12081000
10091001
60A1010

You may use D6:D4 for other purposes if you like.

Analog control

The analog way to control the filters requires a conversion of the analog voltage to a digital representation, e.g. using an ADC or LM3914 like done by ICOM.

Example of an analog control of a filter bank. The filter mode is 8. The RF path is not shown.

In the above example the voltage made by the RFzero should be in the middle of the voltage interval for each filter, i.e.

  • 0 V to 0,4 V => 0,2 V => 0x08
  • 0,5 V to 0,9 V => 0,7 V => 0x1B
  • 2,9 V to 3,3 V => 3,1 V => 0x77

To convert a target voltage (U) to the control value (analog to hex table) please use this formula

Control = 127 x U /  3,3

e.g. if the target voltage is 0,7 V

Control = 127 x 0,7 / 3,3 = 26,9 => 27 => 0x1B

If the analog voltage needs to be amplified an operational amplifier (Op Amp) implemented as a DC-coupled and non-inverting amplifier is a good solution, e.g. LM324 see section 8.2.1.

Example of a DC amplifier using an LM324 Op Amp in non-inverting configuration. Picture courtesy Texas Instruments and own work.

Output voltage range
[V]
Amplification
ratio
R1 (E96, 1%)
[kΩ]
R2
[kΩ]
R2 (E96, 1%)
[kΩ]
0,0 - 4,01,21102,12,10
0,0 - 5,01,52105,15,11
0,0 - 8,02,421014,214,3
0,0 - 12,03,641026,426,1
0,0 - 13,84,181031,831,6

Ferenc, HA6QL, has made a solution using an LT1013 Op Amp, an LM3914 and using discrete components to switch the relays.

Using ICOM compatible devices

If you want to use your RFzero together with ICOM band selection voltages compatible devices, such as a low pass filter, you will have to amplify the analog voltage from the RFzero to 0 V to 8 V level as described above. You will also have to set the control values according to the table below.

Band
[m]
ICOM ACC2-4 voltage
[V]
RFzero voltage
[V]
FILTER
[hex]
103,51,438
154,31,844
205,02,14F
300,00,000
406,02,55F
806,62,769
1607,53,177
Using Yaesu FT-817 band voltages

If you want to use your RFzero together with Yaesu FT-817 band selection voltages compatible devices, above the 6 m band, you will have to amplify the analog voltage from the RFzero to 0 V to 4 V level as described above.


A configuration example

OZ0RF from JO65FR has a 10 W/40 dBm PA that covers 1 MHz to 30 MHz. Unfortunately the power on 28 MHz is only 5 W/37 dBm.

OZ0RF also has five low pass filters that cutoff of at 2 MHz, 6 MHz, 11 MHz, 22 MHz and 32 MHz respectively. OZ0RF also has one antenna for bands below 14 MHz and one for all above 14 MHz. This means that five (filters) bits plus two (antennas) bits, in total seven bits on D6 to D0 can be used in a 1:1 control. Both filters and antennas are active when on, i.e. the control bit is 1. OZ0RF then decides that the seven control bits are mapped in this way: AAFFFFF, where A is an antenna bit and F is a filter bit. Remember that the eighth bit is already used for the PTT.

Schematic control principle for the filters, antennas and PA. The RF paths are not shown.

E.g. to enable filter 3 and antenna 1, control bit 2 (filter) and bit 5 (antenna) have to be active Ø0100100, which is the same as 0x24 in hex. The control bits are found on D6 to D0 and the PTT on D7. They can also be found buffered, but inverted, on the output of the ULN2803A.

OZ0RF will like to use 1567 Hz as the audio frequency on all frequencies.

Furthermore, will OZ0RF like to transmit using one sequence during the day, and only transmit on the bands above 7 MHz, and another sequence during the night where frequencies above 21 MHz are not used.

Below are the necessary commands. Please remember that you can enter commands into a .txt file, and send them from the RFzero Manager or manually copy-and-paste them into a terminal program.

To change the call sign enter

wr bcn oz0rf

To change the locator enter

wr loc jo65fr

To fill the transmitter data array for the frequency below 2 MHz, use filter 1 and antenna 1

wr data 2 1838167 21 40

To fill the transmitter data array for the frequencies above 2 MHz and below 6 MHz, use filter 2 and antenna 1

wr data 3 3570167 22 40

wr data 4 5288767 22 40

To fill the transmitter data array for the frequencies above 6 MHz and below 11 MHz, use filter 3 and antenna 1

wr data 5 7040167 24 40

wr data 6 10140267 24 40

To fill the transmitter data array for the frequencies above 11 MHz and below 22 MHz, use filter 4 and antenna 2

wr data 7 14097167 48 40

wr data 8 18106167 48 40

wr data 9 21096167 48 40

To fill the transmitter data array for the frequencies above 22 MHz and below 32 MHz, use filter 5 and antenna 2

wr data 10 24926167 50 40

wr data 11 28126167 50 37

To set up the way the control bits are used for both filters and antennas seven bits must be used

wr control 7

To set up the day time sequence

wr seq 0 6 7 s 8 9 s 6 7 s 8 9 s 10 11 s

more pauses, transmissions or a different order could be used.

To set up the night time sequence

wr seq 1 2 3 4 5 s 6 7 s s 8 8 8 s s s

more pauses, transmissions or a different order could be used.

To enable day-and-night sequence

wr tx 4


Update the WSPRnet locator database

You can use this form to manually update your locator in the WSPRnet.org database in case it is incomplete or wrong. Please don’t change another station’s locator.

Your own call sign :   3-10 characters and must be ITU compliant
Your own locator :   format JO65FR
Call sign of WSPR inventor :   anti spam check and confirmation of intention