Raspberry Pi: Running an SDR

This is the first of a three-part look at some ways to use a Raspberry Pi for amateur radio purposes. First off, I’m going to start with using the Pi as a basic software-defined radio (SDR).

What is a Raspberry Pi?

It’s a £30 computer motherboard. Connect to a screen, keyboard and mouse, and you’re on your way. The Raspberry Pi uses the Linux operating system (as opposed to Windows), and it pretty powerful. There are several different models, and at the time of writing, the Raspberry Pi 3 is the current model, which is fast enough to cope with the cheap RTL SDR dongle, so it’s ideal for amateur radio. You can pick up a Pi online from Amazon – Raspberry Pi at Amazon

Raspberry Pi - Powerful mini computer for £30
Raspberry Pi – Powerful mini computer for £30

Raspberry Pi as SDR?

This is something I’ve wanted to try for a while – using my £10 Realtek RTL dongle with a Raspberry Pi as a cheap software defined radio. I first experimented with this in 2016, but my original Raspberry Pi was too slow for it to be of any use. I’m trying again, this time with some different SDR software and the much faster Raspberry Pi 3.

As I’m not a Raspberry Pi expert, I rely on a mix of online guides and Googling to get this sort of thing working. After some trial-and-error, I managed to get the Pi up-and-running, listening to audio from across the radio spectrum:

GQRX running on a Raspberry Pi, tuned to broadcast radio
GQRX running on a Raspberry Pi, tuned to broadcast radio

Setting it up

In case anyone else wants to try this, here’s a short guide on how I managed to get this up-and-running:

What I needed:

Raspberry Pi 3 connected to an RTL USB Dongle
Raspberry Pi 3 connected to an RTL USB Dongle

Preparing the software

The Raspberry Pi 3 supplied by Amazon came pre-loaded with the Raspian operating system on a Micro SD card, and out of the box, booted up to a desktop. In the past, I’ve purchased a Raspberry Pi that came without an operating system, meaning I had to download an install one. Getting one all ready to run was a bonus.

First step was to connect the Pi to the Internet. The Pi supports wi-fi (icon, top-right), and getting online was as straightforward as connecting any smartphone or laptop to a wireless hotspot.

Next, download the SDR software. (Don’t connect the SDR dongle at this point). I opted for a package called GQRX. Open the Pi’s web browser (icon, top left), and go to www.gqrx.dk – Go to the download page and select the Raspberry Pi build.

This downloads a compressed file, which you extract into a folder – I opted for the /pi/ folder

Then, open the folder called /gqrx(plus version number)

In that folder, is a Readme file, which contains some important instructions. There are two ‘dependencies’ that have to be installed to make GQRX run – the GNU Radio and Qt5 libraries. You can copy and paste the lines from the readme file straight into the Terminal (black icon with white arrow)

Raspberry Pi GQRX readme

Installing GNU Radio took several minutes (a lot of stuff to copy) – the Pi is downloading and installing the files over the Internet. The QT5 files were slightly quicker.

With both of those installed, I next connected the SDR dongle into a free USB port, and ran gqrz from the /pi/gqrz(version) folder. A box pops up asking you to confirm you want to Execute, which is obviously a ‘yes’.

A box pops up asking you to select device settings. My RTL dongle appeared in the “Device” pull-down. Same yourself some hassle, and also change the “Input rate” to 960000 (I discovered this later in the journey!). Hopefully, your “Configure I/O devices” screen will look like this:

GQRX setup screen

Another “gotcha” I discovered later – sound defaults to the HDMI cable by default. My speaker was plugged into the 3.5mm jack, and it took me a while to puzzle out why I was getting no sound. Right-click the speaker symbol (top-right) and select the correct output:

Raspberry Pi Audio Output selector

Once past the Configure I/O screen, you’re at the main SDR window. At this point, my dongle was plugged in and connected to the cheap antenna. I opted for a broadcast commercial radio station, to keep things simple. A few settings that I’d suggest tweaking:

  • Input Controls tab: Tick “Hardware AGC” and “DC Remove”
  • Receiver Options tab: Mode “WFM (mono)” and AGC to “Fast”

Now, give it a try. With the dongle, antenna and speakers/headphones plugged in, dial up a radio station frequency and press the first GQRX icon (play symbol)

Hopefully, a waveform like this one, and audio will start playing. If it’s quiet, turn up the gain from the gain tab (FFT tab, bottom right) or the main speaker volume (top right).

Raspberry Pi with GQRX SDR software

Other things to know:

I discovered two very useful things during my experiments, which I’ll share with you.

Input Rate: This is a surprisingly important setting.The default setting is too high, resulting in juddery audio. You may need to do some experimenting. If you’re interested in viewing the entire range 144MHz to 146MHz, then this value will need to be changed, but there will be a drop in audio quality. Here’s me changing it for use monitoring a local repeater in decent quality, whilst seeming adjacent frequencies:

Changing the Input rate

Tuner accuracy: The cheap RTL dongles aren’t perfect. Setting a frequency doesn’t necessarily mean that you’ll be bang on frequency. This can be an issue when tuning to narrowband data signals. This becomes relevant for a later part of this trilogy of articles. The trick here is to tune to a frequency (such as a simplex 2m frequency), zoom in on-screen, and transmit with a nearby handheld to see how far out your dongle is. You can fine-tune by setting an offset. Mine required a positive adjustment of 83ppm, as shown here:

Adjusting the accuracy of the RTL tuner

Some of the Gotchas:

  • Staggery/glitchy audio? For me, it was dropping the Input rate that fixed this – the default setting was too high. The FFT tab “FFT size” can also be dropped from the default 8192 to 2048, which makes the processor work a little less hard. 
  • Use a decent power supply. In earlier experiments, I found the Pi kept losing the connection to the dongle. Online reading revealed this to be a common issue if not using the recommended current to run the Pi 3. The recommended supply is 2.5A (my old Pi was OK with 0.5A). Some phone chargers are 1A, and I inadvertently used one of these and all appeared well, but it couldn’t power the RTL dongle. 

Hopefully, this short article is of use. If you have any questions, please add a comment below. 

Two more articles on how to use a Raspberry Pi for amateur radio… coming soon

 

Related links

14 Comments

  1. SI Walters 30 January 2018 Reply
  2. SI Walters 30 January 2018 Reply
  3. Chertsey Radio Club 30 January 2018 Reply
    • Pete M0PSX Pete M0PSXAuthor 30 January 2018 Reply
  4. VA3SII G7HCD 30 January 2018 Reply
  5. M1ECC 30 January 2018 Reply
    • Pete M0PSX Pete M0PSXAuthor 30 January 2018 Reply
  6. Paul M0XMT 30 January 2018 Reply
    • Pete M0PSX Pete M0PSXAuthor 30 January 2018 Reply
  7. Paul M0XMT 30 January 2018 Reply
  8. M1ECC 31 January 2018 Reply
  9. Alan 2 February 2018 Reply
  10. Pat 8 May 2018 Reply

Add a Comment

Your email address will not be published. Required fields are marked *