Using an RTL-SDR Dongle

license

tedmyers

By tedmyers www.tedfmyers.com Follow

More by the author:

How to Set Up a Bolted Top Rope Anchor

Delicious and Easy Thai Iced Tea

<a href=Mini Emoticon Keyboard" width="" />

About: Ted hails from sunny California, and is definitely not a robot created by Silicon Valley scientists. He enjoys collecting tools, components, and devices, and has amassed quite a collection (mainly through dump… More About tedmyers »

Hello! Today I'm going to cover the basics of setup and installation of an RTL-SDR dongle.

Using one of these allows you to analyze a wide range of frequencies, all for around $25. This is a great way to get started into the world of RF (radio frequency), or just to see a cool visualization of FM radio stations.

Step 1: The Dongle

I really like it; it's cheap (around $25), has multiple antenna options, wasn't too difficult to set up, has a nice metal enclosure, and it doesn't block my other USB ports! It's been a great investment, and it really is cheap for what it does.

Step 2: Set Up a VM

This guide is for using the program gqrx in linux; I use a mac, so I needed to set up a virtual machine, and used VirtualBox. If you already use linux, just skip this step - you're already set!

If you use Windows but want to run linux, some people recommend VMWare Player over VirtualBox for performance reasons. Feel free to use that, just skip to the Installation step after getting your VM up and running.

There's also windows native software that you can use - see this link and follow their instructions for Windows if you want to use one of these programs - SDRSharp, HDSDR, SDR-RADIO V2, or CubicSDR. In that case, this guide won't be useful for you.

Step 3: VirtualBox Setup

First, download VirtualBox HERE. I also recommend downloading the extension pack, also on that page.

Next, download an Ubuntu image HERE. (Ubuntu Linux 15.04, at the bottom of the page). If you don't have a torrent client, you can use an older version use the sourceforge link.

Open VirtualBox, select File->Open Appliance, and select the .ova file you just downloaded (the ubuntu 15.04 image). When in the Appliance Settings window, make sure to have the USB Controller, Sound Card, and Network Adapter checked. I recommend connecting all available peripherals.

After importing, the virtual machine will show up in the left side of the window. You can select start to run the machine right now if you wanted to. However, we still need to set up the USB connection from the SDR stick to the virtual machine.

First, plug in the RTL-SDR dongle. Next, in VirtualBox press Settings, then Ports. Make sure that USB is selected at the top (not Serial Ports). Next, ensure the Enable USB Controller checkbox is checked and that the USB 2.0 option is selected. Next, press the "Add New USB filter" button with the green "+" sign (see the second image) and select the RTL-SDR stick. Mine was named "Realtek RTL2838UHIDIR [0100]" but yours could be named slightly differently. Press OK, and you're all set!

Press the green Start button at the top to launch your virtual machine.

The default username is "ubuntu", and password is "reverse".

Step 4: Installation

You'll need to install some dependencies first, which we need to properly connect to the RTL-SDR stick.

Open a terminal window, and copy-paste (or type) one line at a time, then press enter. Wait for all output to finish printing before entering a new line. Some steps might ask for a confirmation to download; often this requires typing 'Y' or 'y' and then enter.

sudo apt-get install libusb-1.0-0-dev sudo apt-get install git
sudo apt-get install cmake

Do the same thing for these commands (enter each one line at a time). This downloads and builds the code.

git clone git://git.osmocom.org/rtl-sdr.gitcd rtl-sdr/mkdir build
cd build cmake ../ -DINSTALL_UDEV_RULES=ON make sudo make install sudo cp ../rtl-sdr.rules /etc/udev/rules.d/ sudo ldconfig

This next command will let your computer automatically connect with the RTL-SDR dongle. To perform it, you need to log in as sudo (the first line). You will have to enter your password to do this.

sudo -i sudo echo "blacklist dvb_usb_rtl28xxu" > /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf

Now, you need to restart the virtual machine. Select Machine->ACPI Shutdown in VirtualBox, then start it again.

Enter the next command to test if it worked (make sure the dongle is still plugged in before pressing enter).

rtl_sdr

It should output something like this:

rtl_sdr, an I/Q recorder for RTL2832 based DVB-T receivers 
Usage: -f frequency_to_tune_to [Hz] [-s samplerate (default: 2048000 Hz)] [-d device_index (default: 0)] [-g gain (default: 0 for auto)] [-p ppm_error (default: 0)] [-b output_block_size (default: 16 * 16384)] [-n number of samples to read (default: 0, infinite)] [-S force sync output (default: async)] filename (a '-' dumps samples to stdout)

Next, install gqrx by issuing the following commands:

sudo apt-get purge --auto-remove gqrx sudo apt-get purge --auto-remove gqrx-sdr sudo apt-get purge --auto-remove libgnuradio* sudo add-apt-repository -y ppa:bladerf/bladerf sudo add-apt-repository -y ppa:ettusresearch/uhd sudo add-apt-repository -y ppa:myriadrf/drivers sudo add-apt-repository -y ppa:myriadrf/gnuradio sudo add-apt-repository -y ppa:gqrx/gqrx-sdr sudo apt-get update sudo apt-get install gqrx-sdr sudo apt-get install libvolk1-bin Volk_profile sudo apt-get install gnuradio

Some of these steps might take a minute or two. Please be patient, you're almost done! Just enter

gqrx

and a window should pop up with the program!

Step 5: Using Gqrx

As mentioned in the last step, enter "gqrx" to start the program.

gqrx

Make sure the RTL-SDR stick is inserted, that the cable is screwed in (finger tight, don't over-tighten), and that an antenna is attached (I'd start with the adjustable length antenna extended).

Turn your computer volume to an appropriate level, and press the start button in the upper left corner. Make sure the mode is set to WFM (mono) for receiving FM radio. This stands for wide frequency modulation, which is the way that sound is transmitted inside RF waves for commercial radio.

Tune it to a local station by pressing the upper or lower portions of the numbers at the upper left. Place your antenna in an open space and higher up for best reception. Feel free to jump around different frequencies and see what you can find!

I find it fun to use a walkie talkie and see how strong the signal is at a very close range. Google "FRS GMRS frequencies" to find a table listing common radio channel frequencies.

And that's it! Now you can listen to the radio, monitor local police broadcasts, and generally surf the radio waves! And all for around $25!

There's a bunch more you can do, including downloading images from weather satellites, tracking aircraft, and receiving data from the ISS! These are outside the scope of this instructable but give you an idea of some of the things you could possibly do with more advanced software and a better antenna.

Here's the link again if you want to purchase! http://amzn.to/2snp4oD

I hope you have a great time learning about RF and using this neat and cheap technology!