Build a DIGITAL MAGIC MIRROR
by DIY Machines in Workshop > 3D Printing
27549 Views, 421 Favorites, 0 Comments
Build a DIGITAL MAGIC MIRROR
Build your own Digital Magic Mirror - with Hue, Spotify, Tesla, Fortnite, Calendar, Weather, and many more integrations!
This Magic Mirror project has simplified my life whilst remaining hidden behind an inconspicuously simple mirror. In the morning the integrated motion sensor automatically turns on the information display and instantly shows me my calendar, local weather, news, and charge level of the family car.
Made from low cost builders yard pine wood and super strong Perspex Acrylic sheet, the mirror is easy to build. The monitor was bought from Gumtree to keep things cheap. You can customize the size of the monitor to suit your preferences, and the full-length integrated touch lights make it a perfect tool for checking your outfit before you start your day or venture out for the evening. Elevate your daily routine! (It's also just so cool) ๐
Accompanying Video
I have written out everything you need to know in this Instructable when it comes to making this Magic Mirror project. I also love making videos so have made one which you will find above. Consult one or the other but you can't go far wrong if you follow both.
I recommend taking a look at the finished project results in the intro of the video before carrying on down through this Instructable - though it's not compulsory!
All the 3D model files are attached to the relevant steps (as STL files), wiring diagrams are included where appropriate and the occasional nugget of advice is sprinkled and imparted throughout. Enjoy! ๐
(I've also attached the Fusion 360 model to this step as the 3D printable STL files attached later are suitable sizes for my build - you may need to adjust them for yours. If you do need to you can open them in the free version of Fusion 360).
Downloads
BOM (What You'll Need)
To build a mirror project of your own you will need a few items. Below I have listed them out along with links to where you can find them on Amazon.
- LED Aluminium channels: https://geni.us/LED-Channel-Flat
- LED COB Lights: https://geni.us/COB-LED-24v-White
- LED Dimmer control: https://geni.us/LED-Dimmer-Button
- LED Power Supply: https://geni.us/24v-Power-Supply
- Raspberry Pi: https://geni.us/RaspberryPiV4
- PIR Sensor: https://geni.us/PIR-Sensor
- Memory Card: https://geni.us/Micro-SD
- Pi Power Supply: https://geni.us/PiPowerSupply
- Acrylic: https://geni.us/AcrylicSheet
- Two-way mirror film: https://geni.us/Two-Way-Mirror-Film
- Monitor: https://geni.us/Monitor-Screen
- Pocket hole jig: https://geni.us/PocketHoleJig
You can also find the software installation and configuration guide here also for free: https://www.diymachines.co.uk/how-to-build-a-smart-magic-mirror
Selecting Your Mirror
I'm utilising an older computer monitor equipped with an HDMI port for this setup. I intend to mount it in a landscape orientation, spanning approximately 53cm in width.
For the mirror surface needed in this project, there are several viable options to consider. These include purchasing pre-mirrored acrylic/perspex, procuring a pre-cut glass two-way mirror (also rather confusingly referred to as one-way mirrors), or applying two-way film to a separate piece of acrylic/perspex.
Regrettably, the majority of online stores in the UK only offer pre-mirrored acrylic in a 3mm thickness, which I find less appealing due to its lack of rigidity, potentially distorting the reflection and creating an unsettling 'house of carnival madness' effect.
In my case, I've opted to apply self-adhesive two-way privacy mirror film to an 8mm acrylic sheet measuring 70cm in width and 1.5m in height. This size is ideal for concealing the display effectively - you should allow of at least 5cm extra mirror material on all sides of your chosen monitor/tv.
While glass is the preferred choice for its quality, it should be noted that it comes with drawbacks such as being more expensive, heavier, and posing greater safety risks compared to acrylic and perspex, which are notably sturdier materials. Especially important when we will be shifting it around several times during the build.
The Wooden Frame Design
There are numerous approaches to constructing a wooden frame, but I've chosen a relatively straightforward design. It consists of four mitred pieces for the front frame, which will be positioned in front of the acrylic. The internal opening of this front-facing frame will match the width of my display, ensuring that all on-screen information is visible later on. To allow for some overlap at the top and bottom, I've intentionally made the frame 5cm shorter in height than my sheet of acrylic.
By doing this, we can utilise the upper portion of the mirror to display 'smart' information and graphics, while the remaining area functions as a standard mirror. Additionally, I decided to make the frame taller, as we currently lack a tall dressing mirror in our home. This design choice not only enhances functionality but also meets our aesthetic needs.
I have built a free web calculator tool on my website at https://www.diymachines.co.uk/how-to-build-a-smart-magic-mirror which will help calculate the required lengths you need to cut you wood for your frame.
Of course you could design your own frame if you want to - mine is just a suggestion.
Adding Grooves for LED Light Channels
Prior to assembly, I chose to route a 135cm-long slot into the front sections of both sides. This will serve as the designated space for the LED lights to run along. It's important to note that you have the flexibility to customise this length to your preference, and if desired, you can even choose to exclude the LED lights altogether.
To ensure a precise fit, the dimensions of the slot will match the width and depth of the aluminum channel I have selected for the LEDs. Specifically, for the channel I'm using, these dimensions are 17mm in width and approximately 8mm in depth.
I then used a small drill bit to make a hole through the other side at one end of the channel. This is to pass through the power wires to the LEDs later. On the reverse side of the front panel I routed a small slot towards the centre of the frame to allow the wire to pass under the second frame later added to the rear of the project. (Please see the image with the red arrow showing the build process later so you can have a better idea about what I'm doing). It is important this slot does not breach through the side of the wood as this area will be visible on the finished project.
Preparing PIR Sensor Location
Next, we'll be creating a recess and hole to house the PIR sensors. But before we proceed, let me explain one of my design choices. I've opted to position the sensor further back inside its cutout to limit its motion detection range, ensuring that it only detects movement directly in front of the mirror. This deliberate choice minimizes the frequency of fan activations, as illustrated in the animation provided above.
The PIR sensor will be placed at the top of the frame. To accommodate it, we'll first trace the sensor breakout board on the reverse side of the top piece, and then use a router to reduce the wood's depth accordingly. Subsequently, we'll employ a forstner bit from the front side to carve out a precise hole for the fresnel lens. Carving from the front ensures a clean and precise cut.
Don't be concerned if the edges appear slightly rough at this stage. We'll be refining and tidying up the various cutouts created so far later in the build process.
Assembling Front Frame
We can then assemble the frame. Iโm using wood glue and pocket holes. Pocket holes are a type of joinery technique commonly used in woodworking to create strong and concealed connections between pieces of wood:
If you've not heard of pocket holes - they're my new favourite thing. They're low cost and super useful. Here is a crash course (though follow the instructions in your particular jig if you have one):
- Drilling: First, you need a pocket hole jig, which is a tool designed for this purpose. Position the jig on the wood where you want to create the pocket hole joint. The jig typically has a guide with holes at specific angles (often 15 degrees) for drilling.
- Adjusting Depth: Set the depth collar on your drill bit to match the thickness of the wood. This ensures that you drill to the right depth without going too deep.
- Drill Pocket Holes: Insert the drill bit into the jig's guide hole and drill into the wood. The jig helps to maintain the correct angle and depth. This creates a pocket hole in one of the wood pieces.
- Assembly: Apply glue or adhesive to the surfaces you want to join and then attach the pieces together. Typically, screws designed for pocket holes are used to secure the joint. These screws are specially designed with a flat head and self-tapping threads that draw the joint tightly together.
- Clamping: Use clamps to hold the pieces together firmly while you drive in the screws.
- Finishing: After the screws are driven into the pocket holes, they are hidden within the pocket, creating a clean and neat joint. You can fill the hole with wood filler if you want to hide it completely, but it's not always necessary - I didn't need to for this project as the entry holes are concealed from view the mirror is completed.
Be sure to keep checking diagonal measurement to ensure everything is nice and square as you join the four pieces of wood. You'll then need to leave this for several hours (check your glue bottle) to cure.
Preparing Rear Frame - PIR Sensor
Once the wood glue has thoroughly dried, we can proceed by gently placing the acrylic sheet into position as a reference point, followed by the wooden piece we cut earlier for the rear frame. Ideally, these components should align seamlessly.
With the assurance that everything fits as intended, our next step involves carving a notch into the top section of the shorter piece of wood. This notch is designed to accommodate the rear portion of the PIR presence sensor. Despite recessing it slightly within the front frame, some electronic components extend beyond the rear surface of the wood.
To begin this notching process, use a pencil to mark the area that needs to be removed. I personally used a Forstner bit to remove a significant portion of the material, followed by a handsaw, and admittedly, some less-than-perfect chiseling techniques. However, it's worth noting that in a later stage of the project, we'll introduce a 3D printed component that will result in a much more polished and aesthetically pleasing final piece. (You can refer to the provided image for clarification on this.)
Preparing Rear Frame - Airflow
Considering that our electronics will produce heat during operation, it's a prudent move to incorporate a couple of ventilation holes in the same top piece of wood. These openings will facilitate the upward movement and escape of warm air. In this instance, I employed the same Forstner bit for this task. It's worth mentioning that we'll refine and tidy up these holes after painting, as showcased in the last image, providing a glimpse of the final result. ๐
Furthermore, to ensure effective airflow, we can also create a pair of corresponding holes in the bottom piece of wood to allow cooler air to enter the assembly.
Pre-wiring the PIR
Accessing the PIR breakout board at a later stage will pose some challenges. Therefore, before we affix the rear frame to the front frame, it's advisable to take a moment and connect three lengths of wire to the three pins of the motion sensor.
It's essential to ensure that these wires are of sufficient length to span the distance between the sensor's installation point and the location where you plan to house your Raspberry Pi. In my case, this distance is roughly midway down the mirror. If you're uncertain about the required wire length, it's better to err on the side of caution and make them longer initially, as they can always be trimmed to the appropriate length later in the project.
Pre-wiring LEDs
Same goes for the wires going to our two strips of LEDs if you plan to install them later.
You just need to thread a pair of wires through the holes either side of the front frame.
Assembling Rear Frame
To construct the rear frame, I'm using wood glue at the mitred corners again. Then, I'm utilising two sets of band clamps interconnected as one to firmly hold all the lengths of wood together while allowing the glue to set overnight.
Before leaving the assembly to set, I made sure to use a tape measure to confirm that the two diagonal measurements were equal, ensuring the frame's squareness and overall stability.
Attaching the Two Frames
After allowing the glue to fully cure (patience is key here), I proceeded to use a ruler to carefully measure and adjust the inset distance of the four corners until they were perfectly equal. At each corner, I marked this position with a pencil for reference.
With this preparation complete, I flipped the rear frame over and generously applied wood glue to it. I then turned it back over, using the marked positions to align it centrally against the rear of the front frame. It's crucial to ensure that the wires for the PIR sensor and LED power are directed towards the inside of the frame during this step.
To securely hold the two frames together as they dry, use as many clamps as you can gather. Additionally, I incorporated some extra pocket hole fixings, taking care to ensure they did not protrude from the front face of the frame.
Again, give this plenty of time to fully cure.
Preparing to Paint
It's quite common, as it was in my case, to encounter some areas in your frame where the wood didn't align perfectly during assembly. This is the perfect opportunity to employ either a hand or power sander to achieve a flush and even surface.
To enhance the overall quality of the final project, I dedicated some time to filling any gaps between joints with sandable and paintable caulk. I also applied this caulk to any wood knots present. After allowing it to dry, I sanded it back until the surface was smooth. I didn't rely solely on ultra-fine sandpaper for this task; rather, I quickly progressed through different grits until the surface felt soft to the touch.
Painting
For the initial paint application, I opted for a grey primer to mask the contrasting shades and patterns of the wood grain and knots. After allowing it to dry, I used 240 grit sandpaper to gently smooth out any grain that had raised due to moisture absorption from the primer.
Subsequently, I proceeded to apply a layer of brown chalk paint. It's worth noting that you have the creative freedom to select a different color or painting style that suits your preferences. You might even consider using a wood stain to showcase the natural hues and patterns of the wood. After the brown chalk paint dried, I lightly sanded it once more with 240 grit paper before applying a final coat of chalk paint for a refined finish.
Preparing the Mirror
If you are using some two way mirror glass or some already mirrored acrylic then you can skip this step. Otherwise I will guide you through how I applied the mirror film to my sheet of acrylic.
It's tricky to show you on a sheet the six I'm using for my mirror so instead I will demonstrate on this A4 sheet. You'll need a a few extra items before you apply your film:
- A spray bottle with tap water and just a few drops of washing liquid
- A sharp knife
- A squeegee to apply the film and draw water to the edges. (you could use a bank card or similar with a bit of cloth over one of it's long edges)
Let's break this down into steps:
- Identify if your acrylic/perspex material has a show face. On mine this is marked not he protective film applied. This face needs to facing outwards. We will apply the mirror film on the other face so that when we clean in the mirror in the future we do not wear down the film.
- Trim the mirror film to a size slightly larger than the acrylic sheet. This will make it easier to work with.
- Remove the protective film from your sheet of acrylic.
- Use the spray bottle to liberally wet the surface of the acrylic.
- Remove the protective film from the sheet of mirror film.
- Use the spray bottle again to wet the mirror film this time. Don't be shy with the spray.
- Apply the film from one end using the squeegee to remove any air bubbles and push he water out towards the edges as you go. Work bit by bit laying down more of the film as you go.
- Use your sharp knife to carefully trim the edges of the film off.
Done.
Insert & Fix the Mirror
Gently fold the two sets of electrical wires, two pairs for the LEDs and the other for the motion sensors, out of the path of the mirror. Then, carefully lower the mirror into its designated position within the frame.
To secure it firmly in place, I employed a step-down drill bit to create holes along the frame's perimeter. Afterward, I inserted countersink wood screws into these holes, evenly spacing them around the frame. These screws primarily serve to support the weight of the mirror surface itself, especially when the finished project is mounted vertically.
Secure Monitor / TV
I used two short wooden battens to support the monitor against the mirrored surface. These battens were securely attached to the frame of the mirror using pocket holes. This helps ensure that I can fairly easily remove and re-install the monitor-supporting battens in the future, providing convenient access to the monitor whenever the need might arise.
Blacking Out the Mirror
I then used some sheets of cardboard (for their low weight and cost) to enclose the rest of the mirror. To minimise reflections from the front side of the mirror, I took the additional step of painting the backside of the cardboard sheets black before attaching them.
Inserting LED Channels
My aluminum channels arrived in 1-meter lengths, and I initially installed one full length on each side. They fit quite snugly and only required a gentle push to secure. Subsequently, I measured and marked where I needed to trim the extra required length. Since aluminum is relatively soft, I safely cut it using a wood blade on my miter saw, making sure to protect my eyes from any offcuts. Alternatively, a handsaw could also do the job effectively.
Here's a quick tip: If you have the plastic diffuser installed on the LED channel, cutting it will automatically result in a perfectly matching length of both.
After the cutting process, these reduced-length aluminum channels were slightly trickier fit. To ensure they were firmly in place, I used a block of wood and a hammer to force gently persuade them into their final position.
Installing LED Lights
Cob LEDs were chosen due to their superior diffused appearance, particularly when installed within aluminum channels.
On the LED reel, you'll notice marked points with copper pads where you can cut them to your desired length. Aim to make your cuts as close to the center of these pads as possible; this ensures you have ample copper surface area for soldering shortly. You'll need to cut one length for each side of the mirror.
After making the cuts, peel off the self-adhesive tape on the LED strips and carefully insert them into the aluminum channel. When you reach the bottom, we can proceed to solder the two wires we prepared earlier onto the copper pads, making sure to keep track of the positive and negative connections.
Gently pull the wire through the frame from the reverse side to neatly complete this part of the installation.
Tidying LEDs and PIR
Now, let's take a look at the first 3D printed embellishments. You'll find the STL files for the specific ones I used attached to this step. If you need to adjust the dimensions to fit your project, don't forget that I included the Fusion 360 CAD file for the entire project at the beginning of this Instructable.
I opted for black PLA plastic for my prints and used hot melt glue to firmly secure them in place. In the last image, you can catch a preview of what these embellishments look like. I temporarily connected the LEDs to a power supply to ensure they functioned correctly. In the next step, we'll cover the proper installation of the power for these LEDs...
Installing LED Brightness & Power Control
To help ensure a precise cut with clean edges for the touch-sensitive button, I applied blue tape where I intended to drill the hole. Carefully, I used a step-down drill bit to create a hole with the same diameter as the recessed portion required for the button. Take your time and keep checking the holes size - you really don't want to make hole to large!
After removing the tape, I installed the button by threading its wires through the front of the mirror and securing the nut from the rear side. To help keep the nut in place, I applied a small amount of hot melt glue to the thread before installation.
Next, I used two strips of double-sided tape to secure the electrical extension lead on the rear of the mirror. We'll be connecting other components to it shortly, but we'll start by connecting the power supply for the LEDs. The cable from this plug can then be linked to the input of the button we just installed. The output of the button connects to two wires, typically using a female DC barrel connector that should have come with it. If needed, extend these wires to reach the bottom of the mirror, where I used two Wago style connectorsโone for connecting all the positive wires together and another for the negative wires.
After carefully checking your wiring connections, it's time to connect the power and verify that everything functions as expected. If it does, we can use more tape to neatly organise and secure the wiring.
Programming the Pi and Magic Mirror
Now, let's prepare your Raspberry Pi with the open-source Magic Mirror software and create a configuration file to personalise the functionality and appearance of your mirror.
This process involves several steps, including flashing Raspberry Pi OS onto the SD card, configuring network connections, installing the Magic Mirror software, customising it to work with our motion sensor, and ensuring it launches automatically at boot.
It's important to note that software can evolve over time, rendering instructions quickly outdated and incorrect. To address this, I've documented this portion on my website (still completely free). This approach allows me to keep this Instructable, my YouTube video, and other online references up to date in one central location, simplifying the process for everyone including me.
For detailed software steps, please visit this page on my website: https://www.diymachines.co.uk/how-to-build-a-smart-magic-mirror
Once you've completed the software setup, return here for the remaining hardware and electrical instructions. We're almost there!...
Fitting the Pi
Time to use the 3D printer again. I printed a case for my Raspberry Pi - though you can choose to purchase one if you like.
I used the following 3d Printable case for the Raspberry Pi 3: https://www.printables.com/model/4038-malolos-screw-less-snap-fit-raspberry-pi-3-model-b
(Malolo also has designs for other Raspberry Pis as well - I have not attached them to this step as they are not mine to attach)
The encased Raspberry Pi is then secured into place with more double sided tape after connecting the power to the Pi and the HDMI cable between the Pi and the monitor. When choosing a location for the Pi ensure that the wires for the PIR can also reach it. We will be connecting those next.
Connecting Pi to PIR
We are now at the point in our build when we need to connect the PIR sensor to our Raspberry Pi. This is done by connecting the three wires we added to the PIR several steps ago to the GPIO pins on the Pi.
To simplify this process, I opted for a 4x2 Dupont-style female connector to securely assemble the ends of these wires in the appropriate positions before connecting them to the Raspberry Pi. It's an effortless task made even more convenient with an affordable connector. For a step-by-step demonstration, I've created a separate video tutorial illustrating just how straightforward this process is:
If this method doesn't suit your preferences, there are alternative approaches available. You can choose to solder the wires directly onto the correct GPIO pins or acquire a GPIO breakout board equipped with screw terminals.
For your convenience, I've provided a visual representation of the correct wire connections in the image above. Additionally, here's a table summarising the connections for your reference:
PIR ----------> Pi GPIO
5v ------------> 5v
GND --------> GND
DOUT ------> GPIO4 (GPCLK0)
Once the two devices are electrically connected we can tidy some more of the wires surely with some additional tape.
Tidy Remaining Cutouts
Our final task is to complete the tidying of the various openings we created in the wooden frame during the earlier stages of the build.
To address this for my mirror, I utilised 3D printing to produce custom 'open bungs' designed to fit precisely within the air inlets located at both the top and bottom of the frame. Additionally, I employed an L-shaped cover to conceal the cutouts for the PIR sensors. All these components were attached to the mirror project using hot melt glue.
If you find that adjustments are necessary to accommodate the sizes of the drill bits and resulting cutouts you created, don't worry. You have the flexibility to either design your own 3D models for printing or adapt the existing ones from the Fusion 360 files provided at the beginning of this tutorial. Alternatively, you can explore alternative methods for concealing these openings according to your preferences. ๐
(The models I used are attached to this step).
Project Completed
Well done. I hope you enjoyed following along and thank you for making it through to the end I know I can be a bit wordy sometimes! ๐
Have the best of fun with your new Magic Mirror and I look forward to sharing my next project with you soon. Subscribe here on Instructables or over on my Youtube channel to keep up-to-date. (https://www.youtube.com/diymachines)
Take care, do some good, and ciao for now. ๐
Lewis