Skip to content

CerenSultanCETIN/STM32-Smart-Wiper-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Vehicle Control & Environmental Monitoring System

Developed with STM32 Nucleo-F401RE

image

📌 Project Overview

This project is an advanced automotive control simulation built on the STM32F401RE microcontroller. It integrates multiple sensors to automate windshield wipers and vehicle lighting while providing real-time environmental telemetry. The system balances autonomous sensor-driven logic with high-priority manual user overrides.


🚀 Key Functional Modules

1. Adaptive Wiper System (Servo Control)

The system simulates a smart windshield wiper using a Servo Motor controlled via PWM.

  • Automatic Mode: Uses a water sensor (ADC) to detect rain intensity. If the value falls between 1900 - 3000, the wipers activate at Level 1 (Slow).
  • Manual Override: An external push-button managed by External Interrupts (EXTI) and a State Machine allows the user to cycle through modes:
    • Press 1: Level 1 (Slow Speed).
    • Press 2: Level 2 (High Speed).
    • Press 3: Stop/Off.
  • Logic Priority: Manual button commands take precedence over autonomous sensor readings to ensure driver control.

2. Intelligent Lighting System (RGB LED)

Simulates automatic headlights using dual LDR (Photoresistor) sensors for increased accuracy.

  • Differential Sensing: The system calculates the average of two LDR inputs via ADC to filter out noise or localized shadows.
  • Threshold Trigger: If the average light intensity drops below 1900 (indicating darkness), the RGB LED illuminates in a "Plasma" color (Green + Blue). It automatically turns off when ambient light increases.

3. Environmental Telemetry & UI

Real-time data is processed and displayed on a 20x4 Character LCD:

  • DHT11 Sensor: Captures Temperature and Humidity via a custom single-wire protocol implementation.
  • ADC Monitoring: Displays live Water Level and Light Intensity values.
  • LCD Management: Contrast is adjustable via a potentiometer. The display is refreshed every 500ms using non-blocking timers (HAL_GetTick) to ensure system responsiveness.

🛠️ Technical Stack & Implementation Details

Peripherals & Protocols

  • ADC (Analog-to-Digital Converter): Multi-channel configuration used to read LDRs and Water sensors. Implemented a dynamic ADC_Read_Channel function for efficient switching.
  • PWM (Pulse Width Modulation): Generated via TIM1 at 50Hz to precisely control the Servo motor angle (0° to 180°).
  • Timers (TIM2): Configured for microsecond-level precision (delay_us) required for DHT11 and LCD timing.
  • EXTI (External Interrupt): Used for the control button to ensure immediate response to user input.
  • GPIO Bit-Banging: Custom drivers developed for 4-bit LCD communication and DHT11 handshake protocol.

Hardware Components

  • Nucleo-F401RE Development Board
  • 20x4 LCD Display
  • SG90 Servo Motor
  • DHT11 Temperature & Humidity Sensor
  • Water Level Sensor
  • 2x LDR (Photoresistors)
  • RGB LED & Push Button
  • Potentiometer (for LCD contrast)

📂 Project Structure

  • Core/Src/main.c: Core application logic, peripheral initialization, and sensor drivers.
  • Core/Inc/main.h: Pin mapping, macro definitions, and function prototypes.
  • water_sensitive_car_wiper.ioc: STM32CubeMX configuration file.

👨‍💻 Author

Ceren Sultan Çetin

  • Software Engineering Student @ Ostim Technical University
  • Embedded Software Intern in the Defense Industry
  • Board Member of the OSTIMTECH Software Club

About

STM32 Nucleo-F401RE based smart car wiper and lighting system simulation. Features automatic/manual modes using water sensors, LDRs, and DHT11. Developed with ADC, PWM, and EXTI peripherals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages