For years I've been Air Playing music from the iPhone to a stereo setup in the basement, with speakers wired back up into the kitchen. It works well enough, but drained my phone's battery and limited the content to my iTunes library or some web radio streams that were a bit of a pain to select and get playing.
A Raspberry Pi powered touch screen portal to the world of internet radio and beyond!
As Sparky the fridge magnet fire dog says, Don't forget to plan your fire escape and practice it with your whole family!
Step 1: Step 1: Why Walk When We Can Dance? Tappa Tappa Tappa...
Sure I could have just stuck an iPad or Android tablet to the side of our fridge, but where's the fun in that!?
Plus, seeing my wife roll her eyes at yet another of my Pi projects is priceless. :)
9 years ago when we moved into our house we had to cut down a small, dead, limbless maple tree that was left by the builders to qualify our lot as treed.
I saved some of the wood from that tree, knowing someday, just maybe I'd have a Pi project I could use it in... and here we are! A nice piece of wood from our first home history being made into the frame for the touch screen and Pi.
I hoped to give the frame a weathered board look, to match a really nice coat hook project my wife did.
I cut the length of maple board into two even boards and staggered them a few inches so the edges weren't uniform.
I created the opening for the touch screen by measuring the screen, including the position of the 4 screw tabs and drilling a pilot hole for my jigsaw blade, then cutting out the rectangle shape of the screen.
I drilled down on the two pieces of wood where the screen's screw tabs aligned just deep enough so that when installed, the screen's glass would sit slightly recessed from the surface of the wood (I wanted to put a wood edge frame around the edge of the screen).
I used my plunge router with a straight bit to remove maple from the two boards where the Pi would sit.
I set the depth so that the Pi would sit flush with the back of the maple boards so the GPIO pins wouldn't contact anything and still have enough maple on the front side to be strong.
Since the areas of the wood that were being removed were not going to be seen once the electronics were installed, I didn't spend a lot of time or effort making the cutting pretty.
Plus it was -19c in my garage. So this was done pretty quickly. :)
Step 2: Step 2: Leaving Your Pi Out in the Elements...
The second step was to give the frame some character.
My wife had built a really nice coat hook hanger months before (see photo), so I thought I'd mimic her design and built the holder in it's image.
I like the weathered barn board look, but I really don't want diesel / feces saturated barn boards stuck to the side of my kitchen fridge, so I opted to create a fake weathered frame for the project.
It's actually really easy.
Select the wood for your frame.
Since the Pi itself would be sitting fairly close to the surface of the board, I opted to use hardwood (maple).
Since we had a maple tree taken down the our backyard, I used the wood from that tree.
Thus giving a personal angle to the project
Select a few colours of paint, then brush the colours onto the boards. Don't go too crazy covering every inch of the board. Just brush on sections as shown in the photos.
I found white(ish), a blue and a grey worked well.
HINT: use paint you already own, or, buy small sample cans to save $$$.
Let the paint dry, then lightly sand off layers of paint in section, creating a weathered / worn look.
Step 3: Step 3: Scruffy Looking Pi Herder...
Once the paint was sanded off, creating the weathered illusion, it was time to join the two boards together.
I used a dowel screw at one end to secure the frame boards together, at the other end I used a wood screw that would not be seen once mounted to the fridge.
Pre-drill the screw holes with the appropriate sized bits to avoid splitting the wood.
After the paint was dried, sanded and drilled, I applied a dark stain to both boards using a cloth.
This gave the frame a classic look. Again, this is totally open to your own esthetics. You can choose to stain your frame dark, light or not at all.
Step 4: Step 4: Check Check and Recheck Clearances
Once dried (24h plus). I set the touch screen into the frame to check depth and positioning.
So far so good!
The 7" screen sits 1mm or so blow the surface of the maple board surface.
The Pi itself sits inside the rear hollowed our section of the board and the HDMI cable connection routes nicely between the PI and the screen.
Don't forget to peel off the protective film prior to attaching the edge frame in the next step! :)
Step 5: Step 5: Magnets Have Complex Relationships, Attractive or Repelling...
After verifying the positioning of the screen and the cables, I secured the touchscreen in place with 4 small screws.
I used good ol' PL construction adhesive to attache the mitered maple edge frame, stained with the same stain as the wood, around the screen.
Since the screen's screw tab holes are larger, I opted to place a wood frame around the screen, covering the holes and any other imperfections of the screen placement.
The only caveat was that two of the screws holes extended past the edge of the edge frame. No big deal, as I simply covered theses two spots with hardwood plugs, also stained dark. In hindsight, I should place two more hardwood plugs on the other side of the screen, creating symmetry.
Live and learn. :)
Since the FridgePi was going to be living on the side of our kitchen fridge, I choose magnets as the means to attach it to the fridge.
Magnets are non-destructive, and (if you collect enough old electronic junk like I do), free!
Old 3.5" hard drives are a goldmine for extremely powerful, large surface area plate magnets.
The ones pictured have fields so strong, they can stay attached to opposite sides of my hand.
They also may have the added bonus of including screw mounting holes.
Step 6: Step 6: Music Makes the Network Grow Fonder
So now that the interface (FridgePi) side of the project id done, I setup a Pi with Volumio installed to act as the actual music streaming server.
You can check out the free Volumio software here: https://volumio.org/
I setup a Pi 3 with a 16mb SanDisk micro SD card and installed the Volumio image into to.
I used a HiFiBerry DAC Plus connected to the GPIO and RCA out to my 1994 JVC stereo receiver that is wired to speakers throughout our house.
Our music is stored on a Synology 1515+ and Volumio allows for AirPlay as well as thousands of web radio streams, which is good, because I love listening to Nectarine Demoscene Radio www.scenemusic.net
My wife does not... :)
I set the JVC amp to a decent MAX volume level, then configured the Pi running Volumio to access my network shared iTunes and (more importantly) DemoScene music folders on my Synology NAS.
I gave the Volumio Pi a static IP address then let it sit headless, connected to my basement network switch.
Step 7: Step 7: a NANOing We Will Go...
After configuring the Volumio Pi server, I setup the Pi that would be the main interface and be stuck the side side of our fridge.
The first thing I did was install the latest Raspbian (Stretch) from the Raspberry Pi website.
On the first boot, you'll notice the screen image quality looks like garbage. No worries! We just need to manually define the optimal resolution of 800x400 (note, your touch screen optimal resolution may be different).
Do this by editing your config.txt file in the /boot directory:
sudo nano /boot/config.txt
Add the following:
hdmi_cvt=800 480 60 6 0 0
Save and reboot the Pi.
That should look better. :)
Auto Start Chromium
Then, I had to set it to automatically start x, and login with the default user "pi".
Once the system was automatically logging in and starting the GUI, I set it to automatically load the Chromium web browser in full-screen mode on startup and directed it to the Volumio Pi server.
To do this, I did the following (remember, this is Stretch):
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add the folliwing line:
@lxterminal -e chromium-browser --start-fullscreen --incognito 10.0.1.27
Where 10.0.1.27 would be your own volumio server address of course.
Remove the Cursor
Having the mouse cursor on the screen at all times is annoying, so to remove it, we use a little utility called unclutter.
Install unclutter using the terminal:
sudo apt-get install unclutter
Then, if it didn't do it by itself, simply edit your autostart file once again:
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
@unclutter -idle 0
Now you'll only see a cursor briefly when you actually touch the screen.
Flip your touchscreen coordinates
IF you need to rotate your display upside down (say, moving it from one side of the fridge to the other) like I did, you will need to not only flip the HDMI image, but also the touch screen coordinates.
NOTE: I believe the actual Raspberry Foundation Official 7" Touchscreen does not require these steps, this is more for the plethora of 3rd party screens out there. Like the one I used. :)
Step 1: Flip the HDMI video
Edit your config.txt file located in /boot:
sudo nano /boot/config.txt
Add the following line:
display_rotate=2 180 degrees
Step 2: Flip your touch screen coordinates
Edit the file 40-libinput.conf located in /usr/share/X11/xorg.conf.d
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
comment out the existing entire section referencing "InputClass" with the identifier for "libinput touchscreen catchall"
Make sure it's the touchscreen and not the touchpad or tablet sections you're commenting out.
Now, add the following:
Identifier "libinput touchscreen catchall"
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
Save and reboot.
This "should" flip the touchscreen coordinates.
I hope that you enjoyed this Instructable!
I had a great time making it, and listening to it as I typed this out!
I've already stated modifying this project to include an LED illuminated push button that will toggle the back light on/off for the screen, as well as a second push button that will allow me to cycle through the various desktops and run multiple programs, so FridgePi can be used for displaying not only Volumio, but also Weather Reports, Freezer Contents Tracking database, Family Events Calendar, etc...
Stay tuned for more on these new features... Same bat time, same bat channel!
Questions, comments, suggestions, ideas, please don't hesitate to send them my way!
Take care, and happy hacking!