A smart mirror is one of the most visually impressive projects in the Raspberry Pi maker community — a regular mirror that displays live information (time, weather, calendar, news, and more) through a two-way glass panel. The MagicMirror² (MM2) open-source platform makes this project accessible even to beginners with basic Linux skills. This guide covers everything from choosing hardware to configuring your first modules and mounting the final build.
Table of Contents
- How a Smart Mirror Works
- Hardware Requirements
- Installing MagicMirror2
- Essential MagicMirror2 Modules
- Display and Screen Configuration
- Two-Way Mirror Glass and Frame
- Autostart and Headless Configuration
- Frequently Asked Questions
How a Smart Mirror Works
The concept is elegantly simple: a monitor is placed behind a sheet of two-way mirror glass (also called spy glass or half-silvered mirror). When the screen behind it is off or dark, the glass reflects normally like a mirror. When the screen displays white or bright content, that content shines through the semi-reflective coating and appears to float on the mirror surface.
MagicMirror2 takes advantage of this by using a dark background (pure black) with white text and widgets. The black areas are absorbed and not visible through the mirror, while the bright widgets appear as if they are part of the mirror itself. The Raspberry Pi runs MagicMirror2 as a fullscreen Electron app using Chromium’s rendering engine.
Hardware Requirements
Here is the complete parts list for a standalone smart mirror build:
Core Electronics
- Raspberry Pi 4 or Pi 5: Any RAM variant works; 2GB is sufficient for MM2 alone
- MicroSD card: 16GB or larger (Class 10 / A1 rated)
- Power supply: Official USB-C power supply (5V/3A for Pi 4, 5V/5A for Pi 5)
- HDMI cable: Micro-HDMI to HDMI (Pi 4/5) to connect to the monitor
Display
Choose a monitor that:
- Has slim bezels (smaller frame = more mirror area)
- Can be rotated to portrait orientation if your mirror is taller than wide
- Has VESA mounting holes for frame attachment
- Is at least 1080p (1920×1080 minimum for readable text)
A 22–32 inch IPS or VA panel gives excellent contrast. OLED is ideal but expensive for this use case.
Mirror and Frame
- Two-way mirror glass or film: Acrylic two-way mirror sheets are cheaper and safer than glass; available in India from Amazon or local plastics suppliers
- Picture frame or custom wood frame: Size to match your monitor exactly
- Standoffs and mounting hardware: To secure the Pi and monitor inside the frame
Installing MagicMirror2
MagicMirror2 requires Node.js. The automated installer handles everything:
Step 1: Prepare Raspberry Pi OS
Flash Raspberry Pi OS (64-bit, Full version with desktop) to your microSD using Raspberry Pi Imager. Enable SSH and configure Wi-Fi during flashing. Boot the Pi and run:
sudo apt update && sudo apt full-upgrade -y
sudo reboot
Step 2: Run the MagicMirror2 Installer
bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"
This script installs Node.js, clones the MM2 repository, installs npm dependencies, and configures autostart. It takes 5–15 minutes depending on your internet speed. Answer yes when asked to start on boot.
Step 3: Verify Installation
cd ~/MagicMirror
npm start
You should see the default MM2 interface with clock, compliments, and a sample calendar. Press Ctrl+Q to exit.
Essential MagicMirror2 Modules
MM2 ships with a set of default modules, and a thriving third-party ecosystem adds hundreds more. Here are the most useful ones for a home smart mirror:
Built-In Modules
- clock: Displays time and date with timezone support
- weather: Current conditions and forecast (OpenWeatherMap API, free tier works)
- calendar: Syncs with Google Calendar, iCal, or any .ics URL
- newsfeed: Scrolling headlines from RSS feeds (BBC, NDTV, The Hindu, etc.)
- compliments: Time-aware motivational messages
Popular Third-Party Modules
- MMM-GoogleTrafficTimes: Live commute times via Google Maps
- MMM-Spotify: Now playing display from Spotify
- MMM-RAIN-MAP: Animated radar rain map
- MMM-PIR-Sensor: Turns display on/off based on a PIR motion sensor
- MMM-Face-Recognition: Personalises the display based on who is standing in front
Install third-party modules by cloning into the modules/ folder:
cd ~/MagicMirror/modules
git clone https://github.com/username/MMM-ModuleName.git
cd MMM-ModuleName && npm install
Display and Screen Configuration
Configure the display rotation and resolution in /boot/firmware/config.txt:
Portrait Mode (for tall mirrors)
# Rotate display 90 degrees (portrait)
display_rotate=1
# For 1080×1920 portrait resolution:
hdmi_group=2
hdmi_mode=87
hdmi_cvt=1080 1920 60 6 0 0 0
Prevent Screen Blanking
Add to ~/.config/lxsession/LXDE-pi/autostart:
@xset s off
@xset -dpms
@xset s noblank
MagicMirror2 Config File
The main configuration lives in ~/MagicMirror/config/config.js. Key settings:
let config = {
address: "localhost",
port: 8080,
basePath: "/",
ipWhitelist: ["127.0.0.1"],
useHttps: false,
language: "en",
locale: "en-IN",
timeFormat: 24,
units: "metric",
// ... modules array
};
For Indian users, set locale: "en-IN" and add timezone: "Asia/Kolkata" inside the clock module config.
Two-Way Mirror Glass and Frame
The physical build is the most time-consuming part. Here are the key decisions:
Acrylic vs Glass Two-Way Mirror
- Acrylic (perspex): Cheaper, lighter, safer, available in standard A4/A3 sheets. Reflectivity is slightly lower than glass (around 70% reflection / 30% transmission). Recommended for first builds.
- Glass two-way mirror: Better optical quality, clearer reflection, available from glaziers or mirror specialists. More expensive and fragile.
- Window film (Gila Mirror Film): Apply to regular glass or acrylic — lowest cost option, acceptable quality for DIY builds
Frame Construction Tips
- Build a shadow box frame: the monitor sits recessed 2–4cm behind the mirror surface to prevent visible light bleed at the edges
- Paint the inside of the frame matte black to eliminate reflections
- Mount the Pi inside the frame using adhesive standoffs or Velcro — keep cables tidy with cable ties
- Add ventilation slots at the top of the frame — monitors generate heat and need airflow
Autostart and Headless Configuration
MagicMirror2 should start automatically on boot and recover from crashes. The installer sets up a pm2 process manager entry, but here is how to verify and control it:
# Check MagicMirror status
pm2 status MagicMirror
# View logs
pm2 logs MagicMirror
# Restart after config changes
pm2 restart MagicMirror
# Enable autostart on boot (run once)
pm2 startup
pm2 save
Remote Management
Install the MMM-Remote-Control module to manage your mirror from a phone or browser:
cd ~/MagicMirror/modules
git clone https://github.com/Jopyth/MMM-Remote-Control.git
cd MMM-Remote-Control && npm install
Then access http://MIRROR_IP:8080/remote.html from any device on your network to toggle modules, send alerts, or reboot the Pi.
For motion-activated display sleep, connect a PIR sensor to GPIO pin 22 and use the MMM-PIR-Sensor module. The display will wake when you walk in front of the mirror and sleep after 60 seconds of inactivity, reducing power consumption significantly.
Get Your Raspberry Pi for the Smart Mirror Project at Zbotic.in
Frequently Asked Questions
What size monitor should I use for a smart mirror?
The most common sizes are 24-inch (portrait: 38×68cm visible area) and 27-inch (portrait: 44×78cm). Match the monitor size to your two-way glass sheet — order the acrylic or glass to match the monitor’s active screen area, not the outer dimensions. Leave a 2cm overlap on all sides to mount into the frame without visible gaps.
Does MagicMirror2 work with a Raspberry Pi Zero?
MagicMirror2 in server mode (no local display) runs on Pi Zero. For the full local display (Electron app), the Pi Zero’s single Cortex-A53 core at 1GHz is very slow — loading the interface takes 2–3 minutes and animations stutter. The Pi 4 or Pi 5 is strongly recommended for a smooth experience.
Can I use a touchscreen instead of a regular monitor?
Yes — a touchscreen works well if you use a glass or acrylic sheet thin enough to preserve touch sensitivity. Capacitive touchscreens lose accuracy through thick acrylic. A 4mm or thinner acrylic panel works; 6mm+ degrades touch response. Alternatively, mount the touch panel behind the mirror glass and use it as a control surface for swipe gestures.
How much does a DIY Raspberry Pi smart mirror cost?
A rough breakdown for an Indian build: Raspberry Pi 5 (2GB) ~₹4,500, used 24-inch monitor ₹5,000–8,000, two-way acrylic sheet ₹800–1,500, frame materials ₹500–1,000, miscellaneous cables and hardware ₹500. Total: approximately ₹11,000–15,000. Commercial smart mirrors sell for ₹30,000–80,000, making the DIY route exceptional value.
Can I add a camera to the smart mirror for face recognition?
Yes — this is a popular enhancement. Mount a camera module behind a small hole in the two-way mirror glass. The camera sees through the mirror from behind (since the glass is semi-transparent in both directions). Use the MMM-Face-Recognition module with OpenCV to detect faces and personalise displayed content per user.
Add comment