Radiodan is a piece of software that lets you build your own internet radio.
This site explains how to set it up on a Raspberry Pi with some BBC streams, but it is easy to use with other streams, and to add MP3 files (and other audio formats). It uses Ruby code on top of MPD.
We've made it because we are interested in different kinds of physical radio devices and how we might change their functionality to make them better. We think that it's only possible to test what makes a radio better by building devices that act like radios, and that the more people who can build them, the more interesting the radios will be.
There are also case construction instructions.
Things you will need
An SD card reader - computers sometimes have them built in, or they can be bought very cheaply.
A computer suitable for putting data on the SD card - Windows, Linux or Mac OS X.
A wifi connection - it can be open or password protected (WPA or WEP), but our wifi configuration tool which links the Raspberry PI to a wifi network won't work if it's a captive portal where you have to go through a web page to get connected. It also won't work with proxies at the moment.c
A Raspberry Pi. The Raspberry Pi is a small, cheap computer with an ethernet port, two USB ports, audio and video. It doesn't come with a keyboard, monitor, mouse or hard drive - it's powered from an SD card of the kind you get in cameras. You can buy Pis from Farnell or RS
An SD Card - get a 4GB (or larger) class 10 card like this one. It's quite hard to find standard cards smaller than 16GB, so you could use a micro SD card (but remember to buy an adaptor, like this one)
A speaker. Anything with a standard jack will do. There are some very cheap tiny speakers available, such as this one.
a mini-USB mains plug power supply for the Pi
The approximate cost should be about £60.
- A soundcard, like this one, in which case you might need a small USB extender - you'll need to configure the sound card manually
- One buttons and two rotary encoders with dials, jumper wire, spade connectors and crimpers (see below). You can do without these but it's more fun if you have physical buttons and dials for your radio. A simpler alternative is just two buttons.
- Keyboard, mouse, monitor. You don't need these to set it up, though if something goes wrong it might be helpful to have them.
this Raspberry PI img (1G gzip)1. Download
2. Put the image on the SD card using the SD card reader
diskutil list diskutil unmountDisk /dev/diskn sudo dd bs=1m if=/dev/diskn of=~/Downloads/radiodan.img
3. Eject the disk from your SD card reader and assemble the basic set of components, like this:
4. Plug the Pi in
And wait about 2 minutes.
5. Set up the Pi on the wifi
When NOOBS is installed, you should see a new wifi network called 'radiodan-configuration'.
Join this network, and go to a web page (or if you are on a Mac you should see a web page pop up, like a 'captive portal' you get with some wifi networks). Follow the instructions and select a wifi network to connect to and type in the password. Click 'reboot now', and rejoin your usual wifi network.
## 6. Listen to the radio
If all that has worked, 1 - 2 minutes after the reboot, you should hear Radio 1 playing.
7. Control it using the webpage
You can control your radio by adding buttons and dials (see below), but also by going to
in a web browser when you are on the same wifi network as your radiodan.
What's happening under the hood
The image we have created uses the cold_start project to remove some of the packages that come with Raspbian, in order to make the image as small as possible. This includes all of the Desktop packages, so that if you want to programme it later you'll have to use the command line.
It also sets up three programmes to run on startup
- wifi-configuration web interface and setup
- app runner
The wifi configuration scans the environment for networks and then makes itself a wifi access point. This means that you can connect to it using another computer and set it up in a web page, as described above.
The app runner looks for Ruby applications in the /home/pi/apps/ folder and if they have a Procfile, attempts to install all their Ruby dependencies (using bundler) and then uses Upstart to ensure that they start when the machine is booted. Two are included - radiodan_example and radiodan_example_physical_interface
If you've got this far, you should be able to control your radio using its built-in webpage, but it's much more fun to wire up some physical buttons to make it more like a real radio.
For this you will need:
- Two rotary encoders with a knob. Get ones with a screw-in part to fix them to the box.
- A clicky button, for example these, again, it's best if you can find one that you can screw to your box. The clickiness gives better feedback to the person clicking it that it's been pushed correctly.
- Some jumper wire. Easiest is to get male to female, like this
- Spade connectors suitable for your buttons and also for your rotary encoders. For example these - check that they are the correct size for your button's connectors. These are just a way for you to connect your buttons to your Pi without soldering. You could also use crocodile clips.
- A crimper, like this one (you may be able to make do with pliers, but I wouldn't recommend it), to join your spade connectors to your jumper wire.
Assemble everything according to this diagram:
This is quite complicated, because the rotary encoders use so many pins. Here's a simpler, 2-button, 1 led version.