How to create a Smart Mirror Using Raspberry Pi

author

Aziro Marketing

Oct 24 - 0 min read

How to create a Smart Mirror Using Raspberry Pi
play-pause-btn

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

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

2 (1).jpg
3 (2).png

4.jpg
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.
How to create a Smart Mirror Using Raspberry PiHow to create a Smart Mirror Using Raspberry PiHow to create a Smart Mirror Using Raspberry Pi

LET'S ENGINEER

Your Next Product Breakthrough

Book a Free 30-minute Meeting with our technology experts.

Aziro has been a true engineering partner in our digital transformation journey. Their AI-native approach and deep technical expertise helped us modernize our infrastructure and accelerate product delivery without compromising quality. The collaboration has been seamless, efficient, and outcome-driven.

Customer Placeholder
CTO

Fortune 500 company