"Magic Mirror"

ECE 4180 Final Project

Welcome to the Magic Mirror Group Page.

Description

The Magic Mirror is a special mirror with an LCD behind it. The Mirror is a special two-way (sometimes called one-way) mirror that reflects light on one side, but allows light to pass through on the other side. Using this principle, we can make a magic mirror with information displayed on the LCD, so that oen can stare at their reflection, and see information such as traffic info and weather while the mirror talks to them.

In order to implement this magic mirror, we used a raspberry pi as the computation device to drive the LCD. We used a python websocket server to run the api calls for the traffic and weather info, and used a webpage with embedded javascript and css to create the magic mirror page. The python backend also runs audio calls and plays audio for the personal greeting, weather, and traffic.

Details

The Raspberry Pi duals as a controller and web socket server. First, the controller portion will make HTTP requests to Yahoo Weather, Google Maps, and WordsAPI for weather data, traffic times, and word of the day data. The API calls return JSON data to the controller which then parses this information for the web socket server portion. The Raspberry Pi web socket server takes the parsed JSON API information and forwards this to the client web page.

The controller portion of the Raspberry Pi is connected to a webcam that is running OpenCV detection software to check for new users that have approached the mirror. Upon detection of a new person will it forward this information to the web socket server portion stating who the person is and that it is ready to send new web socket data to any connected client web pages.

The client web page keeps an open web socket with the Raspberry Pi web socket server and asks the server every ten seconds if a new person was detected in front of the mirror. If a new person is detected, and when the client web page requests for new data then will the server reply with updated traffic time, weather information, and a new word of the day for the client page. If a new person is not detected, then each request for new data is discarded and no new information is sent to the web page. Simultaneously, if new data is sent to the client web page will the Raspberry Pi controller play audio stating the new data.

The client web page accepts the new information and displays this information on all black screen to be used for the mirror display to give the illusion that it is functioning as a ‘smart’ magic mirror.