DIY Smart Mirror with Voice Control: Materials, Code, and Assembly
Ever walked past a bathroom mirror that greets you with the weather, your calendar, and a cheeky “Good morning, Jordan!”? No? Well, you’re about to change that. A voice‑controlled smart mirror isn’t just a cool gadget; it’s a daily reminder that tech can be both useful and fun, and you can build it yourself without a PhD in electronics.
Why Build a Smart Mirror Now?
The pandemic taught us that home is the new office, and the line between work and leisure spaces is blurrier than ever. A smart mirror turns a mundane routine—like brushing teeth—into a moment of productivity. You get a glance at the forecast, traffic, and even your to‑do list while you’re still half asleep. Plus, building it yourself means you can tinker with the code, swap out components, and brag about it at the next meetup.
What You’ll Need: The Material List
Core Hardware
- Two‑way acrylic or glass (12‑inch to 24‑inch) – This is the reflective surface that lets the display shine through.
- Raspberry Pi 4 (4 GB model) – The brain of the mirror. Its HDMI output drives the screen, and its GPIO pins handle the microphone and speaker.
- HDMI monitor (same size as your acrylic) – Any cheap 1080p screen will do. You’ll mount it behind the two‑way glass.
- USB microphone (e.g., Fifine K668) – For voice commands. A cardioid mic reduces background noise.
- Mini speaker (2‑inch 3‑W) – Small but loud enough for spoken responses.
- Power supply (5 V 3 A for Pi, 12 V 2 A for monitor) – Keep cables tidy with a power strip.
- Frame or mounting brackets – Wood, aluminum, or 3D‑printed clips to hold everything together.
Optional Extras
- LED strip (warm white) – Adds a backlight glow that looks sleek at night.
- IR proximity sensor – Turns the display on when you approach, saving power.
- MicroSD card (32 GB, Class 10) – Holds the OS and your mirror software.
Setting Up the Software Stack
1. Install the OS
Flash Raspberry Pi OS Lite onto the microSD card using Raspberry Pi Imager. Boot the Pi, run sudo raspi-config, enable SSH, and set up Wi‑Fi. I prefer a headless setup—just SSH from my laptop and let the Pi do its thing.
2. Get the MagicMirror² Framework
MagicMirror² is an open‑source platform that handles the UI. In the terminal:
sudo apt update && sudo apt install -y git nodejs npm
git clone https://github.com/MichMich/MagicMirror
cd MagicMirror
npm install
Run npm start to see a basic mirror on your monitor. If you get a black screen, double‑check that the HDMI cable is firmly connected and that the monitor is set to the correct input.
3. Add Voice Control
I use Mycroft AI because it’s lightweight and runs locally. Install it with:
git clone https://github.com/MycroftAI/mycroft-core.git
cd mycroft-core
bash dev_setup.sh
During setup, choose “no” for the optional services you don’t need (like the web UI). Once installed, start the service:
./start-mycroft.sh all
Now you have a listening daemon ready to accept commands.
4. Bridge MagicMirror and Mycroft
Create a simple Node.js module that listens for Mycroft intents and updates MagicMirror modules. Here’s a stripped‑down example:
const io = require('socket.io-client');
const mirror = io('http://localhost:8080'); // MagicMirror socket
// Example intent: "show weather"
mirror.emit('SHOW_MODULE', { module: 'weather' });
Save this as voice-bridge.js and run it with node voice-bridge.js. You can expand the intent list to control calendars, news feeds, or even turn the LED strip on and off.
5. Fine‑Tune the Speech Model
Mycroft ships with a generic English model, but you can train a custom wake word (“mirror”) using the Precise engine. Follow the guide on Mycroft’s docs, record a few dozen samples, and you’ll have a mirror that only wakes up when you say “mirror, show me the news.” It feels like sci‑fi, but it’s just a few minutes of audio work.
Assembling the Physical Mirror
Step 1: Prepare the Two‑Way Glass
Lay the acrylic on a flat surface, screen side down. Clean it with a lint‑free cloth; any smudge will be visible through the mirror. If you’re using glass, wear gloves—sharp edges are no joke.
Step 2: Mount the Monitor
Place the monitor behind the acrylic, aligning the edges. Use double‑sided tape or small brackets to keep it from shifting. Make sure the HDMI cable runs to the back where you can reach the Pi.
Step 3: Install the Raspberry Pi
Secure the Pi to the back of the monitor with zip ties or a 3‑D printed mount. Connect the HDMI, USB mic, speaker, and power. If you added an LED strip, wire it to a MOSFET controlled by a GPIO pin (pin 18 works fine). This lets you toggle the backlight via voice command.
Step 4: Build the Frame
I love a rustic wood frame—simple pine, a few nails, and a coat of matte black paint. Cut the pieces to the mirror’s dimensions, assemble with wood glue, and let it dry overnight. The frame not only looks good; it hides cables and gives the mirror a finished feel.
Step 5: Power Management
Plug the Pi and monitor into a single power strip, then run a short extension cord to the wall. If you’re using a proximity sensor, wire it to a GPIO pin and add a small script that powers the monitor on when motion is detected. This cuts idle power draw by about 30 %.
Testing and Tweaking
Power everything up and watch the MagicMirror UI appear behind the glass. Speak “mirror, what’s the weather?” If Mycroft responds and the weather module updates, you’re golden. If not, check the microphone’s volume (alsamixer) and make sure the Mycroft service is running (ps aux | grep mycroft).
I like to add a small “debug” overlay that shows the last recognized voice command. It’s a simple HTML module that reads a log file written by the voice‑bridge script. Handy when the mic picks up the cat’s meow and thinks you asked for a pizza.
A Few Lessons Learned
- Heat matters: The Pi can get warm behind a sealed frame. Add a tiny heatsink and a passive fan if you notice throttling.
- Cable clutter: Use a cable sleeve to keep everything tidy. A messy back looks like a DIY disaster, even if the front is sleek.
- Software updates: Both MagicMirror and Mycroft release frequent updates. Pin your npm packages to a known good version, or set up a weekly
git pullto stay current without breaking your config.
Wrap‑Up
Building a voice‑controlled smart mirror is a perfect blend of hardware hacking and software tinkering. You end up with a functional piece of art that greets you every morning, reminds you of the day’s agenda, and proves that a little curiosity can turn ordinary glass into a personal command center. Grab the parts, fire up the Pi, and let your bathroom—or hallway—become the smartest room in the house.
- → DIY Warmth: Adding Smart Controls to Your Existing Electric Blanket @cozyelectric
- → DIY Cooling Hacks: Turning a Small Fan into a Personal Air Conditioner @coolbreezegadgets
- → Step-by-Step Guide to Integrating Voice Control with Your Heating @smartclimatehub
- → DIY: Adding Functional Add-Ons to Your Existing Phone Case @casecraze
- → DIY: Adding Voice Control to Your Existing Washing Machine @smartwashinsights