Avatar

HOMEMADE SMART MIRROR

Jun 14th, 2020 | by: ELECTRONOOBS
Views 203
In this tutorial we go step by step on how I've made the frame of the mirror, how to prepare the one way type of mirror using a special film, thenw e see the scheamtic and all the electroncis we need, we mount the mirror and we upload the software on the raspberry pi. Finally we make our configuration for the agenda, calendar, local time zone and weather. I hope you will like the tutorial. Consider supporting my work on PATREON or if you want, support me on PayPal. Thank you very much!

See the VIDEO



Part 1 - What we need?


First you need the 3D parts for this design. For now I'm sharing the design for free on my shop since the plane was not tested yet. But, if you consider supporting my work, there is the same version for 5$ so thank you. So, go below and see all the parts. Download the .zip file with the STL files from my shop. Get the rods, servos, battery, glue and all you need, and then, in a few hours, you can assemble this plane once you have the 3D parts. Printing the parts will take some days. Having multiple printers will reduce time.


Electronics:
Mirror Frame:

PART 2.1 - Preparing The Frame


First step I make is to measure the glass I have. In my case, this glass is from some old furniture I don't have anymore but I kept the glass. My glass is of 97 by 35 cm. I cut the 40x35mm wood to size in such a way that once I have the frame, it will cover 1cm of the glass all around. I cut two pieces of 104xm and two of 94cm for the front frame. For the back part of the frame I cut two of 101cm and 35cm to go around the glass. Pass some sand paper on the edges and smooth the wood.

PART 2.2 - Making The Frame


Nowe we make holes so the screws won't crack the wood. Make the holes smaller than the screw diameter. I aslo enlarge the hole at the end so the screw will fit flat inside the wood and we can fill it with wood putty. Screw the main frame and use tools to make sure it ahs 90 degrees corners. Then, place the glass on top adn screw the back part of the frame, the aprt that will keep the glass in position.

PART 2.3 - Final touches


Once you ahve the frame pass anothar time some sanding paper. Then we add wood putty all over the screw holes, cracks, parts where the wood are joined together and so on. Once the putty is dry, pass the sandpaper again. When the frame is smooth and ready, we can paint it. I will sue white paint. I add two layers of paint and the frame is ready!

PART 3.1 - Assemble 1


Get all the electronics and let's make the connections. We don't need the keyboard and mouse for the final project, but we do need those for the software configuration. Also, you could add a PID relay to the final circuit in order to turn on the backlight of the display only when somebody is in front of the mirror. But that's just extra. Ok, get the partsm see the schematic and make the connections and then we upload the software.

PART 3.2 - Schematic


Ok, the connections are very easy. Below you have the scheamtic for this project. Remember that we need the keyboard and mouse just for the configuration and then we romove those so we need to set the raspbery pi to enable smart mirror automatically when it is turned on since the mirror won't have controls. Ok, connect the LCD to the HDMI driver. Power that driver at 12V from the DC adaptor. Connect the Raspberry Pi HDMI to the display driver with the HDMI cable. Power the Pi with the 5V adaptor. Power both adaptors from 220V AC from main outlet. Connect all the USB pheriferials for now, the mouse, keybaord and WiFi antenna if your Pi dosn't have WiFi integrated.

PART 3.3 - Prepare for software


Ok, now we have everythign connected. Get the micro SD card and format it. Make sure it has high speed, with low speed SD card we might have problems. Put the SD card into the card reader for the PC and format it and not let's start with the software part.

PART 4.1 - OS Software 1


Connect the SD card to the PC and format the SD card. Then go to the link below on raspberrypi.org and downlaod the Debian Buster version for the raspberry pi OS. That will download a ZIP file. Save this ZIP file for later.

1. Raspberry Pi OS: https://www.raspberrypi.org/downloads/raspberry-pi-os/

Next go to the link below and downlaod a software called Etcher that will burn the OS image to the SD card. This will download an .EXE file. So install taht software and run it.

2. Balena Etcher: https://www.balena.io/etcher/

Run Balena Etcher. Click the plus button and here, select the ZIP file for the Raspberri PI OS we haev just downloaded before. Then, on the drive button select the SD card drive. Then click flash. This will burn the OS to the SD card. This will take some time so be patient. When is ready, remove the SD card reader from the PCB adn get the micro SD card. We can now pu the card into the raspberry Pi.

PART 4.2 - OS Software 2


Make sure the Pi is not pwoered on and then insert the card. Now connect power to the screen and Pi. This will boot the raspberry Pi OS and you will get the welcome messages and the first configuration. On page 1 of this config, select tge countr, language and timezone. Click next and create a password for your OS.

PART 4.3 - OS Software 3


If you can see a black border around the screen, check that checkbox and click next. Then connect to your WiFi router using your internet WiFi password and click next. On the next page, if you want you can, you can update the OS. I sckipped that. Then click the reboot button and the OS will starta gain and we are ready.

PART 5.1 - Magic Mirror Software 1


Now we can install the Magic Mirror. for that 1. run the terminal on the Pi. You can find all the steps here on the original psot as well on https://docs.magicmirror.builders/getting-started/installation.html Then 2. copy the next link and paste it on the terminal and hit enter.

2.  

When that process is finish, 3. copy the next line and paste taht in the terminal and hit once again enter and wait to finish.

3.  

Now we have to clone the repository and check out the master branch. For that 4. copy the next line and paste it into the terminal and hit enter. Now we have a clone of the files for the magic mirror on our raspberry pi. Let' go to the next step. Don't close the terminal yet!

4.  

PART 5.2 - Magic Mirror Software 2


Now, we have to open the folder where magic mirror is and for that 5. we type the next line on the terminal and hit enter. Then 6. type the npm install and taht will install magic mirror.

5.  

6.  

Later we will change the config file, but for that we make first a copy of this file just in case. For that, 7. copy the next line, paste it into the terminal and hit enter.

7.  

Finally, we can now run the magic mirror platform and for that 8. copy the next line, paste it on the terminal and hit enter.

8.  

PART 6.1 - Configure Magic Mirror 1


Magic Mirror works but it has the default data. We want to place our data for time, weather and calendar. 1. Go to the the pi directory, to the MagicMirror Folder, open the config folder and there 2. open the config.js file with the text editor. Is time to add our data. First, in my case I delete the greatings block because I don't want that. 3. Delete from bracket to bracket. Go to the next link and create an account. Then go to APIs and create a new API and copy that code and 4. paste it in the config.js file.

Go to openweathermap.org: https://home.openweathermap.org/api_keys

PART 6.2 - Configure Magic Mirror 2


Below one the City List file and press CTRL+F for Find. 7. Search for your city, in my case Barcelona. 6. Copy the city ID and paste it in the config.json file as you can see below. Now save the file and go back to the termianl and type agin npm start and magic mirror will start but now with your local weather data.

See City List


ART 6.3 - Configure Magic Mirror 3


Ok, close Magic Mirror again by pressing ALT and then file, and quit. Open config.json again. We need to add our agenda. For that we need a google calendar account. Go to the link below and if you don't already have a google mail, create a new account. Then go to calendars, 9. click the settings gear and select settings. On the lft side, on my calendars, select your calendar. 10. First enable public share by checking the checkox. Go below on this same apge and 11. copy the public link in an iCal format12. Paste that link in the config.json file on the calendar block url. Save the file adn run again magic mirror. Your google calendar should now appear. If you want to also keep the US holiday calendar, just copy adn paste that block in the config.json file.

https://calendar.google.com/calendar


PART 7.1 - Auto start 1


Ok, magic mirror works but we want it to auto start when we reboot the Pi because we won't have the keyboard and mouse. For taht we wull use the PM2 method. So, go back to the terminal and 1. paste the next line and hit enter. That will Install PM2 using NPM.

1.  

Then 2. copy the next line and paste it and hit enter.

2.  

This action will give you a link to copy and paste. So, 3. copy that link, paste i on the terminal and hit enter. Once that action is ready, 4. copy the next link, paste is and hit enter.

4.1  
4.2  

PART 7.2 - Auto start 2


That will open the mm file. In that file 5. copy the next lines and paste it there in the file. To save type CTRL+O and hit enter and then typoe CTRL+X for exit.

5.1  
5.2  

In the terminal, now 6. copy and paste the next line and hit enter.

6.  

Then 7. copy and paste the next line and hit enter. Then copy adn paste the save line adn that's it. Reboot the pi and magic mirror should start automatically after a few seconds.

7.1  
7.2  

PART 8.1 - The one way glass


We have the frame and electronics but we don't have the one way glass. For taht get the glass and clean it very, verry well. Apply soap-water over the glass and then peal the sticky sife of the one way film. Glue that film on top of the glass. using a plastic or rubber spatule, remove all the water below the film and make sure there are no more bubbles. Then cut the excess of film and the one way mirror is ready.

PART 8.2 - Assemble the mirror


Make the border of the screen is a black so it won't reflect any light. Then palce glass inside the frame and using the 20x20mm wood fix it in palce with nails. Over the glass place the screen. In my case I want it on the top of the mirror. Cut some cardboard and fill the rest of the space. Take out the cardboard and paint it black. Palce it back adn then decide where to place the electronics. make the connections and that's it. Pass a wire through the frame and connect it to the power adaptors of 12 and 5V.

PART 8.3 - All Ready


I use glue, tape and zip ties adn fix everything in place. Flip the mirror, connect it to 220V and observe the magic. See more details on the original creators page here https://docs.magicmirror.builders/getting-started/configuration.html.

PART 9 - Thank you


See the full video tutorial below. If you want to support me, consider my PATREON page or if you want, consider helping me on PayPal. I hope this project will help you and teach you something new. Thanks again!


DONATE


0 Comments

Login or Sign Up to post comments on this tutorial.