I really like listening to some music in my kitchen and in the bathroom. Therefore I used an plain old FM radio for quite some time. Since signal quality and available stations really sucked, I decided to build myself a web radio by disassembling the old FM radio and putting a Raspberry Pi in that case.
For these requirements I simply could have bought one of the many web radios out there, but there's not a single one with integrated motion sensor (PIR) switching it on/off when entering/leaving the room. I don't know why, but in my eyes this makes so much sense, because usually you only enter these rooms for a short time and it's way to much effort to always turn the radio on and off manually.
Big PictureBeside the PIR sensor mentioned before, I decided to add a rotary encoder to control the volume. The one I used comes with a build-in switch for changing channels and an RGB-LED showing me which channel is tuned in. So this is the result:
I'm not a professional when it comes to soldering, mounting hardware or building accurate cases. I simply teared the original electronics out the case and drilled some holes for PIR sensor and volume knob. After wiring I mounted them with a hot-melt gun. As you might notice on the picture, I'm using a little proto-board connected to my PI socket where led resistors are soldered and wires connected.
I think you can do way better and since assembly is highly dependent on the case you're about to use, I don't want to lose myself in details. That's why I tried to put all important information the attached schematics.
To control that thing I decided to write some simple C code, simply because I like C and you don't need much dependencies, special libraries or interpreter stuff. Get the sources and a complete setup and configuration guide (from OS to running radio) on GitHub: https://github.com/limbomedia/limboradio
The software is based on:
- MPD (Music play daemon) for playing radio streams
libmpd
to connect to MPD
wiringpi
to read/write GPIOs
"Highlights" of the software:
- Configuration file to configure stations, time-to-radio-off, GPIO pins
- Included
systemd
script for autostarting that radio
- Options to run with a MAX9744 20W amplifier for way more power.
Have fun with this tutorial and let me know if something's missing!
Visit my LimboMedia Home- and MediaServer project as well on: http://limbomedia.net
Comments