Abhyan Jaikishen (abhyanj2, ECE120), Kyle Li (kyleli2, ECE120), Jeric Cuasay (Cuasay2, ECE110)
Introduction
Statement of Purpose
Today, the front-facing camera on smartphones and laptops have rendered physical mirrors almost useless. The goal of the smart mirror is to equip actual mirrors with a screen behind it that allows it to tell time, check schedules, and do numerous other things with widgets. This will allow users to reflect on the tasks they need to do while they reflect in the mirror. In the future, if time allows we plan on adding voice control or facial recognition. Overall, this will provide a better use of the mirror and make the mundane task of looking at oneself in the mirror into a productive activity.
Background Research
The smart mirror is a double sided mirror with a computer monitor within the frame. The monitor is powered by a raspberry pi, in which we will install an SD card and install Raspbian Jesse OS as well as Magic Mirror or other smart mirror software from gitHub. Although the project does not have too many important aspects, it does have some practical uses in saving time in the mornings, as one would not need to constantly check their cellular device nor need a separate clock. We are driven to work on the project because we think the device is really nifty, involves really interesting applications of software, and also I do not have a mirror in my room so I can’t see my hair in the mornings after I leave the bathroom. The smart mirror essentially consolidates all important information into the mirror, so while we brush our teeth, for example, everything is right in front of us. Our proposed project will be different to other projects because we will attempt to add modules to our smart mirror such as a bus schedule, cortana/siri/ok google/alexa, and we want to add facial recognition to add some interactive functionality with blinking potentially. Other projects we considered while coming up with this idea were a MIDI launchpad and automatic light switch (turn on/off after hearing claps). While these were all very interesting, we ultimately thought the smart mirror was the most fun and useful project to make.
Design Details
Block Diagram / Flow Chart
Physical System OverviewMicrophone
Implementing voice activated controls would be a secondary goal in this project.
Could potentially utilize the API of an existing voice assistants (like Alexa)
Raspberry Pi
Initial Goal: Utilize existing API to pull useful data and display it.
For example: Weather, Time, Date, Basic Messages
Monitor
Displays output of whatever we have running on the Raspberry Pi
Parts
(Wifi Module depending on generation)
Possible Challenges
Building the frame (inexperienced)
Implementing various APIs
Figuring out how to potentially incorporate facial recognition into the camera and raspberry pi (we want the camera to detect blinking)
Space management
12/11/19
Final Project Lab Report
1) Introduction
•Problem description
Today, the front-facing camera on smartphones and laptops have rendered physical mirrors almost useless. The goal of the smart mirror is to equip actual mirrors with a screen that allows it to tell time, check schedules, and perform numerous other tasks while also being able to reflect a person or object like a normal mirror. Overall, this will provide a better use of the mirror and make the mundane task of looking at oneself in the mirror into a productive activity by allowing someone to skip the step of checking their phone in the morning to view everyday information. We are planning on doing this by utilising a raspberry pi connected to a monitor of which we will install a semi transparent mirror on top of.
•Design concept
Our design is that we have a raspberry pi system installed with an interface that will display the date, time, and any upcoming holidays or events. We will display this interface onto a monitor, and in front of that monitor will be a 30% transparent acrylic mirror which will allow someone to both see their reflection each morning, as well as view the interface simultaneously. In order to save power so that the device is not constantly powering the interface, we have connected an HR-SR04 ultrasonic sensor to measure the distance of objects in front of the mirror. By using raspberry pi code, we can make it so that when someone is close to the mirror (i.e. 100cm in this case), the raspberry pi will send a signal to the monitor to turn on, otherwise our raspberry pi will kill the signal between the pi and the monitor if there is nothing nearby. As our ultrasonic sensor detects when people approach the mirror, we will place it so that it faces away from the mirror but is also very near to it for accurate measurements.
2) Analysis of Components
Characterization of each sensor
Ultrasonic Sensor:
The ultrasonic sensor has an ultrasonic emitter and receptor, both under a single ultrasonic transducer. The sensor sends a 40kHz ultrasonic sound wave, then detects the time it takes for that ultrasonic signal to return to the transducer. After that point, we just need simple arithmetic, Vsound * t / 2, and there is a multiplier by 0.5 because it measures the time that the ultrasonic waves goes to the object and back, therefore we need to divide our measured distance by 2.
We are using the ultrasonic sensor to detect the distance of a person in front of our device. With this measurement, once the person gets too close to the device, the monitor will turn on revealing the magic mirror interface. In order to get our values, our ultrasonic sensor sends its measured distance signal after a short period of time, as shown below. 100 cm, or 1 meter, is our intended threshold distance for our device functionality, and also as shown below, it can measure ranges much farther above and below that threshold therefore will guarantee accurate functionality.
Design analysis
We decided that we could use the ultrasonic sensor as an input to measure the distance needed to control the backlight of the monitor, so that if no one is near by our device, the magic mirror will turn off. We also decided that because the ultrasonic sensor has a max sensing distance of 4-5 meters, which exceeds a typical distance a person stands from a mirror, we would write out code so that the ultrasonic will have a 1m threshold before turning on. This way, when someone approaches the mirror, the monitor will turn on to reveal our interface. Due to the functionality of the ultrasonic sensor, if we block the transducers it will only give us very low measurements all the time. To counter this, we placed the ultrasonic sensor in an unobstructed location, allowing for a full range of detection and the utmost accuracy.
Our code, as stated before, takes the time measured and multiplies it by half the speed of sound in order to convert the time measured by the ultrasonic into a quantifiable distance that we can use to set a specific distance threshold to control the backlight of the monitor via raspberry pi.
3) Design Description
Block diagram
Circuit schematics
Our circuit only consists of an ultrasonic sensor and a raspberry pi. The ultrasonic sensor is grounded and connected to VCC, and its two logic ports are trigger and echo. The trigger is connected to a raspberry pi logic pin directly, but the echo first has to go through a current limiting resistors in order to tie the signal to the raspberry pi, and afterwards there is a pull down resistor to provide a constant low current. We did not need three resistors, to limit the current, just wanted a higher resistance value and did not have the correct resistor on hand.
Other electrical components we have are what connects to the raspberry pi: the monitor via HDMI and the power input from a micro usb port which draws power from an external source (in this case we used our laptops). The monitor has its own power input from the wall.
Physical/mechanical construction
The only sensor we have in this device is our ultrasonic sensor, which we must orient away from the monitor and towards the potential onlooker, because our software logic detects if a person is close enough to the mirror in order to turn on the monitor, otherwise the monitor backlight is off and the magic mirror loses its magic and becomes a regular mirror. We have to make sure not to block the path of the ultrasonic sensor, or else it will give us inaccurate values and will not function as we intended it to. (it is installed right below the monitor as shown by the two circles popping out below the mirror)
4) Conclusion
Lessons learned
We initially faced several obstacles while setting up the Raspberry Pi. Given that none of us had previously used Raspberry Pi, and we were using a fresh board, the installation process ended up proving to be extremely time consuming. From formatting the SD card, to dealing with corrupt files, we quickly learned to check and test each step of the way. In a more general sense, our ambitions got the best of us and we learned how much time and effort goes into each part of building a project.
Self-assessment
Our design successfully fulfilled the goal we had set in mind: making the regular mirror more productive and intuitive in the mornings. Although there is not much to our device yet, we have set ourselves up for upgrades and improvements in the future. Not only is our engineering process more refined thanks to this, but we also have a better grasp on the electrical and software requirements behind improving our project.
We were not able to implement the microphone as initially desired, but instead we were able to use an ultrasonic sensor to improve the device’s functionality. Although it differed from what was originally planned, it still fulfills the initial goal set in the beginning.
References
[1] Teeuw, M. (n.d.). MichMich/MagicMirror. [online] GitHub. Available at:
https://github.com/MichMich/MagicMirror [Accessed 20 Sep. 2019].
[2] Instructables. (n.d.). How to Build a Raspberry Pi Smart Mirror!. [online] Available at:
https://www.instructables.com/id/How-to-Build-a-Raspberry-Pi-Smart-Mirror/ [Accessed 20 Sep.
2019].
[3] Piratla, S. (2019). Make Your Own Smart Mirror for Under $80 Using Raspberry Pi. [online]
Hackster.io. Available at: https://www.hackster.io/SrivishnuTech/make-your-own-smart-mirro
r-for-under-80-using-raspberry-pi-a87460 [Accessed 20 Sep. 2019].
[4] Teeuw, M. (n.d.). MichMich/MagicMirror. [online] GitHub. Available at:
https://github.com/MichMich/MagicMirror [Accessed 20 Sep. 2019].