Monday 28 June 2010

Homebrewed WSPR and a right royal stuffing

What a weekend!

Having covered QRSS, S/MT Hellschreiber and WSPR, the logical progression for the 30m beacon project (Blogs passim) seemed to be generation of WSPR signals without the safety net of the PC. I realized that WSPR is just FSK (which the beacon is well capable of generating), but I also knew that timing is more of an issue for WSPR. I needed to be running synchronously to true time (within a second or so) rather than free-wheeling, completely oblivious to the clock. So - I decided to have a poke about on the 'net to learn from others, before trying to make something original.

I quickly found Gene w3pm's WSPR Projects page , where he publishes an interesting design for a PIC-based WSPR generator and kindly gives full access to the source code - an ideal place to begin to learn the "nuts and bolts" of the WSPR signal.

Here's my lash-up of the signal generator...


I followed Gene's original words and music fairly closely - substituting a 4066 for the 4016 specified, replacing the 2n2222s with my trusty 2n3904s (due to supply chain issues in the junk box) and replacing the transformer-coupled output (for similar reasons). You can see the RS232 interface to a PC (also used as an NMEA interface to a GPS system) on the left, the 16F628 PIC and 4066 analog switch next and the VFO to the right. The system seemed to work well enough - but it needed a few levels of "calibration" and needed to be loaded with the correct data for MY WSPR message - my call, locator, etc...

The first stage of calibration is setting the 4MHz clock for the PIC, from which the system derives all timing (and, thereby, stays in sync with the network of nodes on the WSPR network). This was achieved by tuning the nearly-new FT817 to 3.9995MHz in USB mode and looking for a 500Hz output. Yes - I do have a counter-timer, but it is difficult to avoid loading the crystal oscillator with test clips etc, so the "wireless" connection was preferred!

Next step was to "calibrate" the FSK intervals (WSPR uses 4-FSK with a spacing of 1.465 Hz between each signal frequency). I found that the nominal resistor values in Gene w3pm's schematic gave way too high a frequency change - so changed to higher value resistors until the delta Fs were about right.

Once all the levels etc were right, I had to encode the WSPR message - which consists of a sequence of 162 characters, each representing one of the four allowed frequencies that constitute the 4-FSK signal. Into these 162 characters are encoded the callsign, the locator and the power level. Stu Phillips EtherGeist blog gave me the head start I needed - pointing me to the command-line version of WSPR, which can generate the message as text...


I copied the central "symbol" column of this text (containing the integers 0-3) and rearranged them (using MATLAB) into a text file, with the additional code "00+" signifying the end of the message...


This could then be uploaded into the breadboarded system using HyperTerminal...


All looked well, so I tried a direct connection to the sound-card of the shack computer on which I run WSRP and - sure enough - I could decode the message...


There is some evidence of 50Hz harmonics from a "hum loop" problem but - apart from that - all was fine. The PC went on "receiving" the "transmissions" from the new WSPR signal generator all afternoon (it is programmed to transmit on one 2 minute segment every ten minutes).

Flushed with this limited success on Saturday, I set off on Sunday with a spring in my step and designed a PCB in Eagle...


... but then disaster struck.

First, England were scheduled to play Germany in the round-of-sixteen in the World Cup and - like a fool - I had agreed to watch the game. Let's just say I would have had a much better time carrying on with the radio project than watching a bunch of lazy, overpaid primadonnas being forced to concede that there is precisely nothing "premier" about the "premiership".

Second, the shack computer suffered a noisy crash - sounded like a mechanical fault in the hard disk that is going to require replacement.

Anyway, despite these annoying set-backs, I did manage to get a little more done on the final version of the system before running out of weekend...


Perhaps next week I'll get it on the air and hook it up to my old Garmin eTrex GPS system, so I don't need to worry about timing quite so much.

...-.- de m0xpd

No comments:

Post a Comment