I want to share my latest DIY project with everyone: A Raspberry Pi based internet radio. Making this has been a blast and I’m very happy with the results. It performs nicely and sound pretty good. (It’s not Audiophile by any means).
I had a few specific goals for this project:
- It had to look good. Or at least, it shouldn’t look like I just stuffed a raspberry pi into an ice cream container and gave up. It had to be something I could put on a shelf or table in the lounge and have it not look out of place. I went for the retro vibe and built a timber box. The point color is called “Feisty Red” and I love it. You might be surprised but this was, by far, the hardest part of the whole project.
- It had to be simple to use. My initial goal was to be able to have music playing with the press of a single button.
The project uses the Pi MusicBox distribution for the Pi. This provides a solid base with all the bits you need already installed. It also has great support for many popular DACs already built in. At the core of this is the Mopidy music server. This is what does most of the heavy lifting and through the use of special extensions, you can enable your Raspberry Pi to play or stream from a wide variety of music services like Spotify or Google Play Music as well as local or networked files. I’m using the Spotify service in particular but I also want access to other internet radio streaming services like SomaFM and DI.fm.
The entire radio is driven from a single rotary encoder. A short press on the rotary encoder will start or stop playing. If no playlist is loaded, we load a default playlist automatically and start playing. Turning the rotary encoder will adjust the volume. If you long press the rotary encoder button, a menu will be displayed.
I built a simple frontend extension for Mopidy which hooks into their core API and allows receiving of events (like the currently playing track). This extension is also responsible for receiving input from the rotary encoder, updating the LCD and driving the menu.
If you need to do anything fancier, you can connect via your phone or web browser and control the radio using the full interface.
- A Raspberry Pi Model B
- A 2.2inch 240×320 TFT LCD (ILI9341 controller). This particular LCD works with the Adafruit library available here.
- The amplifier is rated at about 3W which I built from a kit (available from Jaycar electronics)
- A dodgy speaker that I pulled out of an old Logitech subwoofer.
- I built my own power supply board with dual rails of 5V for powering the Pi and +-12V for powering the amplifier.
A rotary encoder
Here you can see the bits and pieces mounted inside the case. The power supply to the left, the amplifier board to the middle and the Pi (with USB sound card) up on side in the middle. The black box on the right is a ground loop isolator which helps reduces noise from the power supply getting into the signal. If I was more skilled at power supply design I might have been able to get away without this… but alas.
I would like to try and capture a video of the menu in operation… but for now, here is another picture. J