Skip to main content
Version: ACS CC

Smart Mirror

info

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

block

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.

Hardware Hardware Hardware Hardware

Schematics

kicad

Bill of Materials

DeviceUsagePrice
ESP32 DevKitMicrocontroller (control central, PWM, Bluetooth)35 RON
TPA3116D2 AmplifierAmplifies audio signal from Bluetooth module to speakers53 RON
2x Speakers (60W, 4Ω)Playback audio60 RON
LED Strip 2835 12VMirror lighting37 RON
LM2596 Step-down ConverterConverts 12V to 5V for ESP32 and accessories13 RON
12V 5A Power AdapterPowers the whole system32 RON
IR Remote + ReceiverUser control for light via remote11 RON
MOSFET IRFZ44NControls LED strip brightness using PWM5 RON
2x Breadboard + Jumper WiresCircuit prototyping and testing44 RON
OglindaReflective surface & physical housing for the system35 RON
Modul MH-M28Receives Bluetooth audio and sends analog signal to amplifier13 RON

Software

LibraryDescriptionUsage
esp-idf-halHardware interface for ESP32This is used for controlling GPIOs, PWM, and other peripherals on the ESP32.
embedded-halEmbedded abstraction layerThis is used to provide a standard interface for embedded hardware components.
infraredDecode IR remote inputThis is used to decode signals from the IR remote control.
smart-ledsLED strip controlThis is used to manage the brightness of the LED strip.
heaplessData structures without heapThis is used to manage data without dynamic memory allocation.
esp-idf-svcBluetooth A2DP profile supportThis is used to handle Bluetooth audio streaming and other services.
panic-haltPanic handlerThis is used to halt the system in case of a panic, useful for debugging.