Skip to content

STM32 embedded system for a smart water dispenser, integrating ultrasonic sensing, motor control, and a real-time wall clock using interrupt-driven firmware (S25)

Notifications You must be signed in to change notification settings

stefantzn/ECE298-Design-Project

Repository files navigation

ECE298-Design-Project

Overview

This project implements a microcontroller-based smart water dispenser prototype using an STM32 MCU. The system integrates multiple sensors, actuators, and timing peripherals to control water dispensing behavior in real time. Development emphasized modular firmware design, peripheral bring-up, and interrupt-driven control.

The project was completed as part of ECE298 (Design Project) and includes individual test modules for each subsystem prior to full system integration.


System Features

  • Ultrasonic water level detection (HC-SR04)
  • Motor and servo-based actuation for dispensing
  • PWM-based control for motors and indicators
  • Real-time wall clock for scheduled operation
  • UART for debugging and system visibility
  • ADC-based sensor testing and validation
  • Modular firmware architecture with isolated test programs

Hardware Platform

  • MCU: STM32F401RE
  • Sensors: Ultrasonic distance sensor (HC-SR04), RPM / speed sensing
  • Actuators: DC motor, servo motor, LEDs
  • Interfaces: ADC, PWM, UART, GPIO
  • Timing: Wall clock / timer-based scheduling

Firmware Modules

Each subsystem was developed and validated independently before integration:

  • ADC_Test – Analog input testing and calibration
  • Blink_Test – GPIO and basic timing validation
  • FinalConfigProject – Integrated system configuration
  • HCSR04_Test – Ultrasonic distance sensing
  • MODE_LED_PB – Mode selection using LEDs and push buttons
  • PWM_Blink_Test – PWM timing verification
  • PWM_BRUSHED_Blink_Test – Brushed DC motor PWM testing
  • RGB_Tests – RGB LED control
  • RPM_Speed_Sensor – Speed / rotation measurement
  • Servo_Test – Servo motor actuation
  • UART_Test – Serial communication and debugging
  • Wall_Clock_Tasks – Timer-driven scheduling and wall clock logic

This modular approach allowed isolated debugging and reliable subsystem bring-up prior to full system integration.


Photo Gallery

Front View

Front View

Side View

Side View

Hardware / Wiring

Hardware


Development Notes

  • Firmware written in C using low-level peripheral drivers
  • Interrupt-driven design used where appropriate for timing accuracy
  • Emphasis on debuggability and incremental integration
  • Each module includes standalone test code for subsystem validation

About

STM32 embedded system for a smart water dispenser, integrating ultrasonic sensing, motor control, and a real-time wall clock using interrupt-driven firmware (S25)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages