Adaptive Sunrise Alarm & Ambient Monitor
A web-managed, dual-architecture smart clock that features asynchronous timekeeping, environmental sensing and a light-and-sound wake-up sequence.
Author: Stuparu Alessia-Ștefania
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-alessiastuparu
Description
I am implementing an internet-connected alarm that features a dashboard for management, an internal asynchronous software RTC and a hardware interface that handles tactile button inputs while triggering a LED ring, a buzzer, and an MP3 audio module.
The system is split into 2 parts: a Wi-Fi-enabled chip that handles networking and UI, while an ARM-Cortex-M33 manages hardware tasks such as turning on the LED ring, sensors and audio outputs.
Motivation
I chose to do this project because I wanted to build a practical, daily-use tool while learning about cross-architecture communication and asynchronous embedded Rust. By using the RP2350 and STM32U5, I can better grasp the concepts of memory safety, state synchronization and custom protocol design.
Architecture
The system relies on two microcontrollers that work at the same time and communicate via a hardware UART bridge:
- The Raspberry Pi Pico 2W: Represents the networking layer as it hosts a MicroPython HTTP web server to receive user commands via HTTP.
- STM32: Represents the control layer as it manages alarm state, local timekeeping, physical button inputs, and peripheral driving.
- Communication Protocol: To keep the two chips in sync, I am using a plain-text, newline-terminated UART protocol. The Pico 2W sends commands such as
SA:HH:MM(set alarm),SN(snooze),DA(disable) andST:HH:MM:SS(sync time). The STM32 sends telemetry back every 5 seconds in the formatT:{temp},AH:{hh},AM:{mm},AE:{0|1},AR:{0|1},CH:{hh},CM:{mm},CS:{ss}.
Log
Weeks 1-7
- Came up with the idea for the project and did needed research.
- Finished the project proposal and selected hardware components.
- Made final changes to the hardware part and ordered components.
Week 8
- Set up the Cargo workspace for both of the architectures so it handles cross-compiling.
- Designed the behavior of the chips and what each of them handles.
- Created a shared directory library so that specific commands are understood by both chips.
Week 9
- Implemented Pico 2W Wi-Fi connection logic, HTML/JS web server and dashboard.
- Implemented STM32 UART listener, time sync and alarm setting from the dashboard.
- Implemented internal software RTC and alarm state management on STM32.
Week 10
- Implemented bidirectional UART telemetry between STM32 and Pico 2W.
- Added buzzer driver with escalating alarm pattern and physical snooze/cancel buttons with EXTI interrupts.
- Added ST7735 SPI display showing live clock, alarm status and temperature.
- Configured STM32 PLL to 80MHz, added WS2812B LED ring sunrise simulation and full peripheral integration.
- Set up minimal Wi-Fi AP server on Pico 2W.
Week 11
- Switched Pico 2W firmware to MicroPython and implemented plain-text UART protocol.
- Verified full system integration: UART bridge, live dashboard with real BME280 temperature, all peripherals working together.
Hardware
The system uses a Nucleo STM32U545RE-Q as the main controller, a Raspberry Pi Pico 2W for Wi-Fi networking and web hosting, a 1.8" TFT LCD for time and temperature visualization, a BME280 sensor for environmental monitoring, a WS2812B LED ring for sunrise simulation, an active buzzer and a DFPlayer Mini with a 3W speaker for audible alarms and tactile buttons for manual hardware control.

Schematics

Bill of Materials
| Device | Usage | Price |
|---|---|---|
| Raspberry Pi Pico 2W | Wi-Fi network and web server hub | 39.66 RON |
| GroundStudio BME280 3V3 | Temperature and Humidity monitoring (I2C) | 32.67 RON |
| DFPlayer Mini MP3 Player | Decodes and plays MP3 audio files for the alarm | 13.98 RON |
| Mini Speaker 3W 8 Ohm | Audio output for the DFPlayer | 16.67 RON |
| MicroSD Card (8GB-32GB) | Stores MP3 files for the DFPlayer | 32 RON |
| Active Buzzer KY-012 | Backup audible alarm trigger | 13.21 RON |
| 1.8" LCD TFT SPI ST7735 | Digital clock and UI display | 19.18 RON |
| WS2812B LED Ring (16 LEDs) | RGB LED ring for sunrise simulation | 35.80 RON |
| Tactile Buttons 6x6x5mm | Physical inputs for snooze and alarm cancel | 17.62 RON |
| Breadboard 830 puncte MB-102 | Hardware prototyping base | 21.18 RON |
| MB102 Breadboard Power Supply | Regulates 3.3V/5V power for the breadboard rails | 4.69 RON |
| 9V 1A Power Adapter | Main wall power source for the breadboard | 8.99 RON |
| Dupont Wires (M-M & M-F) | Hardware interconnections | 19.24 RON |
| Nucleo STM32U545RE-Q | Main logic and peripheral controller | 140 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-stm32 | Hardware abstraction for STM32 | Used for configuring SPI, I2C, UART, and GPIO (for the tactile buttons) on the Nucleo |
| embassy-executor | Async task executor | Runs all concurrent tasks on STM32 |
| embassy-time | Async timekeeping | Timer::after and with_timeout for delays and I2C scan timeouts |
| embassy-sync | Sync primitives | Mutex for shared ClockState between all tasks |
| embedded-graphics | 2D graphics library | Text and shapes on the ST7735 display |
| st7735-lcd | SPI display driver | ST7735 initialization and rendering |
| heapless | Fixed-capacity collections | String<N> for UART message formatting without heap allocation |
| cortex-m | Cortex-M architecture utilities | interrupt::free for WS2812B bit-bang timing |
| defmt | Efficient embedded logging | Real-time debug output via RTT |
| defmt-rtt | RTT transport for defmt | Sends defmt logs over debug probe |
| panic-probe | Panic handler | Prints panic messages via probe |
| MicroPython network | Wi-Fi management | Creates the SunriseAlarm access point on Pico 2W |
| MicroPython socket | TCP socket server | Serves the HTTP dashboard on port 80 |