Music-Responsive Smart Lighting System
Author: Daria-Maria Ion
GitHub Project Link: link_to_github
Description
This project is an interactive lighting system built around a disco globe, designed to synchronize both light and motion with music. It utilizes a KY-037 sound sensor to capture audio intensity, two MG996R servo motors for movement effects, and RGB LEDs for vibrant lighting. All components are controlled by a Raspberry Pi Pico W running Rust code.
Motivation
I chose this project to bring together my interests in music, visual design, and embedded systems. It’s a hands-on way to explore real-time signal processing, PWM-based control, and servo motor coordination, while creating a visually engaging and technically rewarding result.
Architecture
The project is structured around the following architecture components:
- Audio Input Module (Sound Sensor KY-037): Captures environmental audio levels and sends the analog output to the Raspberry Pi Pico W.
- Microcontroller (Raspberry Pi Pico W): Acts as the central processing unit. It reads the analog signal from the sensor, analyzes the sound intensity, and sends appropriate PWM signals to the servo motors and LED strip.
- Motion Module (2x MG996R Servos): Receives PWM signals from the Pico to control rotation or vibration based on audio dynamics.
- Lighting Module (RGB LEDs): A WS2812 that displays effects driven by the audio signal.
- Power Distribution: A shared 5V power source, with decoupling components like a 470Ω resistor and a 1000µF capacitor for LED stability.
Connections:
- KY-037 → Analog pin on Pico
- Servos → GPIO2 and GPIO3
- LED Strip → GPIO4 via a 470Ω resistor + capacitor for power smoothing
- All components share a common ground and 5V line from the Pico's VBUS pin
Log
Week 5 - 11 May
Connecting the hardware components
Week 12 - 18 May
Week 19 - 25 May
Hardware
The project uses the following hardware:
- Raspberry Pi Pico W as the main controller
- KY-037 sound sensor for audio detection
- Two MG996R servo motors for motion effects
- RGB LED connector for visual lighting
- Power smoothing components: 470Ω resistor and 1000µF capacitor
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | Main microcontroller | ~39 RON |
KY-037 Sound Sensor | Detects sound intensity | ~5 RON |
MG996R Servo Motor | Rotation / motion effect | ~30 RON x2 |
WS2812B RGB LED Strip | Visual LED effects | ~2.5 RON/LED |
Rezistor 330Ω | Data line protection for LED | ~2.62 RON |
Condensator 1000μF / 6.3V | Voltage stabilization for LED | ~3.5 RON |
Fire jumper (M-M) | Wiring connections | ~7 RON |
Breadboard | Rapid prototyping | ~10 RON |
Software
Library | Description | Usage |
---|---|---|
rp-hal | Hardware Abstraction Layer for Pico | Base control of GPIOs, ADC, and PWM |
embedded-hal | Hardware abstraction traits | Interfaces with servos and LEDs |
ws2812-pio | LED driver using PIO | Control WS2812 LEDs |
rustfft | Fast Fourier Transform in Rust | For future implementation of beat detection |
defmt + probe-rs | Debugging tools | Debugging embedded Rust code easily |
Links
...