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.
- 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
- 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
Each subsystem was developed and validated independently before integration:
ADC_Test– Analog input testing and calibrationBlink_Test– GPIO and basic timing validationFinalConfigProject– Integrated system configurationHCSR04_Test– Ultrasonic distance sensingMODE_LED_PB– Mode selection using LEDs and push buttonsPWM_Blink_Test– PWM timing verificationPWM_BRUSHED_Blink_Test– Brushed DC motor PWM testingRGB_Tests– RGB LED controlRPM_Speed_Sensor– Speed / rotation measurementServo_Test– Servo motor actuationUART_Test– Serial communication and debuggingWall_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.
- 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


