This project is based around the 2.8” touch screen from adafruit.

The full details of building and setting up the touch screen can be found on the adafruit website here. This must be done before trying to use the radio!

This project creates an internet streaming radio for the Raspberry Pi using the 2.8” touchscreen. This does not use the x interface and makes use of Pygame.

Raspberry Pi Radio

Step 1: 

Set up the Adafruit TFT using the instructions provided by Adafruit. Make sure that all the steps are followed for calibration of the touch screen. There is no other control of the radio player other than the touch screen so if this is not done it won’t work!

Step 2:

Plug in a speaker or headphones into your audio jack. It took me nearly 5 minutes to work out my I was getting no sound when I hadn’t switched on my speakers!

Step 3:

If your Raspberry Pi is up to date you should already have the libraries for Pygame installed.  

sudo apt-get update

sudo apt-get upgrade

Step 4:

Install mpc and mpd and add some radio stations to your play list

sudo apt-get install mpd mpc

mpc add

mpc add

mpc add

mpc add

mpc add

mpc and internet radio stations are very well documented so I won’t go into too much detail here. The stations listed above are for BBC Radio stations in the UK.

If you want to save, edit and open your play list they are saved in /var/lib/mpd/playlists/

Step 5:

I have made the source code and icons I used available here.

I am not yet using github for my projects but hopefully will be soon!

Step 6:

Save the python program and all the icons into one folder. You should run the python program from within that folder.

sudo python


Play mpc play
Pause mpc stop
Refresh mpc stop followed by mpc play
Volume up mpc volume +10
Volume down mpc volume -10
Mute mpc volume 0
Previous station mpc prev
Next station mpc next

Each control is started with a command such as“mpc play”, shell=True)

The code still contains much debugging and developer information so you will see lots of additional comments in the console – sorry!

Have fun, let me know what you think. 

Now you are ready to add more channels to you mpc player check out this tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.