Flush Wall-Mounted Raspberry Pi Touchscreen

79,577

535

53

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: 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:

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

The touchscreen looks really sharp. I'm using it to run HADashboard, which is part of the Home Assistant home automation open source project. Hopefully you can find something fun to run on yours.

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.

Raspberry Pi Contest 2017

Second Prize in the
Raspberry Pi Contest 2017

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    53 Discussions

    2
    gormly
    gormly

    3 years ago

    I am not an electrician and I hate to be that guy, but I am 99.999% sure this isn't code or really all that "safe" and would not pass any inspection at all. Gadget transformers are not supposed to be buried in the wall or connected directly to with live wires like this. (electrical tape)


    Any number of things can happen.

    You can purchase recessed electrical boxes, some are just deeper, some are deeper and at an angle that can hold the plug behind the screen or you can use an outlet in conjunction that has a USB power port. Other people have also suggested POE. Any other method seems better for the average person trying to do something like this.

    I don't mean to be a downer but a lot of instructables do not consider or discuss safety, they just list what works for them and leave everyone believing it's ok. It's on instructables so it must be ok.. but it's not.

    0
    peter_3d
    peter_3d

    Reply 3 years ago

    Thanks for your comment, and no worry about being a downer-- I asked for the feedback.

    I looked at the option you mentioned of using a recessed electrical box, and couldn't get it to work from a pure space-management perspective. And ultimately, I concluded this is no different. In either case, you have a transformer inside an electrical box, accessible simply by removing the touchscreen.

    I agree with your point that wiring directly to the transformer doesn't feel quite right. However one nice feature of the Apple transformer is that the plug is detachable from the transformer. So even though the plug is hard-wired, the transformer is safely removable without tools.

    POE seems like a good option if you have the cat5 available.

    Also, one person mentioned using the IEC C7 plug. I've ordered one and will report back on whether it in fact fits with the Apple transformer.

    1
    gormly
    gormly

    Reply 3 years ago

    The space issue you have is due to the transformer. But is it truly needed?

    I do not know anything about the power requirements of your screen/PI but is seems like just standard 5V? If that is the case and that's all you need, a recessed box with a USB port potentially solves any safety/wiring issues.

    Maybe I am not seeing it (could be) but it seems like the transformer is not actually needed and just being used because you have it?

    Anyway, just trying to help, good on you for not getting mad at me :)

    1
    scottinnh
    scottinnh

    Reply 2 years ago

    I logged in just to say what @gormly did.
    In ADDITION: get rid of the dividers. It's clever and considerate of the separation, but won't pass any electrical code.

    Once you have recessed boxes, you 'll be good. IF you find you need to "cut" into a faceplate -- just don't. Or worst case, install a low-voltage rated box for that (at least that way the 120V boxes have intact faceplates).

    Another option is larger "between the studs" general purpose boxes. Home networking folks use these. These are often designed with fire blocks at the top. Put anything you want in it basically. Or, put some slats between the studs, and drywall a recessed area (but there's code for that too, lol)

    In case anyone doubts: The 3D plastic isn't UL tested, and isn't rated for "in wall" use. Same with the transformer. I know some readers will shrug off the fire concern (their castle), but there's also 1st responders to consider, or lastly that also note insurance company MAY refuse to honor claims that had code violations.

    0
    JimG178
    JimG178

    Reply 3 years ago

    Correct

    0
    peter_3d
    peter_3d

    Reply 3 years ago

    @wkearney99, thanks for all the thoughts. It's actually a really hard problem. The 3-gang box provides enough space for the Pi hanging off the back of the touch screen, but the remaining space (and shape of that space) is not enough for a USB outlet or any other type of outlet.

    I'm going to post an update where I no longer wire-wrap the adapter prongs, and instead use an IEC C7 extension cord (see photos below). There will still be a transformer in the box, but it will be easily detachable without tools, so I don't see how that's any different than plugging a transformer into an outlet inside a recessed box.

    I will update soon and I'll be interested to hear your thoughts on the new version. Thanks for your interest. As you say, it's a tough problem.

    0
    wkearney99
    wkearney99

    Reply 3 years ago

    What are the dimensions of your bezel? Because maybe the Datacomm 45-0031-WH might work?

    https://images10.newegg.com/UploadFilesForNewegg/itemintelligence/DataComm/inst_45_0031_41_321400446674910.pdf

    One of those, coupled with an in-outlet USB charger like one of these from Leviton:

    http://www.leviton.com/en/search-results#q=usb%20charger%20devices&t=Products&sort=relevancy&f:@nema=[5-15R]

    And bravo to you for taking the initiative to make this, and the instructable. With maybe a bit of investigating it might be possible to come up with a more code-compliant solution.

    --Bill

    0
    CaptClaude
    CaptClaude

    Reply 4 months ago

    I know it's been 3 years but I am about to do what @peter_3d did but came to a screeching halt with the code compliance aspect. Then you chimed in with the Arlington and Datacomm products and saved the day for me. Now I have a way of recessing my Pi into the wall and powering it safely. Thanks to both of you!

    0
    peter_3d
    peter_3d

    Reply 4 months ago

    Awesome! I've deployed a few more of these over the years, but I've always used PoE. Can you post links to the specific items you used, and maybe a picture? I'm interested to see how it all comes together.

    0
    CaptClaude
    CaptClaude

    Reply 4 months ago

    I am *about to* -- meaning that I'm still in the tinkering phase. The project is under-cabinet lighting using 5 SK6812 strips each controlled by a D1-Mini running WLED (that's the plan). There will be at least one wall-mounted remote control based on either an ESP32 or RPi0W. The remotes will have touch screens, probably something like this:
    https://www.amazon.com/HiLetgo-240X320-Resolution-...
    The boxes I found are this:
    https://www.amazon.com/dp/B003FMVQ30
    And this:
    https://www.amazon.com/dp/B004GZ89N0
    Oh, and this too, with a divider to separate 120V & low-voltage:
    https://www.amazon.com/dp/B001XQ4JFC
    I assume that a bezel could be printed to mount the display and Pi/ESP that would cover the opening hiding the 120V outlet with USB power supply plugged into it. If the bezel is easily removable, the hidden power wiring is [probably] not a code violation (except in Australia where the Electricians Guild has convinced everyone that nobody but a licensed electrician can wire safely.)
    Now that I've documented all of this here, maybe I should write my own instructable?

    0
    flozito
    flozito

    Question 8 months ago on Introduction

    First off, great job. I just started this project and was wondering how you got the dashboard to automatically load.

    0
    peter_3d
    peter_3d

    Answer 8 months ago

    On Raspian Buster, I edited /etc/xdg/lxsession/LXDE-pi/autostart and added a line to launch Chromium, something like.

    @/usr/bin/chromium-browser
    --noerrdialogs --incognito --disable-pinch --start-maximized --kiosk <DASHBOARD_URL>

    0
    flozito
    flozito

    Reply 8 months ago

    Thanks so much!

    0
    Trynius
    Trynius

    Question 9 months ago

    Have you had any issues with heat dissipation? I'm using a POE hat on a RPi4 and have set the fan thresholds to 60 and 68, drilled holes in the electrical box for more ventilation, but the fan on the hat is still running constantly.

    0
    peter_3d
    peter_3d

    Answer 9 months ago

    I've only used the Raspberry Pi 3 B+, with an external PoE injector, and haven't had any heat issues. I'm guessing the Pi 4 draws a lot more power? I would definitely be concerned if things are heating up inside the wall box-- there's nowhere for that heat to go.

    0
    Cosmosisjones
    Cosmosisjones

    1 year ago

    peter_3d - Did you add an ambient light sensor or anythign to this so it doesn't blind you at night?
    I am going to add that and then was considering adding an auto off and a motion sensor for auto on.. Has anyone done anything like that?

    0
    K-MTG
    K-MTG

    Reply 1 year ago

    I plan to either use a motion sensor or run a script on my home automation platform (Hubitat) to turn on/off the screen of the RPI.
    Motion sensor might be easier but most of the DIY motion sensors are an eye-sore. Did you find anything that looks nice? And where will we put it?