Software apps and online services
Bad FM receive, small station selection, tiny control buttons paired with oily fingers - in a garage are special requirements for a radio. That was my reason to built my personal internet radio for my garage. A Raspberry Pi paired with a display and some push buttons and a bit software and the radio is ready... This was my first thought. But unfortunately it was not so easy.
This is my personal project, but maybe it's an inspiration for you.
You can read the complete project story on my blog. At the moment this blog posts are only available in German – sorry for that! But you can select your language in the Google translator toolbox on the right-side-menu (on the bottom).First Plan
It started with the question: How should my radio look like?
My plan was this:
- Use a rotary encoder to switch between the channels or the touch screen (if fingers are clean)
- Turn off the display, when noone is there
- Show only control elements, if someone wants to setup something. Otherwise show the station information
- Use some light effects
- And built a housing as a old Ghetto-Blaster-Style
(1) Speakers from an old stereo
(2) Volume control, used from a disassembled amplifier (type SMSL)
(3) 7" Raspberry touch display
(4) Rotary-Encoder with push button, to save the display from oily fingers
(5) Motion detector, type HC-SR505
(6) Infrared sensor, type GP2Y0A21YK0F IR Analog Sensor
(7) LED stripe, e.g. WS2801
(8) Raspberry Pi 3 (or other type)
(9) Power supply for all components
(10) LED module
(11) Amplifier, mine is: SMSL type SA-36A Pro HiFi Audio Stereo Digital with 12 V power supplyProf. Happy
Then I read the book of Paul Dolan Hapiness by Design. His definition of hapiness is the sum of joy (Freude) and meaningfulness (Sinnhaftigkeit). And that's as well my reason for being in a garage and built something ( - that's naturally only my mind, my family sometime think, I'm just escaping). As I thought of hapiness my box design of the radio didn't fit anymore. And when I thought "hapiness", I got one thing in my mind. So I changed the housing of the radio.
All components are connected to the Pi. The amplifier via 3, 5 mm audio jack and all other via the GPIO pins.
The LED stripe needs SPI pins that's why I used all pins on this side of the GPIO pins.
And I prepared a little shield - but only for this GPIO side.
In the center of the speaker-cover a placed a RGB LED. For that I printed a cover with a 3D printer. The LED are used for some visual effects and as signal that the system is on.
The electronic components are placed on my shield. I have solderd all resistors direct near the LED.
The motion detector should switch off the display, if nobody is in the room. And active the display if someone comes. For that I've used a HC-SR505. It needs 5V for VCC and has a DATA output with 3.3V. Perfect for the Raspberry Pi. The detector is assembled as the Smiley nose.
The rotary encoder should be the second device for inputs: change a station, play or pause e.g. I used a little capacitor for a hardware debounce. But it didn't debounced as long as I want, so I did a software one too.
This gadget changes the visibilty of the software control elements. If your hand gets closer, the control elements appear. I used the IR sensor GP2Y0A21YK0F which is built for Arduinos. The output signal is analog from 0 to 5V. Not good for the Pi. But in my case 0 or 1 is enough. I used a voltage divider.
With the LED stripe I wanted some really cool effects: a colored audio level meter (but until now it's only a idea). I used the WS2801 one. It is a bit more expensive than the WS2812, but it works with the hardware PWM of the Pi.
For my radio 1 m - 32 LED - is enough. In my case I got a problem with the colors of the wires. The red one was not 5V, but CI. So nothing worked and it took me a long time to fix it. So if it doesn't work in your case, cut off the isolation and check the wires.My Shield
All electric components are placed on my shield. It looks a little bit wild and surley doesn't win a beauty price - but it works!
The power supply caused me a lot of headaches at the beginning. The amplifier requires 12V and 3A. The LED band 5V and about 1.8 A. The Raspberry Pi 5V and 2.5 A.
Which fits best here? Use a multiple plug-in power supply? Or install a PC power supply equal? This at least equals all voltages with sufficient amperage.
My decision was on an old notebook power supply. It supplies 12 V and 6 A and it does not have to be installed in the housing. For the 5V of the Pi and the LED stripe I used the step down converter TE482 (6-24 V -> 5V, 3A).
As you suspected, the housing becomes a Smiley. The round plates for front and back sawed out with a band saw. It's pretty easy with a small screw in the center of the circle.
For the openings of the speakers and the display I used a saw with a fine saw blade.
It was only difficult with the rectangular shape of the infrared sensor. Finally, it was then manual work with the jigsaw.
To find the right thing for the round side cover was the hardest. I imagined something like a thin black plastic plate. Then I wanted to glue the LED strip on it. But I haven't found anything for a long time.The saving idea came from my father: why not use transparent Plexiglas and glue paper behind it.And that's how it has become. I liked the transparent version really well. Now there is no black paper and the LED stripe is glued inside.At ebay, Plexiglas or something alternative is quite expensive. As a cost-effective variant I have discovered a 1 mm thick flexible garden shed cover from the Baumarkt-store.
For the attachment I only had to mill a groove (is groove the right word??) in the front and back plate with a small milling cutter. This works again with the same principle as sawing the circles.Amplifier
The amplifier has an on / off switch in addition to the volume control. I didn't want to dismantle that. I've decided to build an extension for the volume pot. My version was an extension from the 3D printer.
The board is held with two wooden strips, which are then screwed.
So this was quite a lot work til now. For testing of the compontens I used some Python test programs. You can download them here. There you'll find the 3D STL files too.And Now the Software
As coding language I like Lazarus (Freepascal). For developing with your Raspberry Pi you need to install it on the Pi. My software isn't finished, but it works. You'll find some tips and tricks and how the software works here (again only in German).
For playing internet radio I like the library BASS from un4seen.com. To control the GPIO's I've worked with Gordon Henderson's wiringPi.
Yes, that's an exciting question. I've collected a lot of ideas during the project and would like to implement them.
Meanwhile, my original garage radio is not in the workshop, but in my daughter's room!
That means, that I can deal with extensions more to the wishes of my new customer. Here are more cellphone connection or Youtube videos on the requirement list.
Visit my blog https://techpluscode.de if you want to know what's going on.
I wish you much fun with the making of your garage radio!Let me know, how it looks like or tell me your ideas.