Mood-Light-Lamp
An interactive smart lamp that dynamically adjusts lighting based on touch, motion, and sound inputs, now also remotely controllable via Wi-Fi.
Author: BΔiΘan Raluca-Mihaela
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-RalucaBaitan
Descriptionβ
This project is a mood-responsive RGB lamp powered by a Raspberry Pi Pico W. It uses a Finite State Machine (FSM) to manage and cycle through a set of interactive lighting modes:
- Calm Fade β slow transitions through pastel tones
- Party Pulse β color changes reacting to sound intensity
- Focus Blink β soft white pulsing to aid concentration
- Ambient Wave β moving color gradients triggered by motion
A capacitive touch sensor allows users to cycle between modes, while two tactile buttons toggle the reactivity of sound and motion sensors. The project also supports Wi-Fi control, enabling users to change settings or monitor the current mode from a web interface or mobile device.
Motivationβ
I was inspired to create a light-based project that was not only aesthetic and responsive but also deeply interactive. I wanted a relaxing but smart device that adapts to ambient conditions. Adding Wi-Fi allowed me to elevate it from a basic RGB lamp to a remotely configurable IoT device, aligning with the current trends in smart home environments.
Architectureβ
Components Overviewβ
Raspberry Pi Pico W
- Role: Controls all components, manages state transitions, and hosts the Wi-Fi server.
- Connections: GPIO2 (LEDs), GPIO3 (Touch), GPIO4 (Motion), GPIO5β6 (Buttons), GPIO26 (Sound sensor)
WS2812 LED Strip
- Interface: PIO
- Modes: Calm fade, party pulse (audio-reactive), ambient wave, focus blink
Touch Sensor (TTP223)
- Interface: Digital input
- Role: Cycles FSM states on tap
PIR Motion Sensor
- Interface: Digital
- Role: Triggers effects based on presence
Sound Sensor (KY-038)
- Interface: Analog (ADC)
- Role: Reacts to ambient sound
Tactile Buttons (x2)
- Role: Toggles for sensors
Wi-Fi Web Interface
- Interface: HTTP API
- Role: Remote mode switch & sensor control
Logβ
Week 5 β 11 Mayβ
Basic FSM structure completed, sensors tested, LED test patterns implemented using ws2812-pio-rs
. Mode logic mapped on paper.
Week 12 β 18 Mayβ
Week 19 β 25 Mayβ
Hardwareβ
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico W | Main controller with Wi-Fi | 40 RON |
WS2812 RGB LED Strip (1m) | Dynamic lighting effects | 25 RON |
KY-038 Sound Sensor | Audio input | 6 RON |
PIR Motion Sensor | Motion detection | 9 RON |
TTP223 Touch Sensor | Touch control | 3 RON |
Tactile Push Button x2 | Sensor toggles | 2 RON |
5V USB-C Power Supply | System power | 20 RON |
Breadboard, wires, resistors | Electrical wiring | 10 RON |
Schematicsβ
Softwareβ
Library | Description | Usage |
---|---|---|
embassy-rs | Async executor for embedded Rust | Task scheduling and I/O |
ws2812-pio-rs | WS2812 driver using RP2040 PIO | LED animations |
rp2040-hal | HAL for Raspberry Pi Pico | Access peripherals |
adc-rs | ADC driver | Analog input from sound sensor |
rtic | Real-time interrupt concurrency | FSM + timers |
portable-atomic | Shared-state across tasks | Button toggle logic |
smoltcp | Embedded TCP/IP stack | Web control over Wi-Fi |
tiny-http | Lightweight HTTP server | REST API for remote use |