Skip to main content
Version: FILS English

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.

info

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) and ST:HH:MM:SS (sync time). The STM32 sends telemetry back every 5 seconds in the format T:{temp},AH:{hh},AM:{mm},AE:{0|1},AR:{0|1},CH:{hh},CM:{mm},CS:{ss}.

Architecture Diagram

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.

Hardware overview

Schematics

KiCad Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WWi-Fi network and web server hub39.66 RON
GroundStudio BME280 3V3Temperature and Humidity monitoring (I2C)32.67 RON
DFPlayer Mini MP3 PlayerDecodes and plays MP3 audio files for the alarm13.98 RON
Mini Speaker 3W 8 OhmAudio output for the DFPlayer16.67 RON
MicroSD Card (8GB-32GB)Stores MP3 files for the DFPlayer32 RON
Active Buzzer KY-012Backup audible alarm trigger13.21 RON
1.8" LCD TFT SPI ST7735Digital clock and UI display19.18 RON
WS2812B LED Ring (16 LEDs)RGB LED ring for sunrise simulation35.80 RON
Tactile Buttons 6x6x5mmPhysical inputs for snooze and alarm cancel17.62 RON
Breadboard 830 puncte MB-102Hardware prototyping base21.18 RON
MB102 Breadboard Power SupplyRegulates 3.3V/5V power for the breadboard rails4.69 RON
9V 1A Power AdapterMain wall power source for the breadboard8.99 RON
Dupont Wires (M-M & M-F)Hardware interconnections19.24 RON
Nucleo STM32U545RE-QMain logic and peripheral controller140 RON

Software

LibraryDescriptionUsage
embassy-stm32Hardware abstraction for STM32Used for configuring SPI, I2C, UART, and GPIO (for the tactile buttons) on the Nucleo
embassy-executorAsync task executorRuns all concurrent tasks on STM32
embassy-timeAsync timekeepingTimer::after and with_timeout for delays and I2C scan timeouts
embassy-syncSync primitivesMutex for shared ClockState between all tasks
embedded-graphics2D graphics libraryText and shapes on the ST7735 display
st7735-lcdSPI display driverST7735 initialization and rendering
heaplessFixed-capacity collectionsString<N> for UART message formatting without heap allocation
cortex-mCortex-M architecture utilitiesinterrupt::free for WS2812B bit-bang timing
defmtEfficient embedded loggingReal-time debug output via RTT
defmt-rttRTT transport for defmtSends defmt logs over debug probe
panic-probePanic handlerPrints panic messages via probe
MicroPython networkWi-Fi managementCreates the SunriseAlarm access point on Pico 2W
MicroPython socketTCP socket serverServes the HTTP dashboard on port 80
  1. Embassy Framework Book
  2. STM32U5 Series Reference Manual
  3. BME280 Datasheet
  4. WS2812B Datasheet
  5. MicroPython Documentation
  6. Raspberry Pi Pico 2W Documentation