Magic Mirror

May 17, 2025

Tools Used:
Raspberry Pi Linux Python

Introduction

This is a project that combines both hardware and software, and it was a really fun experience to work on with my team. The Magic Mirror is basically a smart mirror that can show useful information like the school calendar, the current time, room temperature, news and the weather. What makes it even cooler is that it only lights up when someone is nearby, thanks to a motion sensor. It’s perfect for putting in school hallways so students and teachers can quickly check important info as they walk by.

Building the Frame

We started this project with a focus on sustainability by recycling materials we already had. Our first challenge was creating the frame for the mirror. We found an old wooden chair that was no longer being used and decided to repurpose its wood for our project.

We carefully measured and cut the wood pieces to create a rectangular frame that would perfectly fit our two-way mirror glass. We then painted the wooden frame black.

Display Setup and Hardware Integration

We recycled an old computer monitor and carefully disassembled it to fit behind our two-way mirror glass.

The heart of our system was a Raspberry Pi 4b, which we connected to the recycled display via a HDMI to VGA adapter since the display was so old and didn’t have a HDMI port. Setting up the Pi involved installing the Magic Mirror² software on Linux, which is a system specifically designed for our usecase!

Sensor Integration

To make our mirror truly “smart,” we integrated these two sensors:

DHT22 Temperature and Humidity Sensor: We wired this sensor to the Raspberry Pi’s GPIO pins to provide real-time room temperature and humidity readings. This involved writing Python scripts to read the sensor data and integrate it into the Magic Mirror² interface.

PIR Motion Sensor: The motion detection was handled by a PIR (Passive Infrared) sensor connected to the Pi’s GPIO pins. I programmed it to detect when someone walks by and automatically turn on the display, then turn it off after a set period of inactivity (10 minutes). This energy-saving feature was necessary for a device meant to run continuously in school hallways.

Software Configuration

The software side involved configuring the Magic Mirror² platform and writing custom modules for our specific needs. I set up the system to display:

  • School calendar integration
  • Current time and date
  • Local weather information
  • Real-time temperature and humidity from our DHT sensor
  • Motion-activated display inactivity time countdown

My Role

This project was a team effort, and my role included:

  • Project Manager – I helped organize the team and keep us on track with deadlines and task assignments.
  • Design Blueprint – I created detailed design blueprints showing the frame dimensions, component placement, and wiring diagrams.
  • Software & Hardware Integration – I developed the Python scripts for sensor integration and configured the Magic Mirror² software to work seamlessly with our hardware setup.

Challenges and Solutions

One of the biggest challenges was getting the motion sensor calibrated correctly - we had to adjust the sensitivity so it would detect people walking by but not trigger from distant movement. Another challenge was ensuring the recycled monitor fit properly behind the two-way mirror while maintaining good image quality.

What I Learned

Working on the Magic Mirror taught me a lot about combining hardware and software, the importance of recycling and sustainability in engineering projects, and how important teamwork is for complex builds. The hands-on experience with GPIO programming, sensor integration, and Linux system configuration was invaluable. It was incredibly satisfying to see our recycled materials come together into a functional, interactive device that people could actually use!