Almost everyone has a mirror in their home. Whether it is in their washroom, bedroom, or hallway, it is a part of daily life. My end goal is to create efficiency by combining something so simple, like a mirror, with programs to help a person save time by presenting them with simple, easy-to-read daily information that is usually found by cell phone apps. Another purpose of the 'magic mirror' can be a piece of an efficient smart home, with date and time plus weather tracking specific to an area with constantly updating news and outdoor camera feeds, this piece of technology can benefit many households.
The reason I chose this project is that I like to be efficient with anything I do and I prefer to have everything shown to me at once, as opposed to having to search for it on my mobile device. This can not only help me be efficient but help cut down on screen time; a very big problem amount young adults like me. I asked myself, How can you create something to help make people more efficient that they will use in their daily life?
This PBL is based on a balance of both hardware and software, these materials for the most part are counted under 'hardware'
- Raspberry Pi 3 B or 3 B plus
- Micro USB PSU for Pi
- 27' Monitor*
- HDMI cable
- Standard USB mouse and keyboard
-Pine wood*
-Clear glass or Acrylic pane
-One-way glass tint (Chrome)
-Screws
- Power tools, Table saw, and Drill
- Extension cord
(Optional)
- LED Strip lights
- App-controlled extension cord*
With anything having to do with electronics and physical construction, you want to remain safe. I've compiled a list of basic safety tools and how they will apply to my PBL, to help anyone who wants to recreate this safe.
A resperator, to keep sawdust and fumes out of your lungs when cutting/ staining wooden building materials
Safety glasses, to protect your eyes in case of wood chips flying or glass shattering
Anti-static thick gloves, to protect your hands from cuts in case of the glass shattering and to protect the sensitive electronics from dying due to static discharge.
Parental supervision is highly reccomended, as you will be dealing with cutting materieal to size and fastening in or drilling some parts of the electronics and frame.
My PBL project has many aspects, and the steps can be alternated, but the steps below is how I did mine to maximize my efficiency and minimize down time.
After searching for ways to create my own smart screen I came across a widely used program built for Raspbian OS, Magic Mirror 2. After reading on about it I figured out it was a community of people who used this program to customize their mirrors. To save time coding my own program, I knew this was the more sensible path to take.
Once I figured out which software programs I would use, I flashed my MicroSD card with Raspbian, an Operating System made for Raspberry pi. I chose the Pi for its compact size, yet high programming capabilities. Then I went thru with the simple setup.
Thankfully, Magic Mirror allowed their program to be downloaded thru the terminal, a built-in programming environment for Raspberry Pi functions. Using the clear instructions, in a few steps I successfully downloaded the file, which can be configured thru the file manager.
Next, I went on to remove many preset modules which I did not want on my mirror. Although the program was written in JavaScript (.js), with my knowledge on Java and Python , it wasn't too difficult to modify.
I didn't want to stop there, it would be just like anyone else's pre-configured mirror, so I took it upon myself to find something that's very convenient but hard to access. Then it came to me, a doorbell camera. Using the RING app takes a good minute to see the visitors, so I decided I would program mine to automatically show on my mirror.
I found a video on a doorbell camera, however the GitHub was outdated and didn't work in the original form. With high levels of encryption I had to re-program the file so it logged in at one instance and stayed logged forever. The only problem was two factor on my camera app. I found a 2fa fetcher from another module and adjusted it to my needs. After hours of tweaking I finally had a LIVE doorbell camera view pop up with <10 seconds delay.
Please note!!!
These steps will create a magic mirror with some modules. It will not autostart, you have to download pm2 script off the Magic Mirror website. It is very helpful throughout this coding process. My most used command was
pm2 restart mm
It basically restarted the magic mirror to test your tweaking with the modules. I have broken it sometimes but there is a recovery file you can copy and paste into the main config. I reccomend trying this every time you change a module, if it crashes do
/*
(the module you messed up on)
function = true,
another function = false,
exampleFunction = "imperal",
*/
Doing the */ | /* in the code comments out that part and it should ignore it and use the other modules. This is helpful if you cannot figure it out, you can simply copy paste from the recovery.
Once I received my monitor, I confirmed that it was in working condition. Many people who do this project disassemble the monitor, but mine was rather thin so I left it as an extra safety measure. As I was planning on putting the monitor vertical, I measured the vertical edge so I can buy appropriately sized glass (THIS MANY INCHES).
I then went to Lowes and picked up a size of glass slightly taller than the monitor, my plan was to have the overhang support it from the front. I also got some pine planks for my interior and exterior frames.
To make the exterior frame, I measured (INCHES) inside from the edge, so it would create an overhang for the glass to rest on. I used a saw to cut the pine to scale.
To make the interior frame, I measured the thickness of my monitor and left (INCHES) extra for airflow. This one had to be laid up and down and not flat, to create space for the hardware.
After confirming the glass fit inside the interior frame, and that the exterior frame fit somewhat well, I used glue and screws to connect the two together.
To create a mirror effect, I had to get a one way chrome film, like a mirror but only one side reflects. I used water to squeegee on the film so the out pointing part is reflective, and interior isn't.
I fit the glass in and put the monitor in the position I would like it to sit, and screwed a beam at the bottom of it, holding the monitor in place as well as putting pressure on the bottom of the mirror. Then I put in one more support to secure it down.
To attach the monitor, I put in the wires and used scraps to secure it to the other frame. I used screws to fasten down my Raspberry Pi in a position towards an open vent I made to allow airflow and prevent overheating. Then I used the double sided LEDs on the back of the front frame for aesthetics.
In an attempt to prevent multiple wires coming from the mirror, I tied down my power strip and made all the connections. Then I made minor adjustments for channels so the wires are managed better.
All that was left was to plug it in and watch the pi Boot up.
The scientific part of my project is more psychological, as it has to do with the human brain and digesting information. It goes into trying to prevent the harm that excessive screen time creates for a human. Although a mirror may seem like something simple, but cutting down on the 15 minutes spent on average, daily, trying to find this information, can add up. It adds to 1:45 minutes per day, 7 hours per month, and 84 hours per year. When it adds up, it is made apparent that even 15 minutes, done constantly racks up many hours in harmful, excessive screen time.
Currently my PBL project, RPI smart mirror is being used in my bedroom as a tool to help me make my day more efficient and to reduce morning/night screen time. I wake up, look at the time and weather then I get ready for the day. While I am doing something looking into the mirror I can see my schedule or read up on some fast headlines. If there is a visitor at my door I can glance over from my desk and take a look at the live feed from my doorbell. This can benifit society how it can benifit me, it helps reduce screen time, and keeps me organized for the day. Future benifits for this could be to possibly have it pre built and a more simple config for easier modification and cheaper builds, maybe even a touch screen would help it greatly. Overall, I am satisfied with my end product and it was a very plesant experience learning and using this technology on a daily basis.
How does the monitor display 'inside' of the mirror?
The 'mirror' is a one way mirror, allowing light to pass thru on one side , and with a dark surface behind the mirror, no light passes through, only the white
monitor pixels.
2. How does the Raspberry Pi know which program to auto-launch?
With the Magic Mirror module, there is also a pm2 script installed. Not only does the pm2 restart mm script help make it easier to change things, it installs itself into the OS, so on launch it launches the last saved version .
3. How does the Raspberry Pi source local info?
For the different modules there are different methods of accessing local information. For weather, it needs a weather token, which some weather sites provide. This basically grabs your location during the time of getting the token and reports weather based on that. For calendar there is already a standard calendar built in, but I made my own google calendar public and took the public url and pasted it into the files so my personal calendar would show.
4. How does the Ring module work ? How does it access the cameras?
(aka aren't camera systems supposed to be high-secuirty?)
Obviously, a home camera system is pretty secure. Ring is secure and require a 2fa code for every login. To get past this 2fa, I found a 2fa token code which basically takes user input on email and password, then if its valid, it asks for 2fa code which gets texted to a phone. You copy the 2fa token into the module and it keeps that token until you log it out (remove code or change the password). Then the Pi detects a notification coming from the system and displays the cameras.