Sunday, March 14, 2021

A Virtual Window for a Windowless Basement

 


Creating a Virtual Window

When the pandemic hit, like many others, I found myself working from home fulltime.  While I have dedicated office in my home, I quickly realized that this office space was not conducive to working 8+ hours a day, mixing Zoom meetings with email and other work.  Therefore, about a month into the process, I opted to create a better all-day workspace in our finished basement.  While this was a much better and larger space for working all day, the one drawback is that our basement has no windows.  I'd spend the entire day in this space with no idea if it was sunny, raining, windy or calm.  I knew that some of the cruise lines had begun placing "virtual windows" within their interior cabins with a live camera feed to make those spaces feel less claustrophobic.  So. I wondered if a creating and installing a virtual window next to my workspace would do the same for me, trapped all day in a windowless basement.

A High Level Overview

At the core, this is a pretty basic project.  Take an HDMI-enabled TV, build a box to house it and connect a Raspberry Pi to feed an HDMI signal to the TV from either a camera or from a web stream.  In fact, you really don't even need the box around the TV.  But I wanted it to "look" like a window as much as possible.... including the 'crossbars' (call them muntins, mullions or grilles... I'll simply call them "crossbars").  I had some some additional goals for my particular build:

  • I wanted the crossbars to be easily removable, so that the display could function as a "normal" TV when not being used as a virtual window.
  • To function as a normal TV, it needed to be a Wi-Fi-enabled smart TV since a cable or other video source would not be readily available in the planned installed location.
  • The video feed should be from my own house and should resemble, as closely as possible, like looking out of a real window elsewhere in the house.
  • Should also support streaming video from other sources in the event that local weather was lousy and I wanted to see waves on the beach outside my "window".
  • I wanted to be able to "switch feeds" via simple button pushes or via integration with my home automation system (Home Assistant in my case).
  • Installation should require as little permanent modification to the wall as possible so it could be removed without requiring major repair work.
You may have different desires or goals for your virtual window.  I'll detail below all the steps I took for my particular goals, but you can mix-n-match, alter or omit these to meet your own goals.

My plans do require a 3D printer for some parts.  Most of these are optional, but creation of the crossbars, as I designed to make them removable, do rely on 3D printed parts.  If you do not have access to a 3D printer, you'll need to design your crossbars (if you want them) in a different manner.  If you do have a 3D printer, I'll provide a link to the .stl files that I designed.

Parts List

Most of the hardware for the frame (wood, trim, brackets, screws, etc.) came for the local hardware store.  I'll list what I used, but without links to purchase since that likely wouldn't do you any good unless you live in a location with the same hardware chain (Menards in my case).  The links I do provide are Amazon affiliate links.  These links will take you to Amazon and the blog may earn a small commission if you purchase, but it will not affect the price you pay.

Hardware Store Material
(Note that the actual box size will be determined by the actual monitor you use. For me, I was using a 42" TCL Roku TV.  One of the selection criteria was to minimize the depth of the TV, so that the depth of the resulting box mounted on the wall could be minimized as well).

4 1"x 4"x 4' Premium Pine boards
Door casing (for trim)
1/2" x 1/4" x 8' non-beveled 'craft wood' for the crossbars
1 1"x2"x4' Pine (for wall mounting)
4" screws
Misc wood screws
Wood glue
Wood putty
Paint (white, semi-gloss)
L Brackets
Extension cord with minimum 2 outlets.

There will be more info on the above materials in the build information below

Electronics and Wiring Materials
For the Raspberry Pi, you can either purchase the kit (recommended), or you can purchase the individual parts (for example, if you already have a case, power supply and SD card).  You do not need to purchase both.  If you purchase the kit, then skip the individual parts.


OR


Other Parts

HDMI extensions (qty will depend on your TV model)

Camera & Wiring
This is also totally optional, or you can use existing cameras if already installed as long as these cameras support the RTSP protocol.  I installed two new cameras, including new Ethernet runs into a new junction box.  The parts listed here are for reference only, as per my build.


If you are interested in my camera mounting and Ethernet wiring adventures, I'll include that in a "bonus" section at the end of this post.

3D Printed Parts
These are all optional, but if you don't have a 3D printer or access to one from a friend, then you need to make some adjustments to the build below.  Most notably is finding an alternative to the crossbar assembly.

Filename

Description

Air_Vents.stl

Round trim for air ventilation openings

Button_Box.stl

Enclosure and lid for push buttons

Button_Box_Tabs.stl

Bottom button enclosure with mounting tabs

Crossbar_End_Supports.stl

End supports for crossbar mounting

Crossbar_Supports.stl

Middle supports for crossbar mounting

HDMI_Insert.stl

Insert to hold HDMI extension cables

Pi Lock.stl

Sliding lock to hold Pi in mount

Pi_Holder.stl

Mounting bracket for Pi

Roku_Remote_Mount.stl

Mount for Roku remote

Speaker_Grills.stl

Oval trim for speaker openings

Speaker_Square.stl

Square trim for speaker openings


Building the Frame

Assembly of the frame is pretty basic and straightforward.  You will want to have the display on hand, as the exact dimensions of the TV will dictate the size of the frame.


Basically, you will cut your 1" x 4" boards to fit, using butt joints, around the display, leaving about a 1/8" - 1/4" gap all around, except for the bottom (since the TV will rest on the bottom board once installed).  You may have to plan for, and make, some cutouts depending upon your display.  For example, in my case, the IR receiver and power indicator jutted out about 3/8" from the bottom.


Here you can see the cutout for the IR receiver on the bottom board of the frame.  In addition, the two larger holes accommodate the speakers and the smaller holes (also created on the top board) are for ventilation and heat dissipation.   The circular cutouts will be covered with speaker grill fabric and 3D printed rings to make the final product look a little neater (therefore, my holes didn't have to be perfect either!).


You will also need to make accommodations for any ports you wish to expose (such as HDMI, USB, etc.) from the TV.  Again, in my case, I had 3 HDMI port, two of which would be unused after the Raspberry Pi was connected.  So, I cut an appropriate hole and used a 3D printed insert to extend this ports and make them available:



You'll also need an opening large enough to pass the power supply and micro HDMI cables through the frame to the Raspberry Pi.  You can place this wherever makes the most sense for you... along the top or on either side.  For me, the side opposite of the HDMI ports made the most sense, both from a wiring standpoint and because it would result in the Pi being hidden from the most of the room.  Finally, don't forget a cutout for the incoming power cord/extension cable.  Again, size and position of this opening will depend upon your particular install and preference.

Once all the cutouts are made, attached the four sides together with wood glue and screws or nails.  I opted to countersink screws and putty over them for a neater appearance.  It isn't necessary to miter the corners since the door moulding trim will hide the butt joints... but feel free to miter if you prefer!

Next, install the trim.  You will want to leave an overhang of somewhere between 1/2" to 1" on the inside of the frame.  The TV will rest against this overhang of the trim and what will stop it from tumbling out of the front of the frame.  In my case, the TV had a 1/2" bezel.  I wanted to hide the bezel, but leave the entire screen itself exposed.  With the 1/4" gap between the TV and the frame itself, it meant that I needed a 3/4" overhang with the trim.  This step will take a lot of "test fitting" and cutting.  Remember that if you are trying to just cover the bezel like I did, the overhang on the top and bottom will likely be different, since the TV will sit on the bottom board (no gap), but there will be a gap of some sort on the top.


Once the frame is fully assembled, sand, putty and paint to your desire.  Our 'real' windows in the house are all trimmed in semi-gloss white, so I selected the same trim style and color for my virtual window.  Install any grill covers if desired over openings for speakers and ventilation.

Creating the Crossbar Grid

There are many ways to tackle this part, but recall that I wanted to be able to easily remove the "grid" when not using the display as a window so that it could also function as a normal TV.  So, here's how I tackled it.


Above are the parts I used to mount and hold the crossbar grid in place.  The larger
+ shaped pieces are the center mounts where the crossbars meet and the smaller T shaped pieces go onto the ends of the crossbars to attach to the backside of the trim overhang.  The strips in the photo are not 3D printed parts, but are actually the nylon or plastic strapping that you'd find wrapped around bundles on a pallet.  I found a large quantity of this just tossed into trash cans at the local hardware store, so I snagged a few yards of it at no cost... and it worked out perfectly for my needs.



Basically, strips of the strapping material were hot glued to the back side of the trim.  This allows the tab portion of the T-shaped ends to slide underneath and holds the grid in place.  To remove the grid, the ends simply slide out from underneath and the whole grid lifts out of the frame.  Then they slide right back in to replace the frame.

The crossbars themselves were 1/2" x 1/4".  But the most important part here is that they were non-beveled and completely square on the edges.  I had to search and search in the hardware store to find them, but located an assortment in what they called "craft" wood.



I started by centering the middle vertical and horizontal crossbars.


And then repeated for the remaining crossbars by splitting the distance equally between the center bars.  Here are a couple of closer photos showing how the 3D pieces are used:



At this point, I removed the grid and set it aside until the final build was hung on the wall.

Installing the TV in the Frame

This step is pretty straightforward.  The TV will fit into the frame, resting on the bottom and the front of the TV pressed up against the trim.


Attach an L-bracket in each corner, screwed to the frame, to hold the TV in place with the front flush to the trim.


Wiring

Some of the wiring can be seen in the above photo, but will vary based on your TV, the number and location of inputs, the mounting location of the Raspberry Pi, etc,  But you will need two power connections... one for the TV and one for the Raspberry Pi.  So, unless you want two power cords coming out of the frame to be attached to a wall receptacle, you'll need to utilize a properly rated extension cord.


Then use HDMI extensions, USB extensions, etc. to route access for any unused ports to the exterior of the frame.



Wall Mounting

My goals for wall mounting were two-fold.  First and foremost, I wanted to minimize any permanent damage/modifications to the wall itself.  If you've watch my YouTube video on my 5-Golden Rules, then you'll know that at some point in the future we will be selling our home and I don't want to have to do major repair work to "uninstall" my smart home projects!  Secondly, I wanted to be able to easily take the window back off the wall if any repairs, upgrades or modifications were needed.

So, I opted to create a wooden "bracket" system where the window frame would hang on the wall.  I used a 24" 1"x1" piece of pine.  This was mounted on the wall with 4" screws so that they spanned and screwed into two studs.  


A second 24" 1x1 was screwed to the underside of the top of the frame.  Then a "lip" was created with a ripped 2x4 and a spacer was added to give just a bit of clearance for the 1x1 attached to the frame to slide between the wall and the "lip".  The end result was that the window was held securely in place and flush to the wall while only making two screw holes in the existing wall and also making the window easy to lift up and remove from the wall.

Raspberry Pi Prep and Python Application

Details on the necessary setup steps for the Raspberry Pi, along with the Python application that runs the video processing can be found on my Github.

Manual Button Control

While I planned on integrating control of the window via Home Assistant/MQTT, I always like to provide an alternate, manual control method.  In this case, I wanted push buttons that would allow me to cycle through various camera view or video clips, or to set either option into a cycle mode.

This was accomplished via normally-open pushbuttons and a 3D printed enclosure (the design file I used can be found from the links above or on my Github).


Basically, you will connect a ground and signal wire to each button and then connect to the Raspberry Pi GPIO pins.  The Python app uses the following connections:

Alternatively (and probably a better option) is to daisy-chain all the grounds together and have only a single ground wire to the Raspberry Pi (this can be connected to any of the ground pins).


Home Assistant / MQTT Integration


The Home Assistant integration allows me to use Home Assistant to select a particular camera feed or video clip to display on the "window".  I can also set either option to loop mode so that it switches to the next camera or video after a set amount of time (defined in the Python app).  The integration uses MQTT so it is not necessarily limited to Home Assistant.  The actual Home Assistant yaml and Lovelace files can be found in my Github.

Final Thoughts

This actually was a fairly simple project that resulted in a pretty big impact in my windowless basement while working at home.  Since installation, it has also been used as a second TV for football Sundays to watch two games simultaneously (since the basement is also our family room/home theater room), display a static  image for "game or party" nights and also as a third monitor during Zoom meetings.

The biggest challenge was building the frame with just the right spacing and proper trim placement to cover the bezel but not any of the screen.

My limited Python and Linux experience has also prevented me from successfully having the Python window application auto-launch on startup, but since I routinely use the "window" for other features, this isn't that important in my case.

Let me know in the comments if you build one of your own or have recommendations for ways you might change or improve on my design.

And, as always, thanks for reading!

Bonus Section - Camera Installation and Ethernet Runs

When debating about the type of camera I wanted to use for the video feed to my virtual window:

WiFi Camera:  This would require power, meaning extension cords, and everything would have to be weather proof.

Battery-operated WiFi Camera:  This has a huge advantage of not needing any wire runs, but would require battery replacement or recharging on a regular basis... not an ideal situation, especially in the dead of an Indiana winter.  Solar panels attached to the camera might help, but where I planned on mounting the camera, solar panels may have been a challenge.

Power over Ethernet (PoE) Camera:  Having upgraded my home WiFi system a few months prior to Ubiquiti/Unifi, I had learned to really appreciate devices that could be powered by the same Ethernet cable that carried data.  And a wired data connection would give me a much better and consistent video feed.

So, a PoE camera it was.  I had made substantial Ethernet runs through the attic and down walls in the process of installing the Unifi access points, but I now had to get a run to the exterior of the house.

I wanted the location of the camera to provide a feed that matched, as closely as possible, the view from a real window out the rear of our home.


On the rear of the house, there is a small overhang between the first and second floors.

This location would provide the proper angle for the image I wanted and the overhang had the advantage of providing a little protection from the worst of the weather (although the Reolink cameras I selected are fully rated for outdoor use).

My office, and incoming Internet connection/primary network stack, is located on the second floor just above and to the left of this location.  My initial thought was to go up into the second floor attic and punch through to the exterior directly above the camera location and straight down.  But due to the pitch of the roof running this direction, and with the tools I had, it was nearly impossible to squeeze into the space between the attic floor and the roof deck.  In addition, there would be a visible wire hanging down the back of the house with no good way to hide it or attach it inconspicuously to the vinyl siding.


The next best feasible option was to come out of the upper attic on the end of the house.  The Ethernet cable could then be tucked under the eave, brought down behind the gutter, then under the overhang to the camera location.  The planned path is shown with a red line in the above photo.  And by using white Ethernet cable, the wiring would be virtually invisible unless you looked really hard for it.

However, this location presented a different challenge.  The garage and screen porch are attached to this end of the house, with roof lines going all sorts of directions!  I had to get up on the roof of the garage/porch, then pull up a ladder and place it on the roof to get up to the exit point of the Ethernet from the second story attic.


Luckily, the pitch of the screen porch extended back just far enough to allow me to place a standard extension ladder in place and reach up to the second floor attic.


Once I knew that I could string the wiring run once it was outside of the house, I still needed to get the Ethernet from my office to this location.

This part was relatively easy, as I had already pulled one Ethernet cable from my office to the attic for the upstairs Unifi access point.  And for once, I had been smart enough to leave an additional pull line in the wall if I every needed to pull additional lines.


All I had to do was pull two Ethernet lines (one for the back camera, but another with plans to add a front camera later) and a new pull line for future use using the existing pull line.  This was probably the easiest part of the entire project.

The cable was then just snaked and secured through the attic space and out a small hole drilled through the side of the house.


From here, it was just a matter of tacking the wire in the corner with white wire clips and white zip ties (for the back of the gutter portion) to the final installed location of the camera.


And as you can see here, the resulting image was almost exactly the same as the original target image.

Eventually, I did use that second Ethernet line to add another camera to the front of the house.

I used the same process as the rear camera, except that I added a weatherproof Ethernet coupler since part of this run crosses the edge of the roof over the garage.  And when it comes time to roof the house, I wanted to be able to disconnect the Ethernet line and pull it back out of the way of the roofers.


Here's the final mounted front camera and the view it provides to the virtual window.

 
While not as picturesque as the back camera, this camera does allow me to view the front of the house for visitors or deliveries during the work day, and adding this camera, along with the three Wyze cams I already had, it gives me five separate video feeds for my window.  And if I get tired of looking at a bleak Indiana day, I can always pick up my spirits by changing my window to a more "pleasant" view with a simple push of a button:




With a camera streaming service, like EarthCam, you can have a 'view' out your window of just about any place in the world!

 
Supporting this blog and related YouTube channel

If you'd like to support future content on this blog and the related YouTube channel, or just say thanks for something that helped you out, you can use any of my Amazon links to make a purchase at absolutely no cost to you.  Or if you prefer to say thanks directly, you can buy me a one-off cup of coffee at:


2 comments:

  1. Replies
    1. Thanks! It still gets used nearly everyday that I'm still working from home. But it gets use as a regular "tv" more than I figured it would... which is why I'm glad I made the crossbar system easily removable.

      Delete

To help eliminate spam and to keep all conversations civil, submitted comments are moderated. Therefore your post may not show up immediately. Please be patient as most reviews are completed within a few hours.