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: Choose a Power Source
You can bring power to your touchscreen in two ways, and the steps are slightly different each way.
First, you can use Power Over Ethernet (POE). This method is preferred, but only works if you can run cat5 to your electrical box, and can add a POE injector or a POE switch at the other end.
The second option is to tie into the 120VAC power system of your house. You should only choose this option if you're familiar with high voltage household wiring, and can find a way to run Romex to your electrical box from a nearby outlet or switch. Important disclaimer: I can't guarantee that this method is approved by the electrical code; you're on your own to decide if it makes sense in your situation.
From here on out, I'll refer to these as "Option POE" and "Option 120".
Step 2: 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
- 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
- Option POE:
- 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
- A C7 extension cord (not shown in photo)
All the Sketchup designs and STL files can be found here on Thingiverse. A few notes on the 3D printed parts:
- The tracks & 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 the support will be exposed.
- The tracks & walls are not required for Option POE.
- I recommend using Bezel_v2 and Faceplate_v2, although the photos in this Instructable show some v1 parts.
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 M3 screws.
Step 5: [Option 120 Only] Glue the Tracks in the Electrical Box
Option 120 Only: 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 6: Final Assembly (Option POE)
Install the 3-gang box in the wall. Pull the network cable through a port at the far left.
Using the electrical box screws, attach the faceplate to the electrical box.
Attach the POE splitter to the network cable. This gives you an Ethernet cable and a micro USB for power. Unfortunately, the Ethernet coming from the POE splitter I recommend is too stiff to make the sharp turn required to fit into the box. So I made a short extension using a jack, a plug, and 6 inches of cat5. This extender is flexible enough to make the turn.
Attach Ethernet and micro USB to the Raspberry Pi. Gently push all the wires into the box, and connect the bezel to the faceplate by moving it horizontally into place and then pushing down about 4mm vertically.
Connect the other end of your cat5 to a POE source, and the touchscreen should power up. Congratulations!
Step 7: Final Assembly (Option 120)
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 8: Final Thoughts
I'm not 100% sure the Option 120 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.
Second Prize in the
Raspberry Pi Contest 2017