Raspberry Pi, Internet Radio




We are a small UK hack/makerspace. Wide and wild variations in interests. This is our official ac...

We have been aiming to do a mini hack for a while to bring some new life to an old radio and let us radio are favourite internet radio stations.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: You Will Need...

Depending on the radio you are going to install your Raspberry Pi into, your design will vary and thus the parts and equipment required will also. Below is a generic list based on what we used, it is not complete but should give you a good idea.


1x Raspberry Pi.

1x SDcard with 4 GB.

1x AC adapter with micro USB plug or a DC-DC converter supplying 5v and a micro USB lead.

1x Wireless LAN Adapter (n150).

1x Adafruit RGB LCD.

1x A radio large enough to fit pi screen etc.

4x Sub-Miniature Push-to-Make Switches Two Red & Two black.

1x Dupont cable or and IDC cable e.g. an IDE hard disk cable.

1x Heat shrink tubing.

Hot melt glue.

Cable ties.

Tools & Equipment:

Basic hand tools e.g. screwdrivers, wire cutters, craft knife, pliers etc.

Something to cut the radios case with, we used a a Dremel.

A drill for the holes for the buttons.

Files, medium and fine suitable for using on plastic to tidy up your cutting.

A soldering station or at a pinch a soldering iron.

A multimeter.

Hot Glue gun.

We are also assuming you will have a working internet WiFi connection for testing and access to an HDMI monitor / TV screen and a keyboard for setup.

Step 2: Setting Up Your Raspberry Pi

To setup the pi follow This Guide: http://www.raspberrypi.org/help/quick-start-guide... we have used the RASPBIAN OS, we used the build from January, we have not tested with the newer builds.

Once you have set up the Pi and plugged in the screen you will be presented with a blue setup wizard, in advanced settings change the hostname to something like "PiRadio", then you can exit the wizard, once you exit the system will reboot.

The next stage is to set up the wifi , log into the Pi using the following login details:

Username: pi

Password: Raspbery

Setup Wifi on the Pi to connect to the network where you will be using the radio: http://www.raspberrypi.org/documentation/configur...

Step 3: Controls & Display

We opted to use the 16x2 Character LCD + Keypad for Raspberry Pi from Adafruit for the display as they are readily available and well documented. We assembled the display module as per the instructions on the Adafruit web site which can be found here.


We did however make a few minor alterations to facilitate the placement of the display in the radio:

Instead of using the tactile switch push buttons provided we used some sub micro push to make buttons. These were connected with short lengths of wire soldered directly to the PCB. At the the switch end they were soldered and heat shrunk to reduce the risk of shorting.

With the LCD panel itself we soldered 0.1 pin headers on both the control board and the panel, these were linked with an old IDE hard disk cable we had lying around but any 0.1 pin pitch cable would suffice. This was done to enable us to fit the panel in the small space at the front of the radio.

Step 4: Setup Radio Software

The radio is based on this fantastic build we found on the internet https://tinkerthon.de/2013/04/internet-radio-mit-... we set modified it a little to get some uk radio stations and to work with newer pi os.

To start with setup Media Player (Mpd) with the following commands:

sudo apt-get install mpd mpc git 
sudo service mpd start

time to download the script and install it:

cd ~; git clone https://github.com/oschettler/radio.git

Now we need to make a few modifications to the script:

cd radio 
sudo nano initradio.sh


/home/olav/work/radio/radio.py 2>&1 &


/home/pi/radio/radio.py 2>&1 &

Press Control O to save followed by Control X to exit.

sudo apt-get install python-smbus
sudo apt-get install python-serial python-imaging python-unidecode
sudo cp initradio.sh /etc/init.d/radio 
sudo update-rc.d radio defaults service 

We need to update the playlist address to do this:

sudo nano //etc/mpd.conf

playlist_directory "/var/lib/mpd/playlists"


playlist_directory "/home/pi/radio/playlists"

Press Control O to save followed by Control X to exit.

sudo service radio start and the you shood be done,

Step 5: Upload a Play List.

All the stations will be stored in standard ".M3u" files that you can find for many podcasts and radio stations. To use them you just need to copy them to the server while the Pi is plugged in. I have made a list of stations which download and install with the following commands, with the Pi pluged into the screen login and then start xwindows with:


Once into xwindows open the browser and head over to this guide and download the .zip file. Once it has downloaded, extract the files to the /pi/radio/playlists/ folder then open the file browser and head over to the file and then go to edit>Select all, right click on one of the properties and make sure all permissions are set so anyone can view, see screen shot.

Step 6: Altering the Radio Case

At this stage we can put the electronics inside almost anything but we chose to put it in an old radio so we could utilize its existing power supply and amplifier. Exactly how you go about fitting the Pi and display inside will depend on the radio you are working with. The following is how it worked out for us:

Cut a hole in the case of the radio to receive the display, we opted to do this on the front panel just below the analogue dial as there was plenty of space behind the the electronics and this area was relatively flat. Depending on the material your radio is made of there are many options to cutting the opening.

In our case we went with a Dremel fitted with a cut off disk, we soon realized that the heat generated was causing the plastic to melt and shrink back slightly. So to keep things neat we cut our opening a little small and then with a lot of patients slowly hand filed to get the precise shape required. If you are worried that you have not got it as neat as you would of liked then you could always get a bezel for your display

Drilling the holes to receive the buttons was much easier, just make sure you take care to see that there will be enough space for them and the wiring once the radio is re assembled. At this point we realized it was looking a little tight in the case and it was going to be difficult to fit everything in. In the end to make space for the raspberry PI etc we removed battery compartment once again using the Dremel and tidying up the edges with a file.

Step 7: Connecting to the Radio's Internal Circuits

With all the cutting out the way its just a simple matter of connecting the pi to the aux audio input of the radio and sorting out the power supply.

To connect the Pi to the aux input you could just plug a 3.5mm to 3.5mm lead from the audio out on the pi to the aux in on the radio. We however opted to cut off one of the plugs and solder the 3.5mm jack cable to the aux input circuit on the inside of the radio to make things neater.

To power the raspberry Pi we were originally going to use an external mobile phone style micro USB power supply, but when we opened up the radio we saw it would be very easy to draw 12v from the radio's internal power supply. The Raspberry Pi of course needs a 5v supply, so we decided to install a simple voltage regulator board to get 5v as we had one on hand (a better option would of been a DC-DC buck converter) and solder its output to a micro USB plug.

With all the above done its simply a matter of affixing all the above inside, to keep things simple we used a combination of hot glue and cable ties although there are many other options such as mounting pillars or double sided adhesive foam pads.

Step 8: Lets See If It Works!

Now for the moment of truth, we powered up the radio and the display came to life, we used the interface to choose a station and nothing. We soon realized that in came on with the volume turned right down. We turned it up and everything worked as expected. The audio quality is pretty good considering its a mono radio!

Step 9: Next Time.....

If we were to do this again I would be inclined try and leave the ability to run the radio on batteries and find an older radio to do the modification to. I would also consider bringing an Ethernet port out of the case so wired operation is possible. Other than those couple of things and possibly tidying things up a bit I am pretty happy with how it turned out.

Pi/e Day Contest

Third Prize in the
Pi/e Day Contest

1 Person Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

24 Discussions


3 years ago

Ok so I figured out what was wrong with creating socket. I installed everything by your instructions. Shut down RPi and disconnect. Turned back on and nothing. It looks like I did something wrong. If I run LCD examples everything works ok but doesn't work when I start RPI. Please advise. Thank you! Great project!

2 replies

Reply 3 years ago

Anybody? Please help. THANK YOU!!!!


1 year ago

Hi, followed instructions and build to a "t" - trying to do a steampunk physical build with it. However at the last step

sudo service radio start

I receive the error Job for radio.service failed because the control process exited with error code. See "systemctl status radio.service" and "journalctl -xe" for details.

Error shown:

Failed to start LSB: Controll MPD

I know the hardware works. I2Cdetect -y 1 shows 020 at the appropriate address. I have managed to get the hardware working with a homebrew Pandora streaming build as well - LCD and buttons working as planned.

Any ideas?

1 reply

Reply 1 year ago

I met the same issue at first. You can modify the file /etc/init.d/radio as below.

Put these 2 lines at the beginning of the file.


#! /bin/sh

# /etc/init.d/radio



2 years ago

What was the approx. cost of this project in US dollars?


I asume you mean the radio its self, we purchased ours from amazon, but you could use any similar radio.



4 years ago

I it possible to modify anyof the files to eneable me streaming from pandora or spotify?


4 years ago

Looks very very nice. If I want to tune Spotify playlists?


4 years ago on Introduction

I don't seem to be getting very far. I have been cutting and pasting the code, and keep getting:

"bash: syntax error near unexpected token `newline'"

on the 3rd line.

Does anyone know what I am doing wrong?

3 replies

Reply 4 years ago on Introduction


Some how the code layout has got corrupted and some stray html code has got mixed in i will update and fix it.

Sorry for any problems.



Reply 4 years ago on Introduction

All done, if you still have any issues cut and paste the code you are having issues with and i will help you out has much has i can.


4 years ago on Introduction

I have made this internet radio, following the instruct-able (thanks for a great project!) and it works OK. But, if the radio stream is interrupted, the radio stops and doesn't pick up the station again when it returns. Is there any way to add some buffering or repeated tries to reconnect ??

4 replies

Reply 4 years ago on Introduction


I am at work at the moment but is sounds like a buffering problem. You might be able to fix it with the following guide.


i will have a look when i can let me no if that works.


Reply 4 years ago on Introduction

Thanks Adam,

I'll have a look at that this evening and let you know.

Otherwise it's a great project - many thanks !!


Reply 4 years ago on Introduction

That's Fantastic if you get chance post some pics of the build, would love to love to see it.


Reply 4 years ago on Introduction

Hi again, Adam,

I've changed the settings as outlined in the volumio link you gave and things are looking much better!

(I am using a wired connection to my router)

The biggest improvement has been to add :-

buffer_time "15000000"

(yes, 15 seconds !)

to the alsa audio_output section of /etc/mpd.conf

So far the stream has been running for half an hour without any hickup !

My internet connection can be a bit iffy here in North Cyprus so I think your comment about it being a buffering problem is spot on.

Running "top" on the pi is showing "mpd" using about 10% cpu, 4.% memory and "radio.py" using 3% CPU and 1.5% memory.

Many thanks for your help, I'll get back if it goes "pear shaped"!



4 years ago on Introduction

For the voltage regulator, did you use a simple 7805? If so, how did you prevent signal noise coming from the Pi? I am attempting a similar project using a USB DAC. I was thinking of using a DC-DC buck converter to avoid the signal noise.