Reflecting on a MagicMirror Build
Tags: raspberrypi, magicmirror, cnc, javascript
Published: 2018-10-16 03:57:41

---
title: Reflecting on a MagicMirror Build
published: true
description: RaspberryPi, MagicMirror, and a CNC video!
tags: RaspberryPi, MagicMirror, CNC, Javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fay35zwbasm4xog9xyuk.jpg
---

# Introduction

The [Magic Mirror](https://magicmirror.builders/), voted Raspberry Pi's best project, is fun to build, moderately affordable, and provides a platform for further development. The program is wrapped by [electron](https://electronjs.org/), and with some configuration the [Raspberry Pi](https://www.raspberrypi.org/) can boot right into the application with a rotated screen.

[The author Michael Teeuw](https://github.com/MichMich) has a [project manifesto](https://github.com/MichMich/MagicMirror#manifesto). In short: Provide an approachable project for new and experienced developers alike. The project is open source.

{% github MichMich/MagicMirror %}

# Why build it

I had a Raspberry Pi that was unused for some time. After a few Google searches, I was pretty set in building a MagicMirror. I wanted to have something physical after the project that can be used. Hopefully it will be a conversation piece.

# What do I need to build

A Raspberry Pi 3 (MagicMirror recommends using a Pi 2 or 3). I used a card reader to flash the drive and install [NOOBS](https://www.raspberrypi.org/downloads/noobs/). From there I installed [Raspiban](https://projects.raspberrypi.org/en/projects/noobs-install), I followed the documentation to install MagicMirror. Now I needed a monitor. My father-in-law had many sitting around and offered me one. I took a [Philips monitor 190b7cs](https://www.cnet.com/products/philips-190b7cs-lcd-monitor-19-series/specs/) and followed the [online manual](https://www.manualslib.com/manual/897546/Philips-190b7.html?page=41) to safely remove as much excess as possible. 

![Installing](https://thepracticaldev.s3.amazonaws.com/i/wmrw9vlgl01y14rngsrk.jpg)

![Installed](https://thepracticaldev.s3.amazonaws.com/i/o8wbu9l3bsyajsgytndr.jpg)

Now I needed to figure out what type of mirror I wanted. At first I was thinking of using glass, but ultimately went with a [2-way Acrylic Mirror](https://www.amazon.ca/gp/product/B01N05S3BC/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1) designed for this project.

So far my cost (in CND) was:

    - RaspberryPi 3 - $60
    - MagicMirror Program - Free
    - Philips monitor 190b7cs - Free
    - 2-way Acrylic Mirror - $80

Totaling $140 Canadian, two nights' work, and all that was left was a frame. Pretty good!
    
# CNC building the frame

At this point the project came together pretty fast and I demoed the project to my wife. We decided to have a plain frame with a dark colour.

To build the frame I reached out to a friend for some advice. He's a partner with a local [refacing company](https://ottawarefacing.com/). He recommended [medium density fibreboard (MDF)](https://en.wikipedia.org/wiki/Medium-density_fibreboard) because it's cheap, and if you paint it no one will know the difference. Sounded great for a plain dark frame, he offered the MDF free and to cut it with his [computer numerical control machine (CNC)](https://en.wikipedia.org/wiki/Numerical_control).

I was set. 

At the Ottawa Refacing shop I learnt about [CNC toolpathing](http://www.cs.cmu.edu/~rapidproto/students.03/zdb/project2/CNCToolpathing.htm) in a basic sense: how to guide the cuts the CNC makes. Below is a video from the frame being cut, WARNING: loud machinery; please be aware of the volume.

{% youtube 0xgn4g4OVwY %}

The cuts are made in multiple passes, and the reason why the last cut goes the opposite way is bit deflection. The final pass in the opposite direction straightens the cut. This CNC is accurate to 1/2000th of an inch. After the frame was cut I cleaned up some edges and sanded it down. Then we pieced together a test build.

![Test build back](https://thepracticaldev.s3.amazonaws.com/i/ccicqrozurfwau9q9xu8.jpg)

![Test Build front](https://thepracticaldev.s3.amazonaws.com/i/44xdxz90x1dpa63oem5a.jpg)


# Painting

A non-water based primer is recommended for MDF. Oil-based primer is hard to find and I didn't want to spend too much money. I decided on a paint+primer combo. I also picked up wood mud, I had a small repair to make. Once the wood mud was applied and dried, I sanded. Oh god did I sand that frame. The below image is after the final sanding.

![sanding](https://thepracticaldev.s3.amazonaws.com/i/iwlofq13qqqbxt52lax8.jpg)

You can see in the top left and top right that I still didn't sand out all the imperfections. Top left has the main wood mud fix. I joked that I was fixing physical bug reports.

Next was the paint+primer combo. Matte black. In my opinion the brush stroke finish gave some life to the texture of the MDF. Two coats on the front and one coat on the sides and back.

![painted](https://thepracticaldev.s3.amazonaws.com/i/x8cwlnogcrzd694owty4.jpg)

I definitely still have more to learn with painting.

# The Final Build

While the paint dried I made some small configuration changes to the MagicMirror dashboard, mostly for location accurate data. When the paint dried it was time to assemble the final build.

![Mirrorvengers Assemble](https://thepracticaldev.s3.amazonaws.com/i/uzwgtfbenr6ex6u5oh4q.jpg)

- You are viewing the bottom of the mirror
- The top has no back-frame and open for ventilation
- The Pi is screwed to a wooden piece that is cement glued to the back-base
- The monitor is screwed into the top and held by a cross-bar
- I heat tested the acrylic overnight--it held up great


# Conclusion

I am really happy with the build. Now I can SSH into the Pi from my main machine and make and additions or alterations to the dashboard, or even add a module. The total price was $185. I learned a lot from the physical build of the mirror. Paying attention to the details is paramount; you don't want to sand like I sanded. I want to thank Ottawa Refacing for their time and education of the CNC and providing the MDF.

![Final Build](https://thepracticaldev.s3.amazonaws.com/i/1p3u16x35b897jvgz9gz.jpg)


I hope you enjoyed the read!

Cheers.