A magical pet projectPosted 2015-10-13
It all started off with some spare time and an idea, so a little pet project was started by Anders Persson that I got involved in. Someone at the office took a picture and posted the result to twitter. Now, if you do something like that you can always count on the twitterverse to demand to know all the details. We are of course eager to please, so here is the post on building a “Magic Mirror”.
A magical contraption
I guess it’s nothing new, and it’s certainly not our idea. We first read about the idea here. Basically it’s putting one-way glass, like one of those from police line-ups, on an LCD display. Put it in a nice frame and hook it up to a small singleboard computer, like the Rasberri Pi, and the result is that when the screen is black the glass looks like a mirror. When something is bright, like white text, you get a strange ghost-like effect as the mirror appears to be semi-transparent. Cool, huh?!
The bill of materials
You can (of course) build your own magic mirror in whatever way you see fit. The only required parts are the glass and the monitor. You just need to make sure that the glass is snug against the monitor as you don’t want any light seeping in from the sides. Anyhow, this is what we used to make our version (prices without VAT):
Mirror glass (about 500-600 SEK for 660x400mm)
We got it from our local glazier. We didn’t specify any particular quality or thickness but they seemed to know exactly what we needed. Order the same dimensions as the monitor you are using plus a few extra centimeters. When you have the frame you can pick it up the glass and have it cut to the exact dimensions needed.
Monitor (from 1000 SEK)
We just picked up an old unused 24” Dell monitor from the office. I’m guessing that any monitor will do as long as it doesn’t have too much bleeding or have a back panel in some weird position that would force a frame that will be too deep to look leet. Make sure to screw the monitor apart carefully – that way if it’s not a fit then it can be put back together again (unless you are buying a new one then you will just have to guess).
Wooden frame (about 1800 SEK)
We gave our favourite carpenter a call and asked if he could make something that would fit in with all the other woodwork he had already made for our offices. He came up with a design that had a reasonable airflow, looked great and ensured that the glass was snug against the screen.
Just to make things easier we dropped off the screen at his workshop so he could tailor it to the correct dimensions. We also brought the distance sensor and the microphone so he could make holes for them.
Computer (about 1500 SEK)
- Raspberry Pi 2 Model B
- Kingston 32GB SD-card
- Wi-Fi USB
- Olympus Microphone (for speech)
- Creative Sound Blaster Play! 2 (Pi has no audio in)
- USB charger
- Ultrasonic Distance Sensor (to detect presence)
The good and the bad
When it comes to the frame, glass and the monitor we were super happy with the result. It looks awesome, and there is not bleeding.
The computer part of the project still needs some work. Speech is hard on the Pi - Obviously Linux has no built in speech like Windows or OSX. The free alternatives are hard to use and were difficult to get working adequately. For v2 I would consider a full Windows version, perhaps an Intel Compute stick (or if Windows 10 IOT would meet the requirements on the Pi).
We also had some troubles with the distance sensor. It was designed to be used with real time system, which Rasbian is not. However, with some C trickery we managed to get a good approximation that was reliable enough to detect presence.
In the future it would be cool to see what kind of interaction you could get by mounting a Kinect on below the mirror. Could you get face recognition? Could you make games where you use the body as a controller?
I haven't mentioned the software stack at all. That topic is certainly a topic on its own and I hope we can get a post on that too in the near future.
Until then, happy hardware hacking!
Shameless plug: We are a very unique family of driven software-creating professionals.
Join us. We are hiring in all our offices in 🇸🇪 Sweden & 🇸🇮 Slovenia.