Build your own Touchscreen Smart Mirror with face recognition. You can even control Spotify & Smart Home Appliances.
The term Smart Mirrors could easily be dismissed as a Science Fiction fantasy. I mean, the idea of Magic Mirrors that displays useful information to the user does sound quite far-fetched.
But what if I told you that we could make a Touchscreen Smart Mirror that could do precisely that and more. Imagine a Smart mirror that could work as a central touchscreen interface for your home to control smart home appliances, provide the latest news, stocks, and features Face recognition.
Well, this is possible! In this article, you’re going to find out how. This project aims to build a touch screen smart mirror that is built on the back of the MagicMirror platform. We like to call this Smart Mirror AI (SMAI).
Watch Full Youtube Tutorial on How to build a Touchscreen Smart Mirror.
Goal: By the end of this article, you’ll be able to build a Touchscreen Smart Mirror with a face recognition module to interact with.
This guide provides you a good overview of how to build one. If you want more details on the Smart Mirror AI, visit our blog Smartbuilds.io. You could even download the Raspbian Face Recognition Image from there.
Now we got that all out the way, let’s begin!
Pre-requisite: Raspberry Pi 4 (RAM 2GB+) Recommended:
Cost: The total cost would vary based on your own specification preference. Fortunately, Smart Mirror could be scaled down, and customized to your liking from small 7″ Touchscreen displays to 55″ large IR Frames. In this example, we’ll use a 32″ IR Frame.
Hardware Assembly Smart Mirror Touchscreen – Hardware Configuration
The custom-cut two way-mirror was placed directly on top of the 32″ Monitor. In addition, the IR frame was used in order to add a touch interaction with the smart mirror. The IR frame uses a USB 3.0 peripheral to connect to the Raspberry Pi. Some IR frames also support multi-touch gestures on different Operating Systems, e.g., Windows and Mac; this makes it useful for future projects.
How IR Frame works
IR frames are based on light-beam interruption. Typically IR frames have LEDs on one side of the frame and Light detectors on the opposite side. Similar to an optical mouse USB peripheral, based on where you touch the frame, a beam interruption occurs, and the IR sensor is able to co-ordinate where you’ve touched. This information is relayed back to your Raspberry Pi corresponding to your display.
A wooden frame was built In order to encase the 32 inch Monitor. (However, your build can be left to your creativity). This was assembled using 1×4 Fiberwood from your local DIY store, and a hacksaw to cut the dimensions. Strong PVA (Gorilla) glue and nails were used to re-enforce the frame. The final mirror dimensions were W 47.6cm x L 77cm x H 7cm. A monitor strap/ back support was added to secure the support of the frame. An opening on the strap was made to allow space for HDMI ports on the Monitor for the Raspberry Pi display input. An Interior varnish coat was added to the frame to give it a nice glossy finish.
Smart Mirror – LED Strips Assembly
LED strips were added to give the mirror a nice ambient glow. The strips included an adhesive coat to the back, which allowed us to peel and wrap the strips around the Monitor.
The LED strips also include a remote for changing LED colors.
Looking from hindsight – We recommend a monitor with HDMI ports on the side of the Monitor
Installing Raspbian Buster Etching Raspbian OS to MicroSD
The Raspbian OS was flashed onto the 32 GB Micro SD Card. You could find more information on how to install the latest Raspbian OS on the Raspberry Pi site. The YouTube tutorial equivalent also outlines this.
- Download and install The latest Raspbian OS which can be found on Raspberry Pi
- Download Etcher and install the application on your computer. (Compatible with Mac OS X and Windows)
- Plug your Micro SD card Adapter with your SD card to the computer.
- Open Balena Etcher and select extracted the image you’ve downloaded.
- Ensure the correct disk has been selected click “Flash!” to begin writing the image to your SD Card. Note: This process could take 10-15 minutes.
- Remove SD Card and plug in Pi. Whereby you could access Pi via VNC or Mouse and Keyboard
Installing Magic Mirror MagicMirror Installation on Raspberry Pi 4
MagicMirror is an open-source modular smart mirror platform developed by MichMich. It’s has a great community and support, which makes this a solid project.
Upon boot-up of the Raspberry Pi, complete the remaining setup, and ensure you’re connected to the internet via LAN/Wi-Fi.
Head off to Magic Mirror for the full Installation & Usage Guide. For simplicity the main snippet has been quoted below:
Run the following commands in terminal
Note: The official support way of installation has been updated from single line command to manual installation. Fortunately, this is just as straightforward.
Terminal – Adding MagicMirror Modules
Download and install the latest Node.js version:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt install -y nodejs
Clone the repository and check out the master branch:
git clone https://github.com/MichMich/MagicMirror
Enter the repository:
Install the application:
Make a copy of the config.js sample file:
cp config/config.js.sample config/config.js
Start the application (Recommended for this setup):
npm run start
For Server Only use:
npm run server
Note: You could decrease the MagicMirror size of the font with CTRL + –
Auto Starting Magic Mirror – Installing PM2
Note: If you would like to have your MagicMirror working from start-up, we recommend installing PM2 a production process manager. You could do this by following the steps outlined on Auto Starting Magic Mirror.
Adding additional Modules Smart Mirror Modules – Including Spotify, Face Recognition and SmartTouch.