Introduction: Flush Wall-Mounted Raspberry Pi Touchscreen

Picture of 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

Picture of 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. 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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

Picture of 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 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.

Comments

mglaske (author)2018-01-09

The bezel looks awesome! I'm doing something similar for my house automation project, however, I'm using PoE to USB Adapters, which have enough power to power the Raspberry Pi and Display, then you don't have to mess with high-voltage, and it uses a smaller footprint..

https://www.amazon.com/gp/product/B019BLMWWW

So far so good. You can even use them without the ethernet data to power tablets as well.

peter_3d (author)mglaske2018-01-09

Good suggestion. In my case, I didn't have cat5 available at this install location. But for those who do, I think POE is a superior solution. In that case, you can omit the Walls and Tracks part of the project, and just use the Faceframe and Bezel.

One important note is that the micro USB connect *must* be a right angle connector, or else it won't fit inside the cramped space of the electrical box. The POE adapter you linked to looks like it would work.

peter_3d (author)peter_3d2018-01-11

Actually, on closer inspection, it seems that adapter wouldn't work. It supplies 2A at 5V. I observed that if the Pi receives anything less than 2.1 Amps, it shows a low-voltage warning on the screen, and is susceptible to memory corruption. Have you not seen that problem with this adapter?

peter_3d (author)2018-01-11

Thanks again for all the comments about wiring and safety. I've updated the Instructable with the latest design, which uses a C7 extension cord. This approach eliminates the need to wire-wrap the prongs of the Apple USB adapter.

As for the comments about using an electrical box with an embedded, angled location to place a power outlet with USB connectors: I had already looked at those early in the process and I'm afraid they're all much too small. The electronics on the back of the touchscreen require about 2 1/2 spaces of a 3-gang box. This is why my design works so hard to wall off the high-voltage connections in a L-shaped space at the back of the box. Everything could fit in a 4-gang box, but then the bezel would need to be much wider horizontally. I've considered designing and 3D printing an electrical box that meets all the requirements, but that may be a different project altogether.

And as I said below, Power Over Ethernet could work well given the right adapter. In my case, cat5 wasn't available at my install locations.

wkearney99 (author)2018-01-11

If you've got enough room for a 3-gang box then maybe this one would be worth checking out:
http://www.aifittings.com/catalog/specialty-boxes/...
or their angled one:
http://www.aifittings.com/catalog/specialty-boxes/...

Along with any number of outlets with USB:
https://www.homedepot.com/b/Electrical-Dimmers-Swi...

So don't let me rain on the parade here, it's a solution I've been puzzling over for a while.

peter_3d (author)wkearney992018-01-11

@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.

wkearney99 (author)peter_3d2018-01-11

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

wkearney99 (author)2018-01-11

DO NOT DO THIS WITH THE TRANSFORMER! You're asking for a fire hazard by using stranded wire and a loose fit like that!

If you're powering everything with 5v usb then use one of the MANY UL-tested USB accessory outlets out there. That and Arlington and many others make recessed or angled wall boxes.

Code is there to help people avoid making deadly mistakes. Both from shock and fire hazards.

wkearney99 (author)wkearney992018-01-11

https://www.google.com/search?q=recessed+wall+boxe...

The downside to some of the boxes is they do require a wall cavity with enough depth and space along side. As in, where you want to put it might have a wall stud running down through it.

RumpelS (author)2018-01-11

You know that a network cable has 8 wires and only 4 are used? You could use the remaining wires to transfer for example 12 V DC into the box and put a 5V regulator 7805 into the box which regulates them down to 5V. Then you connect the 12V Adapter at the other end of the network cable and there is no high voltage in the box.

peter_3d (author)2018-01-10

Thanks for the suggestion that an IEC C7 plug might plug directly into the Apple USB adapter, @HockleyDawg. I bought one and it fits! This will eliminate the need to wire wrap the plugs on the adapter. I will update Instructable this weekend. Thanks very much for the great suggestion!

RobR2 (author)2018-01-10

Where does the Ethernet cable run to? could you not plug in the power supply there and run a long usb extension cord? There are USB to Ethernet adapters as well, though I dont now the voltage capacities of cat5,6,7 so one would want to check that before going that route.

Gandolf the green (author)2018-01-10

this is flipping brilliant. have you condidered hooking the PI up to a power distribution board and then connecting the lights and outlets in the room to it? the only problem i can see with the power distribution board is space. but you could always put it somewhere else and connect it with the ethernet cable.

good work

pro731 (author)2018-01-09

It is illegal to do low voltage fixed wiring if you are not an electrician in Australia. This is because it has potential life threatening consequences. The wiring shown does not meet AS3000 standards.

gormly (author)2018-01-09

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.

peter_3d (author)gormly2018-01-09

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.

gormly (author)peter_3d2018-01-09

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

JimG178 (author)gormly2018-01-09

Correct

Konrad-der-Rote (author)2018-01-09

Cool project. I second the PoE suggestion. By the way, can you give any information on your metal workshop table?

peter_3d (author)Konrad-der-Rote2018-01-09

Although it looks like a metal workshop tabletop, it's actually an indoor built-in desk, topped with a laminate material that just has that pattern on it.

josephlebold (author)2018-01-09

I would like to try installing this with the screen flush with the surface of the wall. Could be a little tricky mudding around the screen without scratching it but I think the final effect would be cool.
I think you did an awesome job with your installation. My thermostat sticks out farther than that.

ThatMouse (author)2018-01-09

Where I live we have frequent power outages, which corrupts the sd card in Raspbery Pi's or have they fixed that issue?

petonic (author)ThatMouse2018-01-09

The best way to do that is to configure the RPI3 to use USB_BOOT (see link below). Then, install the the RPI OS onto USB stick. SD Cards are far less robust than USB sticks, so this should help.

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

meckert3 (author)2018-01-09

Very slick. Need to find time for that project in my home too.

roybrew (author)2018-01-09

Do you have any issues with heat build up from the RPi.

Mikkel1955 (author)2018-01-09

Depending on the length of the run, you may want to consider using POE instead of bring line voltage to the box. I have used POE with a buck board to drop the voltage down to 5 volts. The best part is that it is considerably small then the USB power supply.

HockleyDawg (author)2018-01-08

Nice & clean looking result. Suggestion for the AC connection: The AC plug on the Apple adapter can slide off and exposes another connector into the adapter. This looks like an IEC C7 plug would fit in. You could use the smaller C7 plug to replace the extension cord segment (that you didn't use) and then plug right into the adapter.

rmd6502 (author)HockleyDawg2018-01-08

Agreed - that also exposes the connection for the earth ground, which might be a good idea, though everything is already pretty well isolated so may not make a difference.

DIY Hacks and How Tos (author)2018-01-07

This looks really nice. Pro grade results.

About This Instructable

17,380views

299favorites

License:

More by peter_3d:Flush Wall-Mounted Raspberry Pi Touchscreen
Add instructable to: