Recently, I was experimenting with a few wireless modules and an Arduino again, and I couldn’t get one of them to transmit any data. That got me wondering, how do we debug this sort of issue? Is there a problem in the code? Or is the module itself broken? I needed some cheap device that would let me view what exactly is being transmitted. And RTL-SDR does exactly that.
or
You can get the RTL-SDR dongle from the official store for $20. For that, you will get a wide-band radio scanner that can receive any broadcast in the frequency range 24 MHz to 1.766 GHz. That covers all AM and FM radio stations, things like ham radios, the widely used ISM bands 433 MHz and 868 MHz and even transmission from ships, planes and satellites currently orbiting the Earth!
Traditionally, radio receivers were made using only hardware components, like filters, amplifiers, modulators and demodulators to name just a few. At the most basic level, all of these components perform various mathematical operations with an analog signal. However, as the processing power of computers increased dramatically, it became possible to move a lot of these operations to the digital domain and process the signal using software.
This approach has some great advantages. First, it greatly reduces the amount of required specialized hardware components. As you can imagine, this can decrease the overall cost of the system by a significant amount. Another great advantage is flexibility. You don’t have to replace half of all the components to support new wireless protocol or modulation. Instead, you just have to write some new code!
Figure 1. Block diagram of a typical SDR
In an ideal world, Software-Defined Radio (SDR) would require only three hardware components: antenna, analog-to-digital converter, and a digital signal processor. You could just hook up the antenna to the converter, feed the output to the signal processor, and voila you can process the data stream in a computer. Unfortunately, we don’t live in an ideal world. The main obstacle is the analog-to-digital converters; turns out it is pretty hard to design a converter that can convert quickly and accurately enough, even signals at nanovolt level. For that reason, real SDR receivers use some hardware components, most commonly wide-band, low-noise amplifiers and band-pass filters. Those pre-process the signal for the digital components.
Once you have obtained the receiver, you will need an antenna and a place to put it. This may seem pretty straightforward, but it’s actually one of the most crucial steps. Antenna indoors will probably be able to receive powerful FM radio broadcast, but it might have trouble picking up a 433 MHz transmitter that is placed outside – even if it’s just a few feet away – and almost certainly it won’t be able to pick up weaker signals, such as satellite transmissions (we’ll get to those later). I’m using 1 m dipole antenna placed outside and running the signal using a coaxial cable and a USB cable.
Next up are the drivers. When you plug the RTL2832-based dongle to your computer, it will install the default driver, unfortunately, that’s not the driver that will allow you to use it as a software-defined radio. To get that driver, you will need to use Zadig – a tool that lets you replace a driver of a USB device. Download the exe file from here and run it. Next, plug your RTL dongle to one of the USB ports. In the Zadig tool, select “Options” from the menu [1] and press “List All Devices”. You should now be able to select any of your USB devices, among which will be the RTL dongle, listed as “Bulk-In, Interface (Interface 0)” [2].
Figure 2. Zadig driver tool
Important note: before replacing the driver, double check that you have selected the correct device! For example, you can check the currently installed driver listed in the “Driver” field, and it should contain the string “RTL2832U” [3]. If you replace driver of the wrong device, it will most likely stop working and it might be very difficult and time-consuming to get it back!
Make sure WinUSB driver is selected in the second text box [4] and click the button “Replace Driver” [5]. You will now be prompted a few times by the system, so just confirm that you trust this driver. After a while, you will get a message saying “Driver replaced successfully,” which means that the most difficult step is done and we can start using the RTL dongle as a receiver!
The final part that is still missing is the software. There’s a lot of options out there; different programs that support different types of receivers, but since this article only deals with the RTL-SDR dongle based on RTL2832 chip, I will only cover the software that supports this particular receiver.
The first app you can use to control your receiver is SDR#. This is probably the most widely used general-purpose SDR. It runs on Windows and it is completely free. It is relatively simple to use, even for complete beginners. The biggest advantage of SDR# is the ability to add plugins in which there are tons.
Figure 3. SDR#
In the above image, you can see what the environment looks like. There’s a control panel to the left, frequency spectrum to the top, audio spectrum to the bottom and a waterfall view that takes up the middle of the screen. Waterfall view is basically a recording of the frequency spectrum in time, so if you see an interesting signal, but it disappears before you can tune in, it will remain displayed in the waterfall and you can try to listen to that exact frequency in case the signal comes back. You can also use the waterfall to measure how long the signal has been transmitting, and whether its frequency changed during the transmission.
While the SDR# is very simple to use and can be customized quite a bit, thanks to all the plugins. I personally prefer SDR Console. Like SDR#, it is very easy to use, but it offers additional advanced features like satellite tracking, more demodulation modes, and a lot of additional tools for anything from audio recording and noise filtering to frequency management. And last but not least, the app generally looks nicer and more polished. The SDR Console app is free to download, but if you like the app you can also support the author with a donation.
Figure 4. SDR Console
Because I really liked the SDR Console app, I’m going to use it in all the examples throughout the rest of this tutorial. Of course, you can use whatever SDR software you personally like, most of them will look and handle very similarly to each other. To see other options for SDR software (Windows, Linux, Mac, Android or some web-based tools), you can visit https://www.rtl-sdr.com/big-list-rtl-sdr-supported-software/.