DIY Smart Mirror Using Raspberry Pi, Google Assistant, and a 7" LCD Screen

Vineet Sharma
5 min readDec 29, 2024

DIY Smart Mirror Using Raspberry Pi, Google Assistant, and a 7" LCD Screen

Creating a smart mirror can be a fascinating and rewarding DIY project that combines functionality and style. In this comprehensive guide, we’ll walk you through the process of building a smart mirror using a Raspberry Pi, a 7-inch LCD screen, Google Assistant for voice control, a double-sided mirror, and Qt/QML for advanced user interface customization. By the end of this tutorial, you’ll have a sleek and intelligent device to enhance your daily routine, which can even have potential commercial applications.

The working prototype is available on Youtube at https://youtube.com/shorts/9ALQmXogRoA?feature=share

Table of Contents:

  1. Introduction to Smart Mirrors
  2. Required Components and Tools
  3. Setting Up the Raspberry Pi
  4. Integrating Google Assistant
  5. Setting Up the 7-Inch LCD Screen
  6. Building the Frame and Assembling the Mirror
  7. Qt/QML for Advanced User Interfaces
  8. Exploring Commercial Applications
  9. Additional Customizations and Features
  10. Troubleshooting and Maintenance
  11. Conclusion

1. Introduction to Smart Mirrors

A smart mirror is a two-way mirror integrated with a digital display and other smart features. It allows you to view essential information such as the time, weather, calendar events, and news updates. By integrating voice assistants like Google Assistant and leveraging Qt/QML for polished graphical interfaces, you can also perform tasks using voice commands, such as controlling smart home devices, setting reminders, or checking the news. Additionally, smart mirrors hold potential for commercial use in retail, hospitality, and healthcare settings.

2. Required Components and Tools

Before diving into the build, gather the following components and tools:

Hardware:

  • Raspberry Pi 4 Model B (or similar)
  • MicroSD card (32GB or larger) with an adapter
  • 7-inch LCD screen (HDMI-compatible)
  • Double-sided mirror (two-way acrylic mirror or glass mirror film)
  • Wood or aluminum frame for housing the mirror
  • HDMI cable
  • Power adapter for the Raspberry Pi
  • USB microphone and speakers (if your monitor doesn’t have built-in audio)
  • USB keyboard and mouse (for initial setup)
  • Wi-Fi connectivity
  • Black adhesive or spray paint (to create a clean look)

Tools:

  • Screwdrivers
  • Ruler or measuring tape
  • Glue gun or strong adhesive
  • Cutting tools (for adjusting frame dimensions if needed)

3. Setting Up the Raspberry Pi

Step 1: Install Raspberry Pi OS

  1. Download the Raspberry Pi Imager tool from the official Raspberry Pi website.
  2. Insert the microSD card into your computer and launch the Imager tool.
  3. Select the “Raspberry Pi OS” and flash it onto the microSD card.
  4. Once flashing is complete, insert the microSD card into the Raspberry Pi.

Step 2: Boot the Raspberry Pi

  1. Connect the Raspberry Pi to a monitor, keyboard, and mouse.
  2. Power on the Raspberry Pi and complete the initial setup, including setting up Wi-Fi and enabling SSH for remote access.

Step 3: Install Dependencies

Open a terminal and run the following commands to update the system:

sudo apt update && sudo apt upgrade -y
sudo apt install git npm

4. Integrating Google Assistant

Adding Google Assistant to your smart mirror enhances its interactivity. Follow these steps:

Step 1: Enable Google API and Download Credentials

  1. Visit the Google Cloud Console.
  2. Create a new project and enable the Google Assistant API.
  3. Download the JSON credentials file and save it on your Raspberry Pi.

Step 2: Install Google Assistant SDK

pip install google-assistant-sdk[samples]

Step 3: Authenticate the Assistant

Run the following command to authenticate your account:

google-oauthlib-tool --client-secrets <path-to-credentials.json> --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

Step 4: Test Google Assistant

Run a test command to ensure everything is working:

googlesamples-assistant-hotword

5. Setting Up the 7-Inch LCD Screen

  1. Connect the LCD screen to the Raspberry Pi using the HDMI cable.
  2. Adjust the screen resolution in the Raspberry Pi settings to match the LCD’s native resolution.
  3. Use adhesive or brackets to secure the screen behind the double-sided mirror.

6. Building the Frame and Assembling the Mirror

Step 1: Measure and Cut the Frame

  1. Measure the dimensions of the LCD screen and the double-sided mirror.
  2. Cut the frame material to size, leaving space for the Raspberry Pi and cables.

Step 2: Assemble the Frame

  1. Attach the frame pieces using screws or adhesive.
  2. Paint the frame for a polished look.

Step 3: Install Components

  1. Place the LCD screen behind the double-sided mirror and secure it with adhesive or brackets.
  2. Mount the Raspberry Pi to the back of the frame and route the cables neatly.

7. Qt/QML for Advanced User Interfaces

Qt and QML provide a robust framework for creating highly polished and customizable user interfaces for your smart mirror. Here’s how to integrate it:

Step 1: Install Qt

sudo apt install qt5-default qtcreator

Step 2: Create a QML Application

  1. Open Qt Creator and start a new project.
  2. Use QML to design interactive and visually appealing widgets such as calendars, weather panels, or news tickers.
  3. Compile and run your application to test its functionality.

Step 3: Integrate with Raspberry Pi

Transfer the compiled QML application to your Raspberry Pi and configure it to run on startup alongside Python app as demon or as a standalone interface.

8. Exploring Commercial Applications

Smart mirrors are increasingly popular in commercial settings due to their interactive capabilities. Here are some potential applications:

  • Retail Stores: Use smart mirrors as virtual fitting rooms or promotional displays.
  • Hotels: Provide guests with personalised information and services through interactive mirrors.
  • Healthcare: Implement features for patient check-ins or telemedicine consultations.
  • Gyms: Display workout metrics or instructional videos.

If you aim to commercialize your smart mirror, ensure compliance with relevant regulations and intellectual property laws. Consider using Qt/QML for scalability and professional-grade interfaces.

9. Additional Customizations and Features

  • Motion Sensors: Add a PIR motion sensor to automatically turn the mirror on and off.
  • Smart Home Integration: Use modules to control lights, thermostats, or other IoT devices.
  • Voice Commands: Program additional commands for controlling mirror modules.

10. Troubleshooting and Maintenance

Common Issues:

  • No Display: Check HDMI connections and ensure the Raspberry Pi is powered.
  • Assistant Not Responding: Verify microphone and speaker connections.
  • Modules Not Loading: Double-check config.js for syntax errors.

Maintenance Tips:

  • Regularly update the Raspberry Pi OS and MagicMirror software.
  • Clean the mirror surface with a microfiber cloth.

11. Developing Python app as demon

This Python application (currently under development, we’ll discuss in upcoming story) acts as a daemon to facilitate seamless interaction between QT/QLM (Qt for Linux/Mac) and Google Assistant. Leveraging the capabilities of the Google Assistant API, the daemon listens for voice commands and translates them into actions within the QT/QLM environment. The application runs in the background, continuously monitoring for requests and ensuring real-time communication between the user interface and Google Assistant. By utilizing asynchronous programming and efficient event handling, the daemon provides a responsive and user-friendly experience, allowing users to control their applications hands-free with voice commands.

12. Conclusion

Building a smart mirror is a rewarding project that combines creativity, technology, and practical design. By following this guide, you’ll have a functional and stylish smart mirror to enhance your living space. With the addition of Qt/QML and Google Assistant, your smart mirror can offer advanced user interactions and commercial potential. With endless possibilities for customization, your smart mirror can evolve alongside your needs and preferences.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response