I built a smart mirror

David
5 min readMay 3, 2023

--

Did you know that there are actually some mirrors which allow light to pass through?

Probably yes, you sure saw it in movies.

Someone is looking …

Those are named spy mirrors and basically given the light differential, light is able to pass from behind, allowing to see both your reflection and the image you want to project from behind.

I discovered that some of those were actually built and sold in Germany, and I wanted to give it a try into creating a smart mirror.

What is a smart mirror?

A smart mirror is a reflective surface that has a computer display behind it. It allows you to see your reflection as well as access information such as weather, news, calendar, and other customizable widgets or apps.

What did I need for building my smart mirror?

  • Spy mirror (where the magic begins)
  • Raspberry Pi (the brain of my masterpiece :P)
  • Monitor, the cheapest possible, 21 inches, quite thin one I found
  • Software for my mirror to shine with awesome features
  • Flutter app to control the mirror, no more ssh
  • Wooden frame, I built it myself with few tools. Wasn't perfect but did the trick, you shall see soon

Spy mirror

It turns out that there are several manufacturers for those special mirrors in Germany. I particularly used https://troas.shop/.

Furthermore, I got a mirror with the following specs:

Smart Mirror Spiegel aus Floatglas
Transmission 12%
Glass strenght: 6 mm

The Glass strength, in retrospective, wasn't the best decision. It affects the visibility from the sides. When you look into the mirror from an angle > 30 degrees, it becomes hard to see what's being projected.

Also, the Transmission percent is not enough from what I experienced since in very illuminated spaces there is little to nothing to be seen.

All in all, the main principle I learned is that you must enforce the light differential, hence the back of the mirror must be in absolute absence of light. You can achieve this by covering all the back of the mirror with any material which doesn't allow for light to go through.

Raspberry Pi

If you have never heard of it:

The Raspberry Pi is a small, affordable, and versatile computer that can be used for a wide range of projects and applications.

For my surprise, with the Raspberry Pi most of the software related challenges were already solved, you would get a computer connected to the internet with capabilities to add sensors, mouse, keyboard, external memory, HDMI output and so on.

You can get a dev kit like this one for around 50 EUR, although I noticed it’s getting quite more expensive nowadays.

Raspberry Pi 4

Monitor

Anything would do it here, just make sure of the HDMI compatibility and probably complete dark pixels tech will improve here the final result by a lot.

Also, I would try to find the monitor with the strongest light emission possible, you will need it. And alternatively, a LED matrix I think would be awesome (this will probably be my next iteration for the mirror)

Software

Turns out there was already in place an awesome community for the smart mirror use case, take a look at the awesome magic mirror builders.

Those guys created already a quite complete framework to build or reuse lots of working modules for your awesome mirror with a very simple configuration process and plug and play modules, lots of them.

There you will find all you need to set up, control and modify all the modules in your smart mirror.

There is a lot of instruction on how to install the magic mirror web app into your Raspberry Pi and initialize it as a process which will be always running unless you choose otherwise.

In a nutshell, you will get 2 main config files:

  • modules configuration for installing and configuring modules, credentials and so on, example, API key for Spotify or config for your personal calendar
  • general styling of the widgets, a bunch of CSS statements that will immediately change many visual parameters of your mirror

Flutter app to control your smart mirror

Additionally, I created MRC (Flutter cross-platform app) which allows you to:

  • control the position of the modules in the mirror
  • enable disable the modules
  • turn the mirror on/off
  • auto-discover the mirror in your LAN
Mirror remote controller App

At the moment of writing, I'm updating the app since it's not supported by newer devices. Should be available soon.

I also plan to release it for iOS.

The app got around 400 monthly active users , this also made me think of adding new features in the near future.

Let’s build a frame

For the wooden frame itself, I got some wood from the local warehouse and followed a YouTube video to assemble it. The trickiest part, the 90 degrees interceptions without the proper tools, is not so trivial.

Also, given the size and weight of the spy mirror + all tech involved, the mirror is quite heavy and almost impossible to hang without making big wholes in your wall, the worse nightmare for a tenant renting in Germany.

The smart mirror

Magic mirror in action in my attic

Conclusions

All in all, this project was a very interesting one which I continue to develop.

My backlog:

  • led matrix to improve the visibility of the projected information
  • more sensors and features, ex. image recognition for profile changing based on user in front of it
  • touch feature, using some touch panels which can be quite cheap to get
  • upgrade the MRC app with new features
  • replace the mirror by a thinner and more translucent one

Did you also build your own magic mirror? What was your experience?

Hope you had at least a bit of fun reading this small post and maybe learned something new.

Have a nice one.

--

--

David
David

Written by David

Passionate software engineer, creator of games, mobile apps and the next big startup :)

No responses yet