Introduction: University of Cincinnati CCM Capstone- Raspberry Pi Smart Mirror
Hello! This is my senior capstone project as a Theatre Design and Production student at the University of Cincinnati, College-Conservatory of Music. My name is Megan Edwards and I will be graduating with a BFA in Technical Direction at the end of April, 2017. In this Instructable, I will be showing you how I made a "Smart Mirror" that displays the weather, time, date and news headlines.
I used the steps and code created by "Hacker House" to create my Smart Mirror. For more assistance, watch their instructional video at:
1- Raspberry Pi 3 board
1- 2.5A Power Supply (I recommend buying a Raspberry Pi kit that includes this so you know you're getting the right one)
1- LED Monitor (Must have HDMI port)
1- USB Keyboard (Wireless or Wired)
1- USB Mouse (Wireless or Wired)
1- Micro SD Card (with the "NOOBS" program pre-installed)
1- HDMI Cable
1- See through acrylic mirror
Materials to make the frame that your monitor will sit in
-I wont go into detail about building the frame because the size and shape will vary depending on what monitor and cable you are using.
Step 1: Set Up Raspberry Pi 3
Connect your Raspberry Pi to the monitor via the HDMI Cable. Plug in your keyboard and mouse to the UBS ports and insert the Micro SD Card into the slot. If your kit came with a case, go ahead and assemble that to keep your chip safe. Plug into power and your Pi should boot up!
Step 2: Download the Code
Follow the above link to find the code directly on your Pi. You'll need to connect to Wi-Fi as well.
First, install git. This is a program that will allow you to download the code directly from the GitHub link above. You can do this by opening up a terminal (black monitor icon at the top of the screen) and typing the following code:
$ sudo yum install git-all
Once that's finished, download the code by typing:
$ git clone email@example.com:HackerHouseYT/Smart-Mirror.git
Next, you'll need to install a program called pip so you can import the required dependencies. Do this by running:
$ python get-pip.py
Then, you can download the dependencies for the code:
$ sudo pip install -r requirements.txt
$ sudo apt-get install python-imaging-tk
Step 3: API Token
You'll need a program called vim in order to open up the code and input your location and weather data:
$ sudo apt-get install vim
Next, you'll need to add your API token to the code. Do this by running:
$ vim smartmirror.py
and the code should open.
Make a free account on forecast.io
Under the developers tab, you can make an account and it will give you an API key which is a series of 33 letters and numbers. Insert that code where is says in the smartmirror.py code:
Next, insert your Longitude and Latitude into the code as well.
You'll also need to input your country code for the news updates. If in the us, type:
To save these changes, press the escape key and then hold shift while pressing the "z" letter twice.
Step 4: Run the Code!
Simply type into a terminal:
$ python smartmirror.py
Give it a moment to load, and then the window should open up.
Make this window full screen by clicking in the window and pressing enter.
Depending on the dimensions of your monitor, you might need to go back into the "Smart-Mirror" file and alter the text size to fit the screen better.
If you get a privacy/access error code, you might have to go back into your GitHub account and create a SSH Key. You can do this under settings in your account.
Step 5: Rotate to Portrait Orientation
Run the code:
$ sudo vim /boot/config.txt
to open up the Pi's settings .
Scroll to the bottom of this code and ad a line:
Save the changes by typing:
Then, restart your Pi by typing:
$ sudo reboot -h now
and when your pi comes back on, it should be in portrait orientation.
Step 6: Remove Screen Saver
You'll want to turn off the setting that automatically puts the screen to sleep when not in use so that you don't have to keep the keyboard or mouse connected and so that the mirror stays on.
Open a terminal and install:
$ sudo apt-get install xscreensaver
Under the start button in the upper left corner, find the preferences tab and open the application "screensaver"
Once this opens, use the dropdown menu under "mode" to disable screensaver.
This should prevent the monitor from going to sleep.
Now, you are ready to run the code. Open the Smart-Mirror file by typing:
$ cd Smart-Mirror
Run the code by typing:
$ python smartmirror.py
Click inside the window and press enter to make it full screen.
Now you can detach your USB Keyboard and mouse and mount the monitor into the frame!