Skip to main content
Version: FILS English

Digital Cuckoo Clock

A smart digital clock with alarm, environmental monitoring and multimedia features

info

Author: Burlacu Alesia Ana-Maria
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-Ale-cutie

Description

My project is a standalone smart digital clock built on an STM32 microcontroller. The device displays the current time on a touchscreen and allows the user to set alarms. When triggered, the alarm can play sound and activate a cuckoo-style mechanical system. It also monitors temperature and air quality, showing this information on the display and sending notifications to the user’s phone when values go outside a comfortable range. Moreover, the device can play music from a phone via Bluetooth, receive FM radio and play audio from an SD card, as well as recording radio channels to it. The volume can be adjusted using a rotary knob, and a light sensor enables automatic night mode.

Motivation

I wanted to make something both useful and creative, so my first instinct was to look around in my room. What caught my eye was the digital clock from my bedside with alarms and connection to the radio, which gave me even more ideas for things I can add to make this project outstanding. For the creative aspect, after searching the Internet for designs of old clocks, I came acorss a picture of a beautiful cuckoo clock that inspired the final iteration of my idea.

Architecture

The system is structured into several main components: the central control unit, the sensing subsystem, the communication module, the multimedia subsystem, and the actuation system. The central control unit, based on the STM32 microcontroller, coordinates all operations and manages communication between subsystems.

The sensing subsystem includes the temperature, air quality, and light sensors, which provide real-time environmental data to the STM32. This data is used both for display purposes and for triggering notifications when predefined thresholds are exceeded.

The communication module, implemented using the ESP8266, handles WiFi connectivity. It sends notifications to the user’s phone when events occur, such as abnormal temperature or poor air quality. Communication between the STM32 and the ESP8266 is done through a UART interface.

The multimedia subsystem includes the display, audio sources, and storage. The TFT touchscreen display communicates with the STM32 via SPI, while the SD card shares the same SPI bus. The FM radio module communicates via I2C. Audio playback is handled by external modules (Bluetooth receiver, amplifier), which receive analog signals and output sound to the speakers.

The actuation system includes the servo motor used for the cuckoo mechanism and brightness control via PWM signals. The STM32 generates control signals using timers.

All components are powered by a 5V USB power supply, with voltage stabilization ensured by capacitors. The STM32 interfaces with peripherals using SPI, I2C, UART, ADC, and PWM depending on the device.

Architecture

Log

Weeks 4 - 5

I began brainstorming ideas. After several eliminations, I was still left with two project ideas I sent the lab teacher for feedback. The idea I eventually went with would have initially included a simple alarm system, night mode for the display, speakers and radio FM connection.

Week 6

After the feedback received, I chose my final idea, to which I added more features: the SD card implementation with the possibility of recording FM channels to it, the addition of the sensors and the cuckoo bird mechanism. I also began researching for hardware components.

Weeks 7 - 8

I continued my research for hardware components, eventually making the final order of my parts.

Hardware

The system is centered around an STM32 NUCLEO-U545RE-Q microcontroller. For user interaction, a 2.8” TFT touchscreen display (ILI9341) is used, communicating via SPI. Environmental data is collected using a DHT11 temperature and humidity sensor, an air quality sensor, and a light sensor, connected through digital and analog inputs.

Wireless communication is handled by an ESP8266 WiFi module, connected via UART. The multimedia system includes a Bluetooth audio receiver, a PAM8403 audio amplifier, and two 3W speakers for stereo output. Audio sources such as the FM radio module and SD card share communication through SPI where needed. A 10kΩ potentiometer is used for manual volume control.

The mechanical cuckoo system is driven by a servo motor controlled through PWM. The device is powered by a 5V USB power supply, with additional capacitors used for voltage stabilization. The circuit is first developed on a breadboard for prototyping and then assembled on a perfboard for a more compact and permanent design.

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Nucleo U545RE-QThe microcontroller127 RON
LCD Display 2.8" ILI9341User interface screen55 RON
2x Speakers 40mm 3WThe speakers15 RON
PAM8403Amplification module5.28 RON
APDS-9930Light sensor9.91 RON
MQ-135Air quality sensor14.94 RON
ESP8266Wi-Fi Module21.05 RON
A2DPBluetooth audio module19.68 RON
RDA5807M RRD-102V2.0FM radio module8.63 RON
RK097N 10K 6mmPotentiometer3.03 RON
1000 uF 50 V CapacitorCapacitor for the servomotor1.49 RON
Kit Plusivo Pi 4 Super StarterKit including a temperature and humidity sensor, servomotor, buttons, power supply and others54 RON

Software

LibraryDescriptionUsage
ili9341Display driver for ILI9341Used for the display
embedded-graphics2D graphics libraryUsed for drawing to the display
embassy-executorAsync task executor for embedded systemsRuns concurrent tasks like sensor reading and communication
embassy-timeTime management utilitiesHandles delays, timers, scheduling
embassy-stm32HAL for STM32 microcontrollersInterfaces with GPIO, SPI, I2C, UART, PWM
embedded-halHardware abstraction traitsStandard interface for drivers
defmtLogging framework for resource-constrained devicesDebug & Logging
embedded-sdmmc2SD card filesystem libraryReads files from SD card
dht-sensorDHT11/DHT22 sensor driverReads temperature and humidity
esp8266-atESP8266 communication supportHandles WiFi via UART
rda5807mFM radio driverControls radio module via I2C
panic-probeDebugging and panic handlerHelps with runtime error debugging
  1. Embassy - async embedded Rust framework
  2. STM32 32-bit Arm Cortex MCUs - Documentation