Why spend big bucks on a commercially available internet radio device when you can create your own DIY version, complete with a touchscreen interface?

We will show you how to build a Raspberry Pi-powered internet radio that’ll allow you to enjoy your favorite radio stations from across the globe. The touchscreen UI offers a modern and user-friendly experience, which can help you enhance your existing home audio setup.

Why Build a Touchscreen Raspberry Pi Internet Radio?

First and foremost, building DIY projects such as the touchscreen Raspberry Pi internet radio provides a great learning opportunity for students, technology enthusiasts and DIY hobbyists.

Besides, it allows you to access thousands of radio stations from around the world. You can listen to your favorite radio stations for music, news, infotainment, talk shows, etc. You can also carry it with you and connect it to any audio setup via aux or Bluetooth and start listening to your favorite radio stations.

In addition, buying a radio station with a touchscreen is hard due to availability, Even if you do find it, it can be expensive and cost you a few hundred dollars. With a Raspberry Pi, you can build a touchscreen internet radio for a fraction of the price.

Things You’ll Need to Build a Raspberry Pi Touchscreen Internet Radio

You will need the following items to build a DIY touchscreen internet radio:

  • Raspberry Pi: It's best to use a Raspberry Pi 3 or 4 as they offer the best performance and connectivity options, including 3.5mm audio output. Alternatively, you may also use a Raspberry Pi Zero or Zero 2 W.
  • Touchscreen display: We are using the DFRobots 7" touchscreen display for this project as that’s what we have currently. However, you can also use the official Raspberry Pi Touch Display or any compatible touchscreen (between 5" and 10" in size) for Raspberry Pi.
  • Class 10 or higher-class microSD card with at least 8GB of storage
  • Aux cable (3.5mm)
  • 15W (5V 3A) power supply, try using the official power supply if available.
  • A 3D printed (e.g. this Thingiverse model) or purchased case (optional)
  • A microSD card reader for flashing the OS from a computer

Once you have gathered all the required items, follow the steps below to build a DIY internet radio.

Step 1: Set Up the Raspberry Pi

First, you'll need to install the Raspberry Pi's operating system onto the microSD card using your Windows, Linux, or macOS computer. For this project, the recommended operating system is the official Raspberry Pi OS, which you can easily flash to a microSD card by using the Raspberry Pi Imager tool.

Step 2: Connect Raspberry Pi With Touchscreen Display

If using the official Raspberry Pi Touch Display, connect the Display Serial Interface (DSI) cable (the display's ribbon cable) to the Raspberry Pi's DSI port and then connect the touchscreen's power supply to the Pi's GPIO pins.

connect the display to raspberry pi

If you are going to use the DFRobot 7" inch display, connect the display to the Raspberry Pi via its HDMI port. To provide power and enable the touchscreen, connect the micro USB cable to the display and the USB port on the Raspberry Pi.

Step 3: Install the Radio Streaming Software

With the touchscreen display connected, insert the microSD card into the Raspberry Pi and connect the power supply to boot the device.

installing the peppy player internet touchscreen radio raspberry pi

Once booted, follow the on-screen instructions to configure the Raspberry Pi. You also need to do the following:

  • Set up the Wi-Fi or Ethernet connection
  • Enable SSH
  • Enable auto-login
  • Change localization
  • Expand the file system
expand filesystem in raspberry pi

Once you have made the required changes and enabled SSH for remote access, reboot the system. After the reboot, you can connect to your Raspberry Pi via your Windows or macOS/Linux computer using the PuTTY or Terminal app respectively.

Once you are logged in via SSH, run the following command to update and upgrade the Raspberry Pi's software packages:

        sudo apt update && sudo apt upgrade -y
    
update and upgrade the repos in raspberry pi

After the update, add the main pi (or differently named) user to the TTY group:

        sudo usermod -a -G tty pi
sudo nano /lib/udev/rules.d/50-udev-default.rules

This will open the rules.d file in the Nano text editor. Make the following changes. First, find:

        SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"
    

And change it to:

        SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0660"
    
make changes to the default rules in raspberry pi

Press Ctrl + X then Y and Enter to save the changes. These changes are important to ensure Pygame does not crash when started by the pi (ot differently named) user.

Next, install the Pygame library needed for the Peppy Player GUI:

        sudo apt-get install python3-pygame
    

Install, the patched version of libsdl1.2 (Simple DirectMedia Layer library):

        wget https://www.dropbox.com/s/0tkdym8ojhcmbu2/libsdl1.2debian_1.2.15+veloci1-1_armhf.deb
sudo dpkg -i libsdl1.2debian_1.2.15+veloci1-1_armhf.deb
sudo apt-get -f install rm libsdl1.2debian_1.2.15+veloci1-1_armhf.deb

To install different libraries for Python 3, you will need the pip3 tool. Install it with:

        sudo apt-get install python3-pip
    
install python3 pip on raspberry pi

Also, install the VLC media player and VLC Python wrapper for Peppy Player to communicate with the VLC player:

        sudo apt-get install vlc
pip3 install python-vlc

Once you have installed pip3, run the commands below to download and install the required libraries on which the Peppy Player depends (i.e. dependencies):

        sudo apt-get install eject
sudo apt-get install bluealsa
sudo apt-get install sqlite3
sudo apt-get install udisks2
sudo apt install python3-smbus
sudo apt-get install python3-serial
pip3 install tornado
pip3 install RPi.GPIO
pip3 install discogs_client
pip3 install pynanosvg
pip3 install feedparser
pip3 install mutagen
pip3 install pexpect
pip3 install Pillow
pip3 install rpi-backlight
pip3 install pyudev
pip3 install pyowm
pip3 install pafy
pip3 install numpy -U
pip3 install psutil
pip3 install yahooquery
pip3 install pyaztro

Also, run the following command so that you don't need to be the sudo/root user to control the screen backlight:

        echo 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | sudo tee -a /etc/udev/rules.d/backlight-permissions.rulesecho 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | sudo tee -a /etc/udev/rules.d/backlight-permissions.rules
    

Clone the Peppy Player GitHub repository and install Peppy Player with the following commands:

        cd ~
sudo apt install git
git clone https://github.com/project-owner/Peppy.git
clone the peppy player project from github on raspberry pi

Once cloned, you can start Peppy Player as a service:

        wget https://raw.githubusercontent.com/project-owner/Peppy.doc/master/files/peppy.service
sudo mv peppy.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable peppy.service

Configure the amplifier driver by opening the file /boot/config.txt:

        sudo nano /boot/config.txt
    

Add the following line at the end of the file:

        dtoverlay=hifiberry-dacplus
    

If using the DFRobot 7" inch display, add following lines as well:

        #### remove black borders
disable_overscan=1
#### set specific CVT mode
hdmi_cvt 1024 600 60 6 0 0 0
#### set CVT as default
hdmi_group=2
hdmi_mode=87
edit the configuration file on raspberry pi for display

Comment out the following line to disable the default onboard audio system:

        #dtparam=audio=on
    

Press Ctrl + X then Y and Enter to save. Next, open the Peppy config file:

        nano /home/pi/Peppy/config.txt
    

Make changes to the [volume.control] section:

        [volume.control]
type = amixer
amixer.scale = linear
amixer.control = Digital
edit the volume control section in raspberry pi

Press Ctrl + X then Y and Enter to save. Then reboot the Raspberry Pi:

        sudo reboot
    

If you encounter an error, retry the process. Or re-flash Raspberry Pi OS and then follow the steps again to install and set up the Peppy Player for the touchscreen internet radio.

Alternatively, you may flash the readymade Peppy player disk image to the Raspberry Pi microSD card based on the display you have. This is called Express installation, although it didn't work for us when we tried it headless with the disk image for the Official 7" touchscreen display.

Connect Audio Output

You can use an external amplifier or any device with AUX input and connect a cable between the Raspberry Pi's 3.5mm audio jack and the amplifier's AUX input port (could be 3.5mm or larger).

aux connector on raspberry pi

You can also use a Bluetooth speaker, but this requires additional configuration and setup within Raspberry Pi OS.

Enhance Your Audio Setup With a Touchscreen Internet Radio

A touchscreen internet radio is of the best DIY Raspberry projects you can build, and for little expense. It enables you to access and listen to a wide range of radio stations from around the world. Also, you can connect it to your existing AVR or amplifier (audio system) and enhance the latter with touchscreen radio controls.