Raspberry Pi Internet Radio / Music Player

Introduction

In the March 2012 issue of Nuts and Volts I wrote an article entitled “Build Your Own Wifi Internet Radio” about how to build an Internet radio using a repurposed wireless router. While this project worked fine (and still does) it had limitations driven mainly by the small amount of RAM available on the router. After publication of that article, I continued to evolve the design so that it could also play MP3 files stored on a flash / thumb drive as well as functioning as an Internet radio player. I liked the idea of having the music I was currently interested in on a flash drive and being able to change it easily. Also since the capacity of flash drives were going up and the prices were going down I could have a rather large number of songs available at one time. And to put frosting on the proverbial cake I could control the Internet radio / music file player with a new iPhone / iPod Touch app I was developing called MpdClient.

Raspberry Pi Internet Radio  Music Player

As time passed I became frustrated with the fact I had to convert all of the songs I wanted to play on my Internet radio / music file player to MP3s to play them so I started looking for a better solution that would allow me to play many different types of music files. When the Raspberry Pi came on the scene I figured out how to run a full featured version of MPD which solved all my problems. Now setting in my favorite chair I can listen to Internet radio stations or play artists, albums or individual songs from a flash drive plugged onto my Raspberry Pi.

In this article I will show you step by step how to make your Raspberry Pi into a remote controllable, Internet radio / music file player.

Hardware

With the high level of system integration on the Raspberry Pi you can make a Internet radio / music file player with fewer parts than what would be required using a repurposed wireless router. Figure One shows a block diagram of the proposed system and Table Two gives some specifics as to the components required. For our purposes here, I will assume your Raspberry Pi will be connected to an existing audio system (through an appropriate stereo interconnect cable) or used with headphones so we won’t worry about discussing amplifiers or speakers. I will show you how to connect the Raspberry Pi wirelessly to your local wireless network using an inexpensive (less than $6) USB wifi adapter however, you could run an Ethernet cable from your Raspberry Pi to your router and skip the wifi stuff altogether.

The two USB ports on the Raspberry Pi Model B fit our needs exactly with one port for the USB wifi adapter and the other for a flash drive containing your music. A Model A Raspberry Pi would not work for this application because it only has a single USB port unless you wanted to incorporate a USB hub into your system. In any case the increased amount of RAM (512 Mbytes) on the Model B probably makes the MPD server run better.

So the hardware connections to/from the Raspberry Pi are as follows:

  1. Connection of the power adapter to the micro USB port on the card
  2. Connection of the 3.5 mm audio output to your music system via the appropriate cable
  3. Insertion of the 4 Gbytes or larger SD memory card containing the operating system
  4. Connection of the USB wifi adapter to one of the USB ports
  5. Temporary connection of a USB hub to the other USB port. This will only be needed during the setup process and will be removed when setup is completed. Connect a USB keyboard and mouse to the hub at this time. The USB hub will be replaced with a USB flash drive containing your music library when setup is finished.
  6. Connection to either an HDMI or composite video monitor. Your Raspberry Pi will run headless, that is with no monitor required, once the installation procedure is competed.

– See more at: http://blog.mcmelectronics.com/post/Raspberry-Pi-Internet-Radio-Music-Player#.VQ16RuGpeze

Internet Radio Music Player

Software

When I first began using the Raspberry Pi for Internet radio it had a real problem with loud pops when changing stations. So loud in fact as to almost make this arrangement almost unusable. Recently, however I reloaded my Raspberry Pi with the 02-09-2013 version of the Raspbian operating system (available from raspberrypi.org) and this problem seems to have been fixed. If you have an older version of the operating system software on your Raspberry Pi, I strongly suggest reloading it with this new version by following the direction in my article, “Raspberry Pi, Anyone ?”, in the March 2013 issue of Nuts and Volts. All of the initial configuration described in that article is still appropriate and should be done before proceeding.

– See more at: http://blog.mcmelectronics.com/post/Raspberry-Pi-Internet-Radio-Music-Player#.VQ16RuGpeze

Scroll to Top
Read previous post:
Detecting a button press through GPIO using Raspberry pi

If you want to build electronic devices, at some point you're going to need to read data through GPIO. In...

Close