This project came about because my current audio set-up in my kitchen which, while sounding great, did not score well on the wife acceptance front.
To be acceptable, I needed a solution that:
- Looked good (WAF tick)
- Easy to use (WAF tick)
- Satisfied all my music needs (radio, squeezeplayer etc.)
My plan was to get an vintage(-looking) Roberts radio, gut it and put in a Pi.
I got this off eBay:
Hopefully that would satisfy the first part of the brief!
To be easy to use I figured a nice LCD plus a couple of rotary encoder dials should be sufficient.
For my music needs:
- It needs to sound good
- I need it to run squeezelite (for my multi-room audio sync set-up)
- Loud (the Roberts only had 1 speaker, there's definitely space for 2!)
- To be honest, that's enough for me!
I bought the following:
- Roberts Radio
- 20x4 LCD display
- 2x rotary encoders + oversized knobs (no giggling at the back!)
- MAX98306 amplifier
- 2x 4ohm 5W speakers
I figured it wasn't worth doing the hardware build unless I could get the software working first.
Using Raspbian Jessie as a base, I installed:
- Shairport-Sync (let people use this as an Airplay device)
- Bluetooth audio streaming capability (to use radio as a bluetooth speaker)
- MPD/MPC for internet radio playing
I'd never used rotary encoders before but I found some useful code in the forum already (using Joan's pigpio module) which worked on the first attempt. Very satisfying.
Next up, I wrote a basic menu class (for those familiar with my posts on the forum, you'll know I do everything in python) which allowed for simple actions and submenus.
After that, I figured that making this radio extensible (I think that's a word) would be good. So each function (radio, squeezeplayer etc) would be a "mode" which means I could easily drop in new "modes" in the future if I needed.
Next was the display code. The idea was very simple, just show as much info as possible (time, menu, current playing track info etc.). Each "mode" has the ability to send information to the display.
I then wrote an eveloping bit of code to pull it all together and then wrote a systemd service to start the software on boot.
I realised had one big problem to overcome if I was going to get this to work: I needed to replace the top panel on the radio with a custom one that would house my dials and LCD. Douglas6 kindly suggested that I could get a custom piece laser cut pretty cheaply.
Armed with some digital calipers and spec sheets I designed a top panel for the radio and mount for the speakers and got these cut.
With that done, it was time to gut the radio:
I then built my top panel and was delighted to find that all parts fitted first time.
I then wired up the amp to the speakers on the custom panel and put them into the case.
I mounted the Pi on the inside cover.
I used a Adafruit Perma-Proto Pi HAT for the wiring.
On Github: https://github.com/elParaguayo/PiRadio
Things to do/fix:
- Only 1 speaker works at the moment (checked the wiring more times than I care to admit and I don't see a problem) - I suspect the amp is the issue.
- Think about a dedicated DAC - the hiss from the Pi is off-putting (but only at low volumes)
Tidy up code and post on Github