Smart Mirror with Motion Detector and Facial Recognition
This is a smart mirror that will turn on using a motion sensor. It will also use facial recognition to decide whether or not it should show a quote based on your facial expression.
Area of Interest
Dougherty Valley High
For my third milestone, I built the frame for the mirror. I also scored the acrylic mirror, which is scratching the surface over a line multiple times to create a groove. With this groove, I managed to punch out the shape of the mirror and attach it to the monitor. I then used 4 long strips of cardboard to build the frame, one for each side, and cut off any excess cardboard. Finally, I used duct tape to keep the frame together and I also covered the cardboard with it to make it more aesthetically pleasing. I have been working relentlessly on training an emotion recognition model, but I wasn’t able to succeed within the session’s time. I should be able to figure all of that out outside of BlueStamp, however.
For my second milestone, I have created a screensaver. Basically, the screen will be turned off every 30 seconds of inactivity. I used a PIR motion sensor, which detects motion using infrared rays. If the sensor doesn’t detect any motion, it keeps the screen off. If it does, then the screen turns on. I controlled the screen through the pi’s HDMI power, so I’m actually just controlling whether or not the pi is sending anything through the HDMI cable or not. I used the subprocess library in python, which is used to run terminal commands through a python script. The command I ran used vcgencmd, which is used to control some graphic settings on the Raspberry Pi. I am still trying to get smile recognition working, which has proven to be quite a difficult task. This will most likely be my next milestone, however. For the image on the left, the component that is closer to the bottom is the PIR Motion sensor, which detects Infrared Rays using the gray cylinder at the top. The raspberry pi camera is the other component in the image.
For my first milestone, I have set up my base smart mirror using the MagicMirror2 library. This library has a set of modules such as calendar, time, and compliments that show up at different parts of the screen. I have also added an OpenWeatherMap API key to the weather module, which displays the weather and forecast. I have also found a way to keep the magic mirror on the screen constantly. I have changed the screen orientation from landscape to portrait because mirrors are usually in portrait rather than landscape. In order to run the program, I would need to cd into the MagicMirror folder and run a command to start the program. Now, however, I created a shell script that automatically ran it using pm2, which is a library that constantly runs programs. This way, the mirror will be displayed upon rebooting the pi. I’m also working on the motion sensor part of the project. I’m still waiting on my sensor, but I have some basic code written to test the sensor. My next milestone will be getting the motion sensor to work in its intended way.