Smart Mirror
Author: Patricia-Elena Crăciun
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-patriciacraciun
Description
The idea of the project is to build a smart mirror that can play music over Bluetooth and has LED lighting with adjustable brightness. The mirror can be controlled using an IR remote. All functionality is implemented on an ESP32 board, programmed entirely in Rust.
In audio-reactive mode, the LED brightness changes in real-time, pulsing to the rhythm of the music
Motivation
I chose this project because I've always wanted a smart mirror, especially because I'm really passionate about makeup. Having good lighting and music while getting ready is something I’ve always wanted. This project lets me combine something I’d actually use every day with the skills I learned this semester.
Architecture
Main components:
- User – interacts using an IR remote or a phone (Bluetooth)
- IR Receiver – sends commands to the ESP32
- ESP32 – controls the whole system (LED brightness, Bluetooth, audio)
- LED Strip – controlled via PWM from ESP32
- Bluetooth Audio – receives audio from phone
- Amplifier – amplifies signal for the speakers
- Speakers – play the music
- Sound Sensor – captures sound for audio-reactive mode
- Power Supply – powers everything with 12V and a step-down to 5V for ESP32
Log
Week 5 – 11 May
- Researched and selected all hardware components
- Created the full architecture plan
- Ordered modules (ESP32, IR kit, LED strip, amplifier, etc.)
- Tested each component separately on breadboard
Week 12 – 18 May
- Connected all hardware on breadboard (ESP32, IR, MH-M28, amplifier, LED)
- Built the PWM LED control circuit using MOSFET and resistors (220Ω and 22kΩ)
- Completed all GND and 5V routing using WAGO connectors
- Designed complete KiCad schematic
Week 19 – 25 May
- Implemented the full software logic in Rust:
- Added button state machine with multiple brightness levels (25%, 50%, 75%, 100%)
- Integrated audio-reactive mode: LED brightness changes based on sound amplitude
- Integrated Bluetooth audio streaming using MH-M28 module and TPA3116D2 amplifier
- Tested entire system: LED brightness adjustment + music playback + LED pulse on sound
Hardware
The Smart Mirror is built around an ESP32 microcontroller, which handles the LED brightness (via PWM), IR remote input, and Bluetooth audio control. A 12V LED strip provides ambient lighting, switched using a MOSFET controlled by the ESP32. A 220Ω resistor limits current to the gate, and a 22kΩ pull-down keeps the gate low when inactive.
Bluetooth audio is received by the MH-M28 module and passed to a TPA3116D2 amplifier, powering two 60W speakers. The whole system is powered by a 12V/5A adapter, and a LM2596 converter supplies 5V for components like the ESP32 and IR receiver. Power lines are split cleanly using WAGO connectors, and everything is prototyped on a breadboard.
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
ESP32 DevKit | Microcontroller (control central, PWM, Bluetooth) | 35 RON |
TPA3116D2 Amplifier | Amplifies audio signal from Bluetooth module to speakers | 53 RON |
2x Speakers (60W, 4Ω) | Playback audio | 60 RON |
LED Strip 2835 12V | Mirror lighting | 37 RON |
LM2596 Step-down Converter | Converts 12V to 5V for ESP32 and accessories | 13 RON |
12V 5A Power Adapter | Powers the whole system | 32 RON |
IR Remote + Receiver | User control for light via remote | 11 RON |
MOSFET IRFZ44N | Controls LED strip brightness using PWM | 5 RON |
2x Breadboard + Jumper Wires | Circuit prototyping and testing | 44 RON |
Oglinda | Reflective surface & physical housing for the system | 35 RON |
Modul MH-M28 | Receives Bluetooth audio and sends analog signal to amplifier | 13 RON |
Software
Library | Description | Usage |
---|---|---|
esp-idf-hal | Hardware interface for ESP32 | This is used for controlling GPIOs, PWM, and other peripherals on the ESP32. |
embedded-hal | Embedded abstraction layer | This is used to provide a standard interface for embedded hardware components. |
infrared | Decode IR remote input | This is used to decode signals from the IR remote control. |
smart-leds | LED strip control | This is used to manage the brightness of the LED strip. |
heapless | Data structures without heap | This is used to manage data without dynamic memory allocation. |
esp-idf-svc | Bluetooth A2DP profile support | This is used to handle Bluetooth audio streaming and other services. |
panic-halt | Panic handler | This is used to halt the system in case of a panic, useful for debugging. |