Skip to main content
Version: FILS English

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.

info

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​

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​

DeviceUsagePrice
Raspberry Pi Pico WMain controller with Wi-Fi40 RON
WS2812 RGB LED Strip (1m)Dynamic lighting effects25 RON
KY-038 Sound SensorAudio input6 RON
PIR Motion SensorMotion detection9 RON
TTP223 Touch SensorTouch control3 RON
Tactile Push Button x2Sensor toggles2 RON
5V USB-C Power SupplySystem power20 RON
Breadboard, wires, resistorsElectrical wiring10 RON

Schematics​

Software​

LibraryDescriptionUsage
embassy-rsAsync executor for embedded RustTask scheduling and I/O
ws2812-pio-rsWS2812 driver using RP2040 PIOLED animations
rp2040-halHAL for Raspberry Pi PicoAccess peripherals
adc-rsADC driverAnalog input from sound sensor
rticReal-time interrupt concurrencyFSM + timers
portable-atomicShared-state across tasksButton toggle logic
smoltcpEmbedded TCP/IP stackWeb control over Wi-Fi
tiny-httpLightweight HTTP serverREST API for remote use