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.

Figure 4: LCD FM radio control.
Figure 5: PiFace FM radio control.

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



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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Software-Defined Radio

    Armed with a US$ 20 hunk of hardware and a free software-defined radio tool, Konstantin starts the hunt for radio-transmitted data from a weather station.

  • FSFE and FFII to Radio Station Winners: "rOGG on"

    Radio Free Deutschland: For Document Freedom Day, March 31 2010, a couple of European radio stations were granted awards for using open standards.

  • Internet Radio Intro

    Did you think the Internet was out of revolutions? With Internet radio, anyone can be a broadcaster. If you want to start broadcasting or podcasting, or even if you're just looking for the perfect station, check out this month's Internet Radio cover story.

  • Replace with VLC
  • Ripping Audio Streams

    FM no longer has the biggest selection of radio stations. Instead, you need an Internet connection. But how can you save a copy of your favorite web broadcast?

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Find SysAdmin Jobs