Build an FM radio using an RTL-SDR dongle
Raspberry Pi FM Radio
For the Pi FM radio project in this article, I tried a few different arrangements, but I found that an LCD HAT (hardware attached on top) with buttons (Figure 4) worked best. However, other options such as a PiFace digital HAT (Figure 5) or a button HAT could also be used.
The LCD Python libraries will vary according to the hardware used; however, most LCD HATs are based on the Adafruit libraries [4].
The Python code for the LCD HAT (Listing 2) is based on the simple test code with some additional logic for an LCD button interface and some predefined radio frequencies. The main code loops through, looking at each of the buttons with the lcd.is_pressed()
function. The LCD.UP
and LCD.DOWN
buttons are used for volume control, and the LCD.LEFT
and LCD.RIGHT
buttons cycle through the predefined radio stations. The lcd.clear()
and lcd.message()
functions show the new radio station information on the LCD HAT. In my testing, I used a 0.25-second delay on all the button presses, although you might need to tune this value for your hardware and usage.
Listing 2
Pi FM Radio with an LCD HAT
Summary
Creating a homemade FM radio is just one of the many interesting applications for SDR utilities and the low-cost RTL-SDR dongle [5]. In the future, I would like to add a Python Tkinter or web interface to my FM radio application.
Infos
- About RTL-SDR: http://www.rtl-sdr.com/about-rtl-sdr/
- GNU Radio: https://www.gnuradio.org/
- Code for this article: ftp://ftp.linux-magazine.com/pub/listings/linux-magazine.com/206/
- Adafruit libraries: https://github.com/adafruit/Adafruit_Python_CharLCD
- See more of Pete's Projects: https://funprojects.blog
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
News
-
Elementary OS 5.1 Has Arrived
One of the most highly regarded Linux desktop distributions has released its next iteration.
-
Linux Mint 19.3 Will be Released by Christmas
The developers behind Linux Mint have announced 19.3 will be released by Christmas 2019.
-
Linux Kernel 5.4 Released
A number of new changes and improvements have reached the Linux kernel.
-
System76 To Design And Build Laptops In-House
In-house designed and built laptops coming from System76.
-
News and views on the GPU revolution in HPC and Big Data:
-
The PinePhone Pre-Order has Arrived
Anyone looking to finally get their hands on an early release of the PinePhone can do so as of November 15.
-
Microsoft Edge Coming to Linux
Microsoft is bringing it’s new Chromium-based Edge browser to Linux.
-
Open Invention Network Backs Gnome Project Against Patent Troll
OIN has deployed its legal team to find prior art.
-
Fedora 31 Released
The latest version of Fedora comes with new packages and libraries.
-
openSUSE OBS Can Now Build Windows WSL Images
openSUSE enables developers to build their own WSL distributions.