Wireless 1 Comment

Follow LinkedIn for actionable insights, industry news, technology updates and light hearted humor

Smart Mirror using Raspberry Pi

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:

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/ /

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.

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).

Real workhorse

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

Changes to the script

Replace the token in smartmirror.py script as follows:

Weather_api_token = ‘XXXXXXXXXXXXXXXXXXXXXXX’  #Replace with your token

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.

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”

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.
Ravi Kumar

Comments 1

  1. 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