RTL-SDR on Raspberry Pi: Software-Defined Radio for Beginners

A $30 RTL-SDR dongle and a Raspberry Pi give you a wideband radio receiver that covers 500 kHz to 1.7 GHz. It hears FM broadcasts, air traffic, weather sensors, pagers, and satellites. The dongle digitizes raw radio and the Pi processes it in software. This guide covers the hardware, driver install, first reception, a Python IQ capture script, and two working projects: an ADS-B aircraft tracker and a 433 MHz sensor-to-MQTT bridge.

Quick Takeaways

  • An RTL-SDR is a USB receiver built on the RTL2832U chip plus a tuner (R820T2 or R828D). It samples up to 2.4 MSPS stably.
  • Any Raspberry Pi 3, 4, or 5 runs it. Use the RTL-SDR Blog V4 driver fork if you own a V4 dongle.
  • Install rtl-sdr, blacklist the dvb_usb_rtl28xxu kernel module, then verify with rtl_test.
  • Antenna quality and USB noise matter more than the Pi model.

Component Overview: How an RTL-SDR Works

The signal path has four stages:

  1. The antenna converts radio waves to a tiny AC voltage.
  2. The tuner (R820T2/R828D) mixes the chosen frequency down to a low intermediate frequency.
  3. The RTL2832U contains an 8-bit ADC that samples the signal and outputs IQ samples (in-phase and quadrature pairs).
  4. The Pi receives the IQ stream over USB 2.0 and demodulates it in software (FM, AM, SSB, ADS-B, and others).

The RTL2832U was designed for DVB-T television dongles. Hobbyists found that its test mode exposes raw IQ data. That discovery is why these dongles cost so little.

Which Dongle Should You Buy?

Feature Generic DVB-T Stick RTL-SDR Blog V3 RTL-SDR Blog V4
Tuner R820T2 R820T2 R828D
Frequency range 24–1766 MHz 500 kHz–1766 MHz 500 kHz–1766 MHz
HF reception No Direct sampling mode Built-in upconverter
Oscillator Basic crystal 1 PPM TCXO 1 PPM TCXO
Bias tee No Yes Yes
Broadcast FM notch No No Yes
Approx. cost $10–15 $30 $35
Driver Standard Standard Blog fork required

Buy the V4 if you want HF and a cleaner FM band. Buy the V3 if you want broad software compatibility. Skip generic sticks for anything involving frequency accuracy, because their drift makes narrowband decoding unreliable.

Hardware Setup and Wiring

Use this layout:

Antenna → SMA/MCX cable → RTL-SDR → USB extension cable → Raspberry Pi

  • Connect the dongle through a USB extension cable of 0.5 to 1 m. This moves it away from the Pi’s noisy USB 3.0 and HDMI circuitry.
  • Add a ferrite choke on the USB cable if you see spurious spikes on the waterfall.
  • The dongle draws about 270–300 mA at 5V. A Pi 4 handles it directly. On a Pi Zero or an overloaded Pi 3, use a powered USB hub.
  • Do not hang a bias tee load (an LNA, say) off a Pi that is already near its USB current limit.

Antenna Length Reference

Dipole arm length is roughly 71.2 / frequency in MHz meters.

Target Frequency Per-Arm Length
FM broadcast 100 MHz ~71 cm
Airband (voice) 121–137 MHz ~55 cm
NOAA weather satellites 137 MHz ~52 cm
ISM sensors 433.92 MHz ~16 cm
ADS-B 1090 MHz ~6.5 cm (quarter-wave)

The telescopic dipole in the V3/V4 kits covers most of these by adjusting the element length.

Install the RTL-SDR Drivers on Raspberry Pi OS

Start from a fully updated Raspberry Pi OS (Bookworm or newer).

sudo apt update && sudo apt full-upgrade -y
sudo apt install -y rtl-sdr librtlsdr-dev

Blacklist the DVB-T Kernel Driver

Linux loads a TV driver that claims the dongle before the SDR tools can. Block it:

echo 'blacklist dvb_usb_rtl28xxu' | sudo tee /etc/modprobe.d/blacklist-rtl.conf
sudo reboot

RTL-SDR Blog V4 Driver Fork

The V4’s R828D tuner needs the Blog fork of librtlsdr. Remove the apt package first, then build:

sudo apt purge -y ^librtlsdr
sudo apt install -y git cmake build-essential libusb-1.0-0-dev
git clone https://github.com/rtlsdrblog/rtl-sdr-blog.git
cd rtl-sdr-blog && mkdir build && cd build
cmake .. -DINSTALL_UDEV_RULES=ON
make -j4
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig
sudo reboot

Verify the Install

rtl_test -t

A healthy result lists the tuner type (for example Found Rafael Micro R820T tuner) and the supported gain values. To check for dropped samples at full speed:

rtl_test -s 2400000

Run it for a minute. Repeated lost at least N bytes messages point to a weak USB cable or insufficient power.

First Reception: Listen to FM Radio

Replace 99.5M with a local station:

rtl_fm -f 99.5M -M wfm -s 200000 -r 48000 - | aplay -r 48000 -f S16_LE
Flag Function
-f 99.5M Center frequency
-M wfm Wideband FM demodulation
-s 200000 200 kHz sample rate, matching FM channel width
-r 48000 Audio output resample to 48 kHz
-g 40 Optional manual gain in dB

A headless Pi has no audio output by default over SSH. Stream the raw IQ data to your PC instead with rtl_tcp:

rtl_tcp -a 0.0.0.0 -p 1234

Then connect SDR++, GQRX, or SDR# on your desktop to the Pi’s IP address on port 1234. The Pi does the capture and your PC does the heavy DSP.

Run a GUI Receiver Directly on the Pi

sudo apt install -y gqrx-sdr

Set the device string to rtl=0, sample rate to 1.8 MSPS (the safest rate on a Pi), and mode to WFM (stereo).

Software Comparison

Tool Interface Best For Pi Load
rtl_fm CLI Quick demodulation, scripting Low
GQRX GUI Waterfall and general listening Medium
SDR++ GUI Lightweight modern UI Medium
rtl_433 CLI 433/868/915 MHz sensors Low
readsb Service ADS-B aircraft tracking Low
GNU Radio GUI/Python Custom DSP flowgraphs High

Firmware/Code: Capture IQ Samples with Python

The pyrtlsdr library wraps librtlsdr. Raspberry Pi OS Bookworm blocks system-wide pip installs, so use a virtual environment:

sudo apt install -y python3-venv python3-numpy
python3 -m venv --system-site-packages ~/sdr-env
source ~/sdr-env/bin/activate
pip install pyrtlsdr

This script captures samples and finds the strongest frequency in the band:

from rtlsdr import RtlSdr
import numpy as np

sdr = RtlSdr()
sdr.sample_rate = 2.4e6        # 2.4 MSPS: max stable rate over USB 2.0
sdr.center_freq = 99.5e6       # Tune to 99.5 MHz
sdr.gain = 40                  # Manual gain in dB; use 'auto' to let the tuner decide

# Read 256k complex samples (IQ pairs)
samples = sdr.read_samples(256 * 1024)
sdr.close()

# Apply a Hann window to reduce spectral leakage, then take the FFT
n = 4096
window = np.hanning(n)
spectrum = np.fft.fftshift(np.fft.fft(samples[:n] * window))
power_db = 20 * np.log10(np.abs(spectrum) + 1e-12)

# Map FFT bins to absolute frequency in MHz
freqs = np.fft.fftshift(np.fft.fftfreq(n, 1 / 2.4e6)) + 99.5e6
peak = freqs[np.argmax(power_db)] / 1e6

print(f"Strongest signal near {peak:.3f} MHz ({power_db.max():.1f} dB)")

The FFT turns time-domain IQ samples into a frequency-domain spectrum. Averaging several FFT frames before taking the peak gives a steadier result.

Scan a Whole Band with rtl_power

rtl_power -f 88M:108M:10k -g 40 -i 10 -e 1h fm_scan.csv

This sweeps 88–108 MHz in 10 kHz bins, integrates for 10 seconds per pass, and runs for one hour. Plot the CSV with heatmap.py or any spreadsheet tool to find active channels.

Gain, Sample Rate, and Frequency Correction

Setting Typical Value Effect of Too High Effect of Too Low
Gain 30–45 dB Overload, phantom signals Weak signals vanish
Sample rate 1.8–2.4 MSPS Dropped samples on Pi Narrow visible bandwidth
PPM correction 0 on TCXO models n/a n/a

Start with a manual gain of about 40 dB. Raise it until the noise floor lifts, then back off a few dB. Generic dongles without a TCXO drift by 20–80 PPM. Find the offset with rtl_test -p and pass it using -p in your tools.

Real-World Project 1: ADS-B Aircraft Tracker

Aircraft broadcast position, altitude, and speed on 1090 MHz using Mode S ADS-B. A Pi with a short antenna can track planes within 100+ km in open terrain.

Install the maintained readsb decoder with its web map:

sudo bash -c "$(wget -nv -O - https://github.com/wiedehopf/adsb-scripts/raw/master/readsb-install.sh)"

Then open http://<pi-ip>/tar1090 in a browser. For a bare-bones test without the full stack:

rtl_adsb -V

Build tips:

  • Mount a 1090 MHz quarter-wave ground-plane antenna (a roughly 6.5 cm element) outdoors with a clear sky view.
  • Use low-loss coax such as RG-6 or LMR-240. Every extra meter of cheap coax costs signal at 1 GHz.
  • A 1090 MHz bandpass filter with an LNA at the antenna raises range sharply in noisy locations.

Real-World Project 2: 433 MHz Sensors to MQTT

Many weather stations, door sensors, and tire-pressure monitors transmit on 433.92 MHz with simple OOK/FSK modulation. The rtl_433 tool decodes hundreds of protocols without extra code.

sudo apt install -y rtl-433
rtl_433 -f 433.92M

Decoded packets show model, ID, temperature, and humidity. Publish them to a broker for Home Assistant or Node-RED:

rtl_433 -f 433.92M -F mqtt://localhost:1883

Run it as a systemd service so it starts on boot. Place the antenna near your sensors, since 433 MHz transmitters are low power and walls attenuate them quickly.

Troubleshooting Common Errors

Symptom Likely Cause Fix
usb_claim_interface error -6 DVB-T kernel driver loaded Blacklist dvb_usb_rtl28xxu, reboot
No supported devices found Missing udev rules or bad cable Install udev rules, try another cable/port
Failed to open rtlsdr device #0 Permissions Add your user to the plugdev group, or run with sudo
Dropped samples Weak USB power or high sample rate Use a powered hub, drop to 1.8 MSPS
Spikes at fixed intervals Pi USB/HDMI noise Extension cable, ferrite choke, move antenna
V4 tunes wrong or fails Stock librtlsdr installed Rebuild the Blog fork driver
Constant overload Gain too high or strong FM station Lower gain, add an FM notch filter

Limits to Know Before You Start

The 8-bit ADC gives roughly 48 dB of dynamic range. A strong local FM or pager transmitter can desensitize the whole band, so use band-specific filters. The usable bandwidth is about 2.4 MHz at once, which rules out wideband captures like Wi-Fi. There is no transmit capability, so the dongle is receive-only. That also keeps it legal to experiment with in most countries, though local rules on decoding certain traffic (such as encrypted or cellular communications) vary. Check your national regulations.

FAQ

Can a Raspberry Pi run an RTL-SDR?

Yes. A Raspberry Pi 3, 4, or 5 runs an RTL-SDR at 1.8–2.4 MSPS for FM listening, ADS-B decoding, and rtl_433 sensor logging. A Pi Zero works for lightweight decoders, but not for GUI receivers like GQRX.

What can you receive with an RTL-SDR on a Raspberry Pi?

You can receive FM and AM broadcasts, airband voice, ADS-B aircraft, NOAA weather satellite images (137 MHz), 433/868/915 MHz ISM sensors, amateur radio, and pager traffic. The V3/V4 also reach HF bands such as shortwave through direct sampling or the V4’s built-in upconverter.

Why does my RTL-SDR not work on Raspberry Pi?

The usual cause is the Linux dvb_usb_rtl28xxu driver claiming the dongle. Blacklist it, reboot, and run rtl_test -t. For an RTL-SDR Blog V4, also install the Blog fork of the driver. Insufficient USB power is the other common cause.

Is the RTL-SDR V4 better than the V3?

The V4 adds a built-in HF upconverter, a broadcast FM notch filter, and improved filtering. The V3 uses the older R820T2 tuner and works with stock drivers. Choose the V4 for HF and strong-FM areas. Choose the V3 for the simplest software setup.

Hot this week

Understanding the Sketch Structure: setup(), loop(), and Beyond

Learn how Arduino setup(), loop(), globals, and custom functions work, with code, a hidden main() breakdown, and fixes. Read the guide and start coding.

Electronics Safety: Mains Voltage, Batteries, and Soldering Hazards

Learn how to stay safe around mains voltage, LiPo batteries, and soldering fumes. Use our bench checklists and build safely today.

Word Clouds and Text Visualization: Useful or Gimmick?

Are word clouds useful or a gimmick? Learn when they work, where they fail, and which Python text visualization methods beat them. Get the code now.

SQL Anti-Patterns: 12 Mistakes That Slow Queries or Break Results

Learn 12 SQL anti-patterns that slow queries or corrupt results, with fixes, code, and benchmarks. Audit your queries today.

Query Optimization: Indexes, Execution Plans, and Faster SQL

Learn SQL query optimization with indexes, EXPLAIN ANALYZE, and rewrite patterns. Copy-ready PostgreSQL code included. Speed up your slow queries today.

Topics

Understanding the Sketch Structure: setup(), loop(), and Beyond

Learn how Arduino setup(), loop(), globals, and custom functions work, with code, a hidden main() breakdown, and fixes. Read the guide and start coding.

Electronics Safety: Mains Voltage, Batteries, and Soldering Hazards

Learn how to stay safe around mains voltage, LiPo batteries, and soldering fumes. Use our bench checklists and build safely today.

Word Clouds and Text Visualization: Useful or Gimmick?

Are word clouds useful or a gimmick? Learn when they work, where they fail, and which Python text visualization methods beat them. Get the code now.

SQL Anti-Patterns: 12 Mistakes That Slow Queries or Break Results

Learn 12 SQL anti-patterns that slow queries or corrupt results, with fixes, code, and benchmarks. Audit your queries today.

Query Optimization: Indexes, Execution Plans, and Faster SQL

Learn SQL query optimization with indexes, EXPLAIN ANALYZE, and rewrite patterns. Copy-ready PostgreSQL code included. Speed up your slow queries today.

How Uber, Lyft, and Airbnb Use Data for Dynamic Pricing

See how Uber, Lyft, and Airbnb turn demand data into dynamic prices, with Python code for surge and booking models. Build your own pricing engine.

Pivoting and Unpivoting Data in SQL

Learn how to pivot and unpivot data in SQL with PIVOT, UNPIVOT, CASE, and UNNEST. Copy-paste code for SQL Server, PostgreSQL, and Snowflake. Start now.

GDPR for Data Scientists: Your Responsibilities Explained

Learn what GDPR requires from data scientists: lawful basis, minimization, pseudonymization, DSARs, Article 22. Get code and a checklist.

Related Articles

Popular Categories