Introduction: Flush Wall-Mounted Raspberry Pi Touchscreen
The Raspberry Pi 7" Touchscreen is an amazing, affordable piece of tech. I decided I wanted to mount one to my wall to use for home automation. But none of the DIY mounts I found online dealt with the problem of how to flush mount it with no exposed wires. This project shows you how to do it.
The Pi hanging off the back of the touchscreen is too large to fit into a 2-gang electrical box. And the screen isn't large enough to cover a 3-gang box. Plus, there's the problem of power. To eliminate any visible wires, I wanted to run 120VAC Romex wire inside the wall and into the box, and place a 5V USB transformer there. So the box needed to be partitioned into a high-voltage zone and a low-voltage zone.
My solution is to use a 3-gang, 55 cubic inch remodel box. I 3D-printed a set of partitions to wall off the high voltage and the transformer from the Pi and screen. And I printed a bezel frame that wraps the silver edge of the touchscreen and covers the electrical box completely.
The resulting system is very sleek. It only extends 15mm beyond the sheetrock. All the wiring is inside the wall and inside the box. And if you have cat5 inside your walls, there's space to connect it to the Pi as well.
Step 1: The Parts You'll Need
Here are the parts you'll need for the project:
- Raspberry Pi 3 Model B, Micro SD, and 7" Touchscreen. I don't cover the details of setting up the Raspberry Pi, but there are many good tutorials online like this one
- Carlon B355R 3-gang electrical remodel box. The Home Depot link is for a set of 6. A single one costs less than $5 at Home Depot
- Micro USB cable, with right-angle ends
- Apple 10W or 12W USB adapter. There are a lot of USB adapters out there, but you need a very compact one that puts out at least 2.1A. Any less than that, and the touchscreen will show a low-voltage warning. The Apple adapter was the only one I found that met these requirements
- I've shown the cut-off end of a lightweight household extension cord. In the end, as you'll see later, I decided not to use this
- A C7 extension cord (not shown in photo)
- 4 M3-6 screws
- 4 electrical box screws. Something in the range of 3/4"-1" is fine, but most any size will work
- A 3D printer
All the Sketchup designs and STL files can be found here on Thingiverse. The Tracks and Walls and the Faceplate can be printed in any color. They won't be visible. The Bezel will be visible, so I recommend printing in black. You'll definitely need to print the Bezel and Faceplate using full support. But if you print the Bezel in the orientation shown, none of the surfaces that touched support will be exposed.
Step 2: Glue the Tracks in the Electrical Box
These three partitions create a space large enough to house the Romex and USB transformer, physically isolated from the Pi and touchscreen. The partitions are designed to be easily inserted and removed multiple times once the two tracks are glued in place.
Insert partition #1 into the channel that is molded into the box itself. Then add partition #2. Finally, place the tracks on the top and bottom of partition #3 and slide it into place. The tabs on partition #2 should fit into the slots in #1 and #3. Once everything is in place (#1 touching the back of the box; #3 flush with the front of the box, and aligned parallel to the sides), use a pencil to mark the edges of the tracks.
Remove everything, and then glue the tracks back where they were using the lines as a guide. BE SURE to rotate the tracks so the "stop" is toward the rear of the box. This allows partition #3 to slide in and out as needed.
Step 3: Modify the Adapter Board Slightly, to Fit in a Smaller Space
With this project, every inch counts. The two jumper cables connecting the Pi to the touchscreen adapter board stick out the side about 1/2" from the adapter board, and we need that space back. So you'll have to cut off the jumpers and solder the wires directly onto the board. The other ends, which connect to the Raspberry Pi, don't require any modification. That's good news-- the boards can still be detached from each other if needed.
Step 4: Connect the Bezel to the Pi/Touchscreen Assembly
Cut some thin strips of electrical tape and wrap them around the tabs on the bezel. These will give the system a bit more grip when the tabs slide into the corresponding slots on the faceplate.
Then attach the bezel to the touchscreen using the 4 M3 screws.
Step 5: Final Assembly
Obviously... Cut The Power First!
Install the 3-gang box in the wall. Pull the Romex in through a port at the far right. If you're running cat5e for Ethernet, pull that through a port at the far left. Cut the Romex wires as short as you're comfortable with. You want enough length to work with, but as little as possible, since there's not a lot of room in the box to stuff them in.
Cut the C7 extension cord down to about 6". Separate the two wires, strip, and wire them to the Romex using wire nuts. Attach the C7 cord to one side of the USB transformer, and attach the USB cable to the other. Stuff the transformer and wires into the back right corner of the box.
Insert partition #1. Pass the USB cable through the semi-circular cut-out at the back.
Insert the other two partitions carefully. You may need to twist the transformer and cables around a bit to fit in the L-shaped space available. Now all the high-voltage wiring is safely walled off from the area where the Pi will live. Only the USB cable spans the two spaces.
Using the electrical box screws, attach the faceplate to the electrical box.
Finally, coil up the USB cable, attach the Pi to the USB cable, and connect the bezel to the faceplate by moving it horizontally into place and then pushing down about 4mm vertically.
Turn the power back on, and... Congratulations!
Step 6: Final Thoughts
I'm not 100% sure the installation would pass inspection, but I've done a lot of electrical work that has passed inspection, and fundamentally this feels perfectly safe to me. I'd be interested to hear from anyone who sees any safety issues.