How to create a Smart Mirror Using Raspberry Pi

Ravi Kumar Apr 06 - 3 min read

Audio : Listen to This Blog.

Smart Mirror

This blog shows how to enable Smart Mirror using Raspberry Pi. It is used to convert your home/ room/ office work space/ commercial space into your personal assistant with the help of smart mirror that shows up your latest calendar events, weather forecast etc. It can be used as notice board with the help of a mirror.

Let’s dive into how to setup this up:

1. Components Required for this Project

  1. Raspberry Pi (Currently used version 2)
  2. SD Card
  3. Wi-Fi dongle
  4. Monitor
  5. Two-way Acrylic Mirror




Firstly, we need to setup basic installation for Raspberry Pi, you can refer to installation tutorials from https://www.raspberrypi.org/downloads/ 

2. Setting up the Raspberry PI

  • Format the SD card with FAT32 as format and Copy the Noobs OS into that
  • Connect Raspberry with HMDI Output monitor (LED/LCD TV or any monitor that takes HDMI input).
  • Connect with the power and wait till Raspberry pi OS setup is completed and restart it.

3. Connecting with weather

Create an account with https://darksky.net/dev and get the API Key to call the weather API to get the weather info (Weather_api_token).

4. Real workhorse

smartmirror.py is the python script which does the actual work of showing the events belonging to the signed up user.

5. Changes to the script

Replace the token in smartmirror.py script as follows:

Weather_api_token = ‘XXXXXXXXXXXXXXXXXXXXXXX’  #Replace with your token

6. Connecting with Google Calendar

Run the script “get_cal_events” available at /home/pi/Smartmirror the location.It will open the Browser and it prompts for Google account from which the calendar needs to be imported. Once the authentication is completed, the API key will be generated and stored locally. Please make sure you are connected to the internet while trying to execute this script. This script will update the events for every 20 minutes which can be modified.
It will create Image with weather, calendar, clock and run it.

7. Configuring Raspberry Pi

Open file “sudo nano /boot/config.txt”
Add the following code below

display_rotate=1

This will enable the rotation of the screen.
If the rotation needs to be disabled just change the value to zero like below.

display_rotate=0

Then reboot raspberry Pi using the following command

“sudo shutdown –r now”

8. Future additions

These functionalities can be added in the future.

  1. Face recognition.
  2. Touch screen for viewing maps.
  3. Video playback.
  4. Control electrical components like lights, fans and others using voice commands.

1 Comment

  • Mani says:

    Ravikumar – Interesting to know about this. I have a question though. I am not very much clear on how and when “Two-way Acrylic Mirror” is connected to this setup? Can you please explain?

Leave a Reply

MSys Technologies has holistic experience in IoT, Machine Learning, and Artificial Intelligence. We can be your partner if you are dabbling into the Internet of Things or are looking for a solution provider with expertise in that domain.