USRP B210 + GNU Radio: From Hardware Setup to First Signal Transmission & Reception
When you first connect the USRP B210 to your computer, that mix of excitement and nervousness is something I still vividly remember. As a star hardware in the software-defined radio (SDR) world, the USRP B210 has become the go‑to choice for countless radio enthusiasts and researchers thanks to its outstanding price-performance ratio and powerful capabilities. However, facing this seemingly complex “black box,” many beginners don’t know where to start. This article will walk you through hardware connection, driver configuration, basic transmit/receive flow, and finally—transmitting and receiving your very first signal.
1. Hardware Preparation & Environment Setup
The USRP B210 is a versatile software-defined radio peripheral designed by Ettus Research. It communicates with the host computer via USB 3.0, supports full-duplex operation, and covers a frequency range from 70 MHz to 6 GHz. Compared to its bigger siblings, the B210 strikes the perfect balance between cost and performance, making it ideal for individual developers and educational purposes.
Basic Hardware Checklist
- USRP B210 device
- Two SMA antennas (covering your target frequency band)
- USB 3.0 Type‑A to Micro‑B cable (original cable is recommended)
- A computer with a USB 3.0 port (Linux system preferred)
Software Requirements
- UHD driver (USRP Hardware Driver)
- GNU Radio framework
- GNU Radio Companion (GRC) – graphical development environment
For Linux users (Ubuntu 18.04/20.04 recommended), install all required packages with one command:
----------------------------------------------------------------------------
sudo apt-get update
sudo apt-get install gnuradio uhd-host
----------------------------------------------------------------------------
After installation, verify that UHD detects your B210:
uhd_find_devices
If everything is correct, you should see output similar to:
----------------------------------------------------------------------------
[INFO] [UHD] linux; GNU C++ version 9.3.0; Boost_107100; UHD_3.15.0.0
----------------------------------------------------
UHD Device 0
----------------------------------------------------
Device Address:
serial: 31FC89D
name: B210
product: B210
type: b200
----------------------------------------------------------------------------
2. Basic Transmit & Receive Flowgraph
Now let's launch GNU Radio Companion (GRC) and build your first signal transceiver flowgraph. GRC is the graphical interface for GNU Radio, allowing you to drag and drop blocks and connect signal paths to intuitively create complex radio systems.
Creating a New Flowgraph
- Type
gnuradio-companionin the terminal to start GRC. - Click File → New to create a new flowgraph.
- Set a sample rate variable: add a variable block named
sample_ratewith value1e6(1 MHz).
Drag and drop the following core blocks from the block library:
- Signal Source – generates the baseband signal to transmit
- USRP Sink – USRP transmitter block
- USRP Source – USRP receiver block
- QT GUI Time Sink – time domain waveform display
- QT GUI Frequency Sink – spectrum display
Make sure data types match. A basic loopback test flowgraph looks like:
[Signal Source] → [USRP Sink]
[USRP Source] → [QT GUI Time Sink]
[USRP Source] → [QT GUI Frequency Sink]
Key Module Parameters
| Block | Parameter | Recommended Value | Description |
|---|---|---|---|
| Signal Source | Output Type | Complex | Generates complex signal |
| Signal Source | Frequency | 1000 | 1 kHz sine wave |
| USRP Sink | Device Address | (empty) | Auto‑detects first USRP |
| USRP Sink | Center Frequency | 2.4e9 | 2.4 GHz carrier |
| USRP Sink | Gain | 30 | Transmission gain |
| USRP Source | Center Frequency | 2.4e9 | Same as TX frequency |
3. Troubleshooting & Performance Optimization
Even when following steps carefully, beginners may encounter issues. Here are the most common problems and solutions:
Issue 1: USRP device not detected
- Check USB connection.
- Confirm you are using a USB 3.0 port.
- Run
lsusbto see if the device is recognized. - Re-plug the device and rerun
uhd_find_devices.
⚠️ Issue 2: Signal distortion due to improper sample rate
The USRP B210 supports sample rates from 200 kHz to 56 MHz, but the usable range depends on the configuration. Follow these guidelines:
- For narrowband signals, use 1–5 MHz sample rate.
- For wideband applications, try 20 MHz or higher.
- Use
uhd_usrp_probeto see exact supported rates.
Issue 3: Abnormal spectrum display
- Verify antenna connection.
- Adjust center frequency and span in the GUI sink.
- Confirm the signal source frequency is reasonable.
- Reduce gain to avoid saturation.
uhd.usrp.MultiUSRP("num_recv_frames=512,num_send_frames=512")
USRP B210 Performance Specifications
| Parameter | Specification | Notes |
|---|---|---|
| Frequency Range | 70 MHz – 6 GHz | Requires appropriate antennas |
| Instantaneous Bandwidth | Up to 56 MHz | Depends on USB host controller |
| Transmit Power | Up to 10 dBm | Depends on frequency and gain settings |
| Phase Noise | -90 dBc/Hz @ 1 MHz offset | Typical at 2.4 GHz |
| Power Consumption | ~5W | Requires adequate USB power |
4. Advanced: Custom Signal Processing Modules
Once you've mastered the basics, you may need to develop custom signal processing functionality. GNU Radio supports creating custom blocks in C++ or Python. Below is an example using a Python block.
Creating a Custom Hierarchical Block
- Right-click on the GRC workspace and select Create Hierarchical Block.
- Name the block (e.g.,
MyAMDemodulator). - Add input and output ports.
- Write the internal processing logic.
Simple AM demodulator implementation:
----------------------------------------------------------------------------
import numpy as np
from gnuradio import gr
class my_am_demodulator(gr.sync_block):
def __init__(self):
gr.sync_block.__init__(
self,
name="my_am_demodulator",
in_sig=[np.complex64],
out_sig=[np.float32]
)
def work(self, input_items, output_items):
in0 = input_items[0]
out0 = output_items[0]
# AM demodulation: take magnitude
out0[:] = np.abs(in0)
return len(output_items[0])
----------------------------------------------------------------------------
After saving, the module appears in the GRC block library and can be used like built-in blocks.
C++ vs Python Modules
| Feature | C++ Module | Python Module |
|---|---|---|
| Development Difficulty | Higher | Lower |
| Execution Efficiency | High | Medium |
| Hot Reloading | Not supported | Supported |
| Debugging Convenience | Complex | Simple |
| Use Cases | High‑performance processing | Rapid prototyping |
5. Practical Application: FM Broadcast Receiver
Let's apply the knowledge to a real‑world scenario: building a simple FM broadcast receiver. This example shows how to receive and demodulate regular FM radio signals using the USRP B210 and GNU Radio.
Implementation Steps
- Set the USRP Source center frequency to a local FM station (e.g., 98.1 MHz).
- Add a low‑pass filter to remove out‑of‑band noise.
- Use the built‑in WBFM Receive block to demodulate the signal.
- Add audio resampling and audio sink blocks.
The complete GRC flowgraph consists of:
[USRP Source] → [Low Pass Filter] → [WBFM Receive] → [Rational Resampler] → [Audio Sink]
Key Parameters for FM Receiver
- USRP Source: Center freq = 98.1e6 (adjust locally), Gain = 30–50, Sample rate = 2e6
- Low Pass Filter: Cutoff freq = 200 kHz, Transition width = 50 kHz
- WBFM Receive: Audio attenuation = 10, Demod gain = 0.1
- Rational Resampler: Input rate = 200 kHz, Output rate = 48 kHz (standard audio)
Run the flowgraph, connect headphones or speakers, and you should hear clear FM radio. If you encounter noise or distortion, try these adjustments:
- Fine‑tune the center frequency (actual station frequency may have a small offset).
- Adjust USRP gain.
- Check that your antenna is suitable for the FM broadcast band.
- Ensure no strong interference nearby.
This simple FM receiver demonstrates the power of USRP B210 and GNU Radio. Based on this, you can extend functionality with channel scanning, signal recording, RDS decoding, and more.
6. Hardware Compatibility & Resources
Supports UHD version 3.0 and above — no need to replace binary files. The USRP B210 works seamlessly with modern SDR frameworks.
YX-OS32 USRP B210 SDR Platform – YanTechLab
By now you should have a solid foundation in using the USRP B210 with GNU Radio. Experiment with different modulation schemes, explore digital communications, and build your own wireless projects. Happy hacking!