Friday, July 27, 2012

World's Cheapest Software Defined Radio (SDR)

How it began
Somewhere I read about using a cheap USB HDTV dongle for a software-defined radio receiver.  The dongle needed to be built with a RTL2832U chipset and an E4000 tuner.  The thing works from 62 MHz to around 1.7 GHz.  There's also a somewhat risky modification that allows it to pick up the HF bands, but I haven't yet tried that. 
I found one on eBay for the outrageous price of $17.  The downside is it took about three weeks to show up.

Appearances can be deceiving

After I made sure it indeed showed up on the USB bus I followed the following steps, gleaned from various blogs.  As always, I did all this stuff in a Linux environment , but it can be done under Windows or Mac OS.  Doing this stuff on a Mac is probably pretty similar.

Compile and install rtl-sdr
You will need the libusb dev headers.  If you're using a Debian based system, simply run apt-get install libusb-1.0-0-dev.

 Clone the git repository with  git clone git://
Make a build directory and enter it
mkdir rtl-sdr/build
cd rtl-sdr/build
Create the makefile
cmake ../
Build and install rtl-sdr
make install
Rtl-sdr will now be built in /usr/local.  At this point, you should be able to test the dongle.   For some reason $LD_LIBRARY_PATH was unset on my system, and there was an issue with the permissions for the USB device as well.  I ended up running as root and setting the $LD_LIBRARY_PATH

 root@gregor:~/sources/rtl-sdr/build# export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/lib
root@gregor:~/sources/rtl-sdr/build#  /usr/local/bin/rtl_test
Found 1 device(s):
  0:  Generic RTL2832U (e.g. hama nano)

Using device 0: Generic RTL2832U (e.g. hama nano)
Found Elonics E4000 tuner
Supported gain values (18): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 43.0 45.0 47.0 49.0
Reading samples in async mode...

Compile gnuradio
Most software for the dongle depends upon GNU Radio, so you must install it.  Patch Von Braun has built a shell script which will compile gnuradio for you, if you're running a Debian based system.  You can get it here.

redacted@gregor:~/sources$ wget
--2012-07-25 18:39:00--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29181 (28K) [text/plain]
Saving to: `build-gnuradio'

100%[====================================================================================================================================================================================================>] 29,181      97.8K/s   in 0.3s   

2012-07-25 18:39:01 (97.8 KB/s) - `build-gnuradio' saved [29181/29181]
redacted@gregor:~/sources$ chmod a+x build-gnuradio

redacted@gregor:~/sources$ ./build-gnuradio

The script will automatically take care of any dependencies and build gnuradio, with support for the Realtek dongle.  The output is quite long, so it has been omitted.   It may take some time to finish.

After the build finishes, there are  are some applications which depend upon gnuradio that you can install.

The first SDR application I installed was "Multimode Radio Receiver".  It is just that.

Here we can see what things look like around the aircraft band.  Please note that this is with the rather lousy antenna the dongle came with.  It isn't even close to being correct for this wavelength, so it isn't really picking much up.

It should be noted that Multimode has a scan feature that although a bit cranky, is quite interesting.  I've had a problem with it starting to scan from 150 MHz, no matter what I specify i the GUI.  A fairly clunky workaround was to edit the default values (this is a Python program, so no recompile is needed).  If I have time and a patch isn't released before I do I'll probably spend some time with WinPDB

Another app I tried out is gqrx.  It is a little bit more polished than Multimode, but it doesn't have the scan feature.  Here it is on a local FM station.

This dongle is a pretty powerful tool at a pretty cheap price.  I'm going to do a followup post once I'm more familiar with doing things in GNU Radio, and if I come across any software that I find to be particularly neat.  I'm a busy man though, so no promises as to when.

I didn't do this in a vacuum, so it is only fair that I list where I learned things.

GNU Radio and librtlsdr with Realtek RTL2832U/Elonics E4000 software defined radio receiver.

RTLSDR supported hardware

1 comment:

  1. There are numerous vendors or shops available in market where you can buy cheap software. SDR is basically the metric to keep track of your software electrical performance.