A multifunction embedded digital clock system developed on the STM32F103 platform, featuring LCD-based real-time display, time regulation, alarm setting, status switching, race clock / stopwatch mode, infrared control, and USART-based PC communication.
This project was completed during my 5th semester Processor Principle internship in the Automation Major, College of Electrical Engineering and Control Science, Nanjing Tech University.
Figure: Hardware implementation, system block diagram, LCD interface examples, simplified circuit overview, IR control example, and USART communication workflow.
This repository presents a practical embedded systems project centered on the design and implementation of a multifunction digital clock using the STM32 microcontroller. The system goes beyond basic time display by integrating multiple interactive and communication-oriented modules into a single hardware-software platform.
The project was designed to strengthen practical understanding of:
- microcontroller programming
- embedded C development
- timer and timing logic
- LCD interfacing
- alarm and state-based control
- infrared communication
- USART serial communication
- hardware-software integration
This work reflects my undergraduate training and growing interest in embedded systems, automation, control, and intelligent hardware-software design.
Sheikh MD Mostasin Ahammed
Major: Automation
College of Electrical Engineering and Control Science
Nanjing Tech University
This project was completed as part of my Processor Principle internship during the 5th semester of my undergraduate study. It represents one of my early hands-on embedded systems implementations involving real hardware, peripheral interfacing, and real-time control logic.
The main objectives of this project were:
- To design and implement a real-time embedded digital clock system using STM32
- To display student information and current time on an LCD
- To provide time regulation functionality for hour, minute, and second
- To support alarm setting and reminder behavior
- To implement multi-mode system switching
- To build a race clock / stopwatch function with millisecond display
- To integrate infrared-based external control
- To enable USART communication with a PC for time regulation
- To gain practical experience in embedded system design and implementation
The LCD interface displays:
- student name
- student ID
- current time in hour : minute : second
- current operating mode
- alarm time
- key-based user instructions
This provides a simple and effective human-machine interface for real-time interaction.
The system supports manual time regulation for:
- hour
- minute
- second
Users can adjust the system time through onboard keys, making the clock flexible and interactive.
The project includes an alarm-setting function for reminder purposes. When the system time matches the preset alarm value, the corresponding alarm behavior is triggered.
The system supports switching between multiple operating states, such as:
- normal clock mode
- time adjustment mode
- alarm setting mode
- race clock / stopwatch mode
- communication-related control modes
This demonstrates structured state-based control in embedded systems.
A race clock function is implemented to support higher-precision timing. This mode can display:
- seconds
- milliseconds
It demonstrates timer-based precision control in an embedded application.
The system supports infrared control functionality. This can be used for:
- remote-style interaction
- triggering simple external control behaviors
- switching lights or similar devices
- basic automation-related applications
This feature extends the project beyond simple clock behavior into interactive control.
The system supports USART communication with a PC. Using serial communication, the user can regulate:
- hour
- minute
- second
This demonstrates PC-to-microcontroller interaction and serial communication design in embedded systems.
| Function | Description |
|---|---|
| LCD Display | Displays name, ID, time, mode, and alarm information |
| Time Regulation | Adjusts hour, minute, and second |
| Alarm Setting | Supports reminder/alarm time configuration |
| Status Switching | Switches between different operating modes |
| Race Clock | Displays seconds and milliseconds |
| IR Control | Supports infrared-based external control |
| USART Communication | Allows PC-based time regulation |
The project was implemented on an STM32-based development platform with the following major components:
- STM32F103RBTx microcontroller
- LCD display module
- onboard key/button interface
- IR-related input/control module
- USART serial communication interface
- alarm/reminder output interface
- supporting peripheral and power circuitry
- STM32CubeIDE
- Embedded C
- STM32 HAL Drivers
- serial terminal / USART communication tools for PC-side testing
Responsible for displaying:
- name
- student ID
- real-time clock value
- current operating mode
- alarm information
Handles the adjustment of hour, minute, and second through user interaction.
Stores alarm values and compares them with current system time.
Controls switching between normal, adjustment, alarm, stopwatch, IR, and USART-related modes.
Implements stopwatch-style timing with millisecond-level display.
Supports infrared-based input and external control functionality.
Supports communication with a PC for time regulation and control-oriented interaction.
The system uses onboard keys for user interaction. A typical key mapping is:
- Key0: select or adjust target parameter
- Key1: increment value
- Key2: decrement value
This creates a compact and practical interface for configuration and control without additional external input hardware.
This project demonstrates practical experience with:
- embedded C programming
- STM32 microcontroller development
- timer configuration and timekeeping logic
- LCD interfacing
- key scanning and user input handling
- alarm/event triggering
- state machine design
- infrared-based control
- USART serial communication
- hardware-software co-design
This project is not limited to being a simple digital clock. It combines several foundational embedded systems concepts into one integrated implementation:
- real-time timing logic
- LCD-based human-machine interaction
- user-driven parameter adjustment
- alarm scheduling
- multi-state system control
- precision timing
- infrared communication
- serial communication with a host PC
For that reason, it represents a compact but meaningful demonstration of undergraduate-level practical capability in embedded systems and automation-oriented engineering.
- Clone this repository:
git clone https://github.com/your-username/Digital-Clock.git
