DIY Magic Mirror and Photobooth - Arduino Powered
by alinke in Living > Halloween
258747 Views, 877 Favorites, 0 Comments
DIY Magic Mirror and Photobooth - Arduino Powered
Updated August 2018
A kit is now available for this project from http://diymagicmirror.com/kit_assembled.html
The Magic Mirror shield / kit makes the wiring easier but you can also do the project with your own Arduino Uno, see Arduino Uno Setup Guide along with this wiring schematic.
More info at this project at http://diymagicmirror.com
The software for this project is open source
Who's the fairest of them all. Make your own Magic Mirror and find out. The Magic Mirror can read the weather, tell you how your stocks did, can be wired to your doorbell with an IP camera video feed, turns lights & appliances on and off using X-10 control, and even has a Breathalyzer that tells you when you've had too much to drink. The Magic Mirror plays pre-recorded animations based on input from various sensors. Featuring four characters, each character responds to the sensor inputs with its own personality. Characters include a skull for your next Halloween party, a pirate, a princess character, and a really mean pumpkin who disses you New York cabbie style.
Magic Mirror Features:
- Breathalyzer with optional Tweeting
- Photobooth Mode (Link to Separate Instructable on Photobooth Mode)
- Speak your Tweets from Twitter
- Weather Forecast
- Money Performance (Stocks or Bitcoin)
- Sends X-10 CommandsDoorbell input with IP camera feed
- Picasa based slideshow
- Princess, Pirate, Halloween, Insult Characters
- Text to Speech Mode
- Personalize it with your own Videos
- Runs as a native application on the PC, Mac, and Linux
Parts
El Cheapo PC or Laptop (Windows 7 or Windows 10)
Arduino Uno R3 or Seeeduino 4.2
Used 15" LCD monitor - $50
Dielectric Glass TV Mirror 4mm (2-Way Mirror) 12x12 Sample (Optional) - $20
Magic Mirror Kit with Software - $139 or $49 for DIY Magic Mirror Software Only
Picture Frame with Oval Matte (Optional)
Sensors (Pick and choose the sensors based on your installation)
Maxbotix Proximity Sensor (better for longer distances) or Sharp IR Long Range Proximity Sensor
Seeedstudio Grove Touch Sensors (3)
Seeedstudio Grove Alcohol Sensor(1)
Seeedstudio Grove Button(1)
Reed Switches (2) - $5 each
See here for all supported sensors
X-10 Components and LEDs (Optional)
X-10 Firecracker - $5 on eBay
X-10 Transceiver Module - $20
X-10 Dimmer Switches (2) - $12 each
LEDs - $5
Arduino and Adobe Flash
The basic concept is the Magic Mirror plays pre-recorded and dynamic text to speech videos (Adobe Flash format) based on input from various sensors (proximity, touch, switches). I chose Flash because there is an open source Flash library available called AS3Glue that talks to the Arduino.
On the Arduino, you have to load a program called "Standard Firmata" which let's you control the Arduino from Adobe Flash (specifically Action Script 3.0). This guide steps you through how to load the "Standard Firmata" sketch on your Arduino Uno. You also have to run a serial server (included in the software download) which acts as a middleman converting serial data received from the Arduino to a TCP/IP port that Flash can access.
Connecting the Sensors
I used the following sensors: proximity, touch, momentary switches, reed switch, alcohol sensor, and a potentiometer.
For the proximity sensor, I have the first video set to go off when the subject is standing at a specified distance from the sensor (the distance can be changed from the configuration program). The Video then tells the subject to come a little closer and then a second video plays. There is also a stealth mode setting where the Magic Mirror appears as a normal mirror and then gives people a surprise when within range of the proximity sensor (good for Halloween parties).
I mounted the touch sensors behind the drywall.
Connect the sensors per this schematic below.
The door and window reed switches are the same ones used in home alarm systems. I got mine from www.hometech.com.
Configuring the Software
Controlling the Lights
The Installation
Of course, I had to do the full on installation which was a playhouse I built for my two girls. The playhouse is 8x8x8, I got the plans for the playhouse here http://woodmanor.net/Little-miss-playhouse-plans.html. My Dad built it in Oregon and then dis-assembled it and drove it down to California where we put it back together. We then poured a concrete slab for it and then roofed and painted it. Its basically a full blown mini-house with electrical, insulation, drywall, vent, TV, phone, pergo floor, etc.
The playhouse in itself was quite a project. The nice thing about building it from scratch is I was able to run all the wiring for the sensors through the walls as well as the electrical, doorbell, speaker, network, coax, and phone. Here's a separate instructable on the playhouse https://www.instructables.com/id/The_Princess_Playhouse/
The Magic Mirror PC
I went the custom route and re-purposed an old vacuum tube tester case. I went with an Intel ATOM motherboard since its low power and very compact (mini-ITX form factor). One annoying thing on this model was the excessively loud fan which would ruin the effect. I found a silent fan at Fry's for $20, you can still hear it but barely. I re-purposed some of the controls, the on/off switch and a pot which is used to select the mirror mode on the fly (princess, halloween, or pirate). Also added some fiber optics for show. For the sound, I run the normal soundcard output into a whole house audio distribution system and play through the in-ceiling speakers which is nice so you don't see the PC speakers.
Another nice feature and benefit of using Flash with an Internet connection is you can play different videos based on data received from the Internet. For mine, I did different things for the weather and stock portfolio. For the weather, I call a Yahoo Weather API and then play a different video based on the forecast, one video for good weather, one for ok weather, and another for rain. For the stock, a different video plays based on how your stock portfolio performed with the stocks being specified in the config file. Same concept, one video for good performance, one for no or little change, and one for down. The threshold limits on what defines up and down can be changed in the configuration program.
For remote maintenance, VNC is setup so you can connect remotely from another PC using a ultraVNC. VNC comes with UBUNTU so if you go the LINUX route, its already there. Its very easy to install though on Windows, although I don't know if VNC works with Windows Vista or Windows 7.
Fireplace and Fake Fire
For the fake fire, this was easy as the Arduino and AS3Glue library have pulse-width modulation (PWM) built it was just a matter of tweaking the PWM parameters to simulate a flickering fire with Red LEDs. The Magic Mirror software has the option to use the LEDs like this as a flickering fire effect or instead you can also use them as indicator LEDs (telling you how drunk you are to compliment the videos tellying you how drunk you are) for the Breathalyzer.
Producing the Video
After writing the scripts, I was lucky to find a very good voice over guy who was able to do all four characters and then I produced the videos in Adobe Premiere. Here are the videos.