Category Archives: Amateur Radio

The Kansas City Standard

I was pondering my laser transmitter the other day, and began to think of how I might transmit digital information from the Arduino to the remote receiver. Since I am old, I remember the old days where programs used to be stored on an obsolete audio storage medium called cassette tape. Indeed, the first storage device I ever used was the Atari 410 tape drive pictured on the right.

The Atari stored data at 600 baud, using FSK (data is stored as short bursts of two different tones, in the case of the Atari 3995 and 5327 hz), using a variant of the so-called Kansas City Standard. KCS was a standard for storing data on cassettes that was developed at a Byte magazine sponsored symposium in 1975.

Data is converted to short bursts of 1200Hz and 2400hz tones to represent zeroes and ones, respectively. Each burst is 1/300 of a second long, meaning that it sends 300 bits per second. Each 8 bit character is framed by a 0 start bit, and a pair of 1 stop bits so that character frames can be identified. It was designed to be a reliable if slow format, and succeeded on both counts. It transmits about 27 characters per second. An 8K download would take about five minutes.

It’s amazing we ever lived through the stone age.

Anyway, I thought it would be fun to make an Arduino library to send this information over my laser link, but first I decided that it would be good to test to make sure I understood how the format worked. So, I coded up a small program to generate some test .WAV files from an input data file. I made the problem simpler by generating the output at the somewhat non-standard sample rate of 9600 samples per second. This considerably simplifies the generation of samples, since they only would have amplitudes of zero, plus or minus one, and plus or minus sqrt(2)/2. I coded up the following C code, and generated this WAV file.

A WAV file that contains an ASCII test message, encoded in Kansas City Standard

The encoder is simple, the decoder, somewhat less so. So, to test that I was generating the proper bits, I used Martin Ward’s decoder written in Perl which did a good job of decoding the sample WAV files. I haven’t tested the robustness of this format with respect to noise yet, but it does appear to work reasonably well.

It wouldn’t be that hard to modify the simple sound generation code I used before to send data in this format. I think I will try to get to that next week.

[sourcecode lang=”c”]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sndfile.h>

/*
* kc.c
* A program which takes a file as input, and encodes it via the old
* Kansas City Standard – a 300 baud format that was used by old
* microcomputers to store data onto cassette tape.
*
* http://en.wikipedia.org/wiki/Kansas_City_standard
*
* We are going to produce a 9600 sample per second output file…
*
* Each "baud" is 32 samples long.
*
* A ‘0’ is 4 cycles @ 1200 Hz.
* A ‘1’ is 8 cycles @ 2400 Hz.
*
* 0 – 0 R2 1 R2 0 -R2 -1 -R2
* 1 – 0 1 0 -1
*
*/

#define R2 (.70710678118654752440f)

SNDFILE *sf ;
SF_INFO sfinfo ;

void
output(float f)
{
sf_write_float(sf, &f, 1) ;
}

void
send(int bit)
{
int c ;

switch (bit) {
case 0:
for (c=0; c<4; c++) {
output(0.f) ;
output(R2) ;
output(1.f) ;
output(R2) ;
output(0.f) ;
output(-R2) ;
output(-1.f) ;
output(-R2) ;
}
break ;
case 1:
for (c=0; c<8; c++) {
output(0.f) ;
output(1.f) ;
output(0.f) ;
output(-1.f) ;
}
break ;
default:
abort() ;
}
}

void
encode(int ch)
{
int i ;
send(0) ; /* start bit… */
for (i=0; i<8; i++) {
send(ch & 1) ;
ch = ch >> 1 ;
}
send(1) ; /* two stop bits */
send(1) ;
}

main()
{
int i, ch ;

sfinfo.channels = 1 ;
sfinfo.samplerate = 9600 ;
sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ;

sf = sf_open("test.wav", SFM_WRITE, &sfinfo) ;

for (i=0; i<9600/4; i++)
output(0.) ;
while ((ch = getchar()) != EOF)
encode(ch) ;
for (i=0; i<9600/4; i++)
output(0.) ;

sf_close(sf) ;
}
[/sourcecode]

AE6TY on Software Defined Radio

This morning I realized that somehow I had failed to listen to the latest SolderSmoke episode (#135), so during my somewhat longer than usual commute (traffic) I set it going and had a listen. And wow, some really great stuff, especially the report by Bob Crane, W8SX on the Four Days in May (FDIM) QRP conference last month. One thing that caught my attention was a presentation by Ward Harriman, AE6TY, on “Software Defined Radio Without the Math”. Since that is a topic I’ve always been interested in, when I got to work, I looked up his website, and found that it’s a great treasure trove of information. Like Jeri Ellsworth’s recent project, Ward has designed an SDR which doesn’t require a PC to work, but instead of using an FPGA like Jeri, he chose to use a dsPIC processor. He’s also got the schematic and PCB files online, and the whole build is documented in a series of articles for QRP Quarterly that you can download from his website. Awesome stuff! Check it out.

AE6TY on Software Defined Radio!.

The sights and sounds of RTTY

Over at the tymkrs blog, they’ve been learning a bit about RTTY as a digital mode, but I found their description a bit theoretical. I’d describe radio teletype (RTTY) as a popular digital mode, particularly among contesters. It encodes text as a stream of five bit code words using a system known as Baudot, and then sends these codes as two tones using frequency shift keying. On the amateur frequencies, these tones are typically 170 Hz apart, and sent at 45.45 baud.

Is that too esoteric for you? Well, here’s some sights and sounds.

First of all, here’s the sound. I recorded the following minute of audio using my SDR-IQ this morning around 14.090 Mhz, on the 20m band. There is apparently some contest going on, as I observed people exchanging sequence numbers and signal reports. I’ve left this uncompressed, so in theory, if you have any software that can decode RTTY, you can play it back and see what it says (I use fldigi).

RTTY on 20m, recorded on July 2, 2011 (WAV)

If you are using a radio which has a “waterfall” display like are common for software defined radio, you might expect to see the following: RTTY looks like two discrete tones, separated by around 170 Hz. This is the view using my SDR-IQ running Spectravue.

Spectravue doesn’t have an RTTY decoder built in, but fldigi does. If you configure it to use the stereo mixer output of your PC as input, you can use both programs together to decode the RTTY. Here’s what fldigi looks like:

You can see that fldigi has some problems with putting out garbage letters, mostly at the end of transmissions. The squelch control that it has is slow to stop the decoder, and often at the end of a transmission you’ll see a bunch of garbage characters. I’ve wondered how to tune fldigi to minimize that effect, but I haven’t figured it out yet (I’m not much of an RTTYer).

While RTTY has a long history in amateur communications (refer to (refer to Wikipedia for details) it is hardly ever done with vintage equipment anymore, with software replacing vintage teletype terminals. I see it mostly used during contesting, and hardly ever for long “rag chewing” contacts. In recent years, digital modes like PSK31 and Olivia seem to be increasing in popularity at RTTY’s expense: even W1AW has begun to shift their bulletins to PSK31.

If you are a ham, you probably know all this already: this is mostly to help inform the short wave listener or prospective ham. If you are an avid RTTYer, feel free to post your views on the mode as a comment: as I said, I’m no expert, but we’d all love to hear from anyone who is.

Magnetic Loop Antenna Theory

I was digging around trying to find some software to help me design a magnetic loop antenna for use on VLF frequencies. I stumbled across this page, which provided a lot of interesting insights, as well as a Spice model to help you understand how they work.

Magnetic Loop Antenna Theory

The article clarified something to me which I only vaguely understood before. If you desire narrow band performance, the best way to do it is to make the antenna resonant by paralleling it with a capacitor, and using it in combination with a high impedance load to measure the voltage from the antenna. But if you desire wide band performance, then you want to use it combination with a very low impedance, which basically means that you feed it into a transimpedance amplifier which effectively shorts the antenna to ground and converts the current to a voltage.

Interesting.

I might have missed it, but while the page presents an Spice model for the antenna, it doesn’t seem to have it available for download. I’m working on putting it into LTSpice, and should have it available for download sometime in the next couple of days.

Recordings of High Frequency Beacons…

It’s been quite some time since I’ve hunted for any beacons, and I’ve never really payed much attention to HF pirate beacons. Typically these are solar powered beacons which are deployed somewhere in the deserts of the American Southwest, and charge during the day and transmit simple sequences of Morse characters once the sun goes down. While they are technically illegal, the amount of power they emit is so low that they could hardly be said to interfering with anything, and besides: they are almost certainly so cheap that if you took the trouble to direction find one down, the creator could simply erect another one the following week. In any case, I found this website which details some of the beacons you can find on HF:

High Frequency Beacon – HF Underground

Armed with the list, I decided to take my trust SDR-IQ and see if I could hear some of them tonight. With just a brief scan, I determined that I could hear three of them that are in the vicinity of 4.096Mhz. I made brief minute long recordings of them, and these are still in WAV format rather than putting them through an MP3 compressor which might remove the signal entirely.

Signal around 4.089Mhz, reportedly from Death Valley
“Dasher” signal around 4.0963Mhz, from Joshua Tree National Park
“Dasher” signal around 4.0966Mhz, from Mojave National Preserve

The Death Valley signal is easier to hear, the Dasher signals were fading in and out, but should still be reasonably legible. You should be able to tell the difference in speed between them.

Here’s a screendump of Spectravue spectrum display, centered around the two Dasher beacons:

Perhaps this isn’t too exciting, but it was fun to see if I could find these. I’ll try hunting down some more of these, as well as some more unusual signals from time to time.

Short wave listeners and hams: what’s the most unusual thing you’ve heard lately? Feel free to chime in below. Bonus points for things that other SWL’s can listen for.

Debugging an RFI problem on Field Day…

I spent most of the week in New York, so Field Day snuck up on me without me making any serious plans. But since Jeri has been homebrewing her own SDR I’ve been thinking more about that, and thought that I would dust off my SDR-IQ receiver and at least make some recordings of the crowded bands for field day.

So, I hooked it up, downloaded the latest version of Spectravue, and fired it up. And immediately found that there was some periodic high intensity noise, about 30khz wide and at intervals of around 160khz, all up and down the range covered by the receiver. Tuning down to the bottom, I found that there was indeed a sharper louder noise peak centered around 81Khz, and that we we were seeing mostly odd (but some even) harmonics all the way up to 30Mhz.

It seemed likely that it was a local noise source, so I immediately went around the house and checked all my fluorescent fixtures to make sure they are turned off. I knew from experience that the one in my garage can emit some pretty ugly hash, but switching them all off didn’t seem to help. I remembered that I had an air purifier upstairs turned on, so I switched that off. No help. I turned off TVs (which had never presented a problem before, so I couldn’t see why they would cause an issue now) but they also didn’t help.

I strained my brain: I had never seen this kind of noise before, it was probably local. What has changed in the electrical environment of my house? I couldn’t figure it out. I mused that maybe I had some bad connection in my antenna (which is probably not adequately weather proofed with coax seal) and that it was rectifying some local noise source. I contemplated tearing it down, and putting up another antenna.

I needed a break. Carmen and I took a walk down to W6CUS’s Field Day operations near the Berkeley Marina, and then went to Home Depot and bought ourselves a new replacement screen door for our patio. When we tried to get it in the Honda, it wouldn’t fit, so I sent her home to get the Expedition and waited, mulling it over.

When I got home, I was thinking of a different problem: the design of a VLF loop antenna. I disconnected my laptop and moved to the couch, where I dug up a copy of some loop antenna design software and played with some numbers for a while.

After an hour or so, I got bored, and decided to give the SDR-IQ a try. I went back to my antenna hookup, plugged in the SDR-IQ to my laptop, and fired up Spectravue. And… miracle of miracle… the RFI was gone!

Perhaps, think I, it was something like a motor in an air conditioning unit that had switched off. But huzzah! I could at least tune around and listen. So, I put the laptop back on the table. And.. the RFI is back.

Take it off. It’s gone. Put it back. It’s on.

Alright Mark, think. What the heck is going on?

I am operating on battery power. I wasn’t before. The power supply? But it’s not even plugged in. It’s just sitting there, it’s little plug dangling on the desktop next to where I put my laptop down…

Sure enough, even proximity to the power supply was enough to bring back the hash. Then I remembered, this laptop power supply was a replacement (an OEM replacement) for the original that I had used previously. That could explain why I had never seen it before. My wife’s laptop has the same kind of power supply, so I swapped that in. Silent as a church mouse. No problem at all.

Problem solved! And with that, I could go ahead and listen (and see, using Spectravue) the traffic on Field Day. By then it was 10:00PM, a couple of hours beyond sunset, but 20M was still open:

20M on Field Day, June 25, 2011

I recorded a half an hour of the full band for later experimentation, and then moved down to 40m, where you could see both the CW and voice portions of the band.

Anyway, it points out to me that the hardest part of debugging is to figure out what is relevant and what is not, what is changed and what has not. I had a preconceived notion that since I had used this computer before, nothing related to it could possibly have anything to do with it. But of course something had changed. In retrospect, noise from switching power supplies should always be on my mind when debugging these things.

Hope everyone had a good Field Day!

The Gyrator VLF receiver…

Back on June 7, there was a spectacular coronal mass ejection on the sun:



Yes, I did mention this event and gave some links to VLF receivers at the time, but I’ve been thinking about this some more.

As an astronomy/telescope buff, I have built simple telescopes for looking at the sun, but I haven’t done much of that lately, and I have only recently become interested in observing the sun’s effect on the Earth’s radio environment. I’ve also had a fairly longstanding interest in VLF communications, and so the prospect of building a radio system for monitoring radio for SIDs (Sudden Ionospheric Disturbances) seems like a good project. I recall that Mark Spencer, WA8SME whom I’ve had the pleasure of meeting at Pacificon and even chatted with via the AO-51 satellite had published some articles on designing such radios for amateur and educational construction.

The most common way to monitor for SIDs is to try to detect the signal strength of the VLF station in Cutler, ME on 24Khz. Changes in signal strength can indicate the presence of solar flare activity as the ionosphere is bombarded by high energy particles. One common circuit that lots of people use is called The Gyrator VLF circuit, which you can find here:

The Original Gyrator Circuit (PDF)

I had never really looked at this circuit very carefully before, and looking at it tonight, I realized that it was actually fairly interesting and employs a technique which I hadn’t seen before. Instead of making a tuned front end using a (fairly large, because of the low frequency) inductor, they create an equivalent circuit using two op amps and a collection of resistors. This creates an inductor with very high Q, with the side effect that is easier to make, using operational amplifiers that you can still get at Radio Shack. I’ll probably try to simulate some of the basics with LTSpice to gain some intuition as to what’s going on, but it’s a simple enough circuit that just building it would be pretty easy.

The basic circuit has undergone a couple of iterations, and now the Gyrator III schematic is recommended by the AAVSO. You can check out the details here (and surf around, the AAVSO has lots of information on this stuff).

Software Defined Radio Links

I own an SDR-IQ software defined radio, a Funcube Dongle (more on that later) and have built a marginally operable Softrock Lite receiver, so you might say I’m interested in Software Defined Radios. But Jeri’s tinkering with her own software defined radio has rekindled my interest in homebrewing one. I was looking for Gerald Youngblood’s (AC50G) QEX article series entitled “A Software Defined Radio for the Masses”) and found that one good place to find it (and many other interesting articles) was unsurprisingly on the ARRL’s website.

Software Defined Radio

Jeri also pointed me at a an awesome presentation by Dan Tayloe, N7VE entitled “Very High Performance Image Rejecting Direct Conversion Receivers” that has lots of information that go well beyond my current understanding of receiver design and performance. Good reading, which will hopefully turn into a good project.

A Cree LED in my linear current LED Transmitter

I was away all weekend, so I didn’t get a chance to check out my LEDs that I got from Deal Extreme last week. Tonight, I just soldered a couple of clip leads and tried it out when hooked to the linear current modulator that I built (and blogged about) before. The transmitter in this video is set to pull an average of about 10ma average through the diode, with a peak of 20ma. That’s hardly enough to really get the cree going at all (I believe this one can go all the way to 350ma or so, and about 1W of output power) but it was enough to play with.



After I filmed this, I changed the current limiting resistor from 100 ohms to 16 ohms (by ganging two 32 ohm resistors together) and wired my multimeter in series with the supply to measure the power, and as expected it was 60ma, for an output of around 150mw or so (I didn’t measure the voltage drop, but I think it’s around 2.6 volts). It was quite a bit brighter, and was detectable even without any optical assistance at the other side of my room. To go much higher, I think I should probably swap the 2N3904 that I’m using to modulate it with something a bit beefier (like the IRF510s that I have lying around) and I’ll need some 1/2 watt current limiting resistors (probably around 3 ohms).

I’ll play with this some more in the next few weeks.

My first code on the Gameduino, immediately upstaged by Gameduino Invaders

I received a cute gadget in the mail the other day: a Gameduino. It’s a small Xilinx FPGA on an Arduino shield that can create VGA and sound output. It acts like a simple coprocessor, connected via the SPI bus of the Arduino.

In an effort to get people started on thinking about the Gameduino, I tried to hack together a quick graphics demo, just to test my own basic understanding. The evening that I received it I only had an hour to hack, so I only got
this far:



But apparently this was enough to get me an email from Colin, who has started a page on Gameduino programming which seems awesome. In particular, he chose to implement a complete version of Space Invaders for the Gameduino. I bow in your direction, Colin. Truly awesome.

I haven’t had much more time to work on mine, but I might get a chance over the weekend. Stay tuned for further Gameduino experiments.

Boom! A big solar flare, with some links…

This morning’s massive coronal mass ejection from the Sun got me scrambling around trying to remember details of how amateurs can monitor solar flare activity during the current solar cycle. Mark Spencer, WA8SME, had some articles on building a small monitoring station that detected SIDs, or “sudden ionospheric disturbances”. The basic idea is to create a VLF receiver to pick up signals such as the strong one megawatt transmitter on 24Khz in Cutler, Maine, and then graph the overall signal strength and record it on the computer equivalent of a strip recorder. I know I have the QEX article from 2008 where he described this system, but I can’t find it. You might find this article to be of interest, as well as the great efforts of the AAVSO (American Association of Variable Star Observers). Here is another receiver circuit that I ran across.. All good stuff.

G0NQE’s Acorn SDR receiver kit

Ever on the lookout for software defined radio designs, I was pleased to see G0NQE’s simple receiver design this morning. He offers a kit, but also offers the bare PCB board, and puts the schematic and parts list on his website. Very cool. It’s pretty much a textbook Tayloe-style switching detector, which is implemented entirely with common through-hole type chips. It uses a crystal oscillator which can be switched between a 14.7456 Mhz and a 15.0Mhz crystal, for reception centered on 3.68 and 3.75 Mhz. It uses the 74HC4052 as the analog switch, driven in quadrature and feeding an NE5532 op amp to provide the I/Q signals.

Check it out: g0nqe-acorn,sdr,receiver,kit.