Skip to main content
Version: ACS CC

Smart Parking Sensor

An embedded parking assistance system that measures the distance to nearby obstacles and provides real-time visual and audio feedback.

info

Description

This project implements a smart parking sensor using an STM32 development board and an ultrasonic distance sensor. The system periodically measures the distance between the sensor and a nearby obstacle. Based on this distance, the microcontroller controls multiple LEDs and a buzzer to warn the user. As the obstacle gets closer, the warning level increases through different LED states and faster or continuous buzzer signals.


Motivation

Parking in tight spaces can be difficult without a clear estimation of the distance to obstacles. Modern cars often use parking sensors to help the driver avoid collisions. This project recreates a simplified version of such a system and provides a practical way to work with sensors, GPIO control, timing, distance computation, and real-time embedded feedback.


Architecture

Architecture

The system is built around the STM32 microcontroller, which coordinates all modules.

  • Input: ultrasonic sensor used for distance measurement
  • Processing: STM32 microcontroller computes distance and decides the warning level
  • Output: LEDs and buzzer provide visual and audio feedback

The ultrasonic sensor is triggered by the microcontroller. The echo response is measured using timing logic, then converted into distance. Depending on the result, the system selects one of several warning states: safe, attention, close, or stop.


Hardware

The hardware part of the project consists of an STM32 development board connected to an ultrasonic distance sensor, several LEDs, and a buzzer. The LEDs indicate the warning level visually, while the buzzer provides audio feedback. The system will be assembled on a breadboard using jumper wires and current-limiting resistors for the LEDs.


Bill of Materials

DeviceUsageEstimated Price
STM32 development boardMain microcontrollerProvided
HC-SR04 ultrasonic sensorDistance measurement~10 RON
Green LEDSafe distance indicator~1 RON
Yellow LEDMedium distance indicator~1 RON
Red LEDClose obstacle indicator~1 RON
Active buzzerAudio warning signal~5 RON
Resistors 220Ω / 330ΩLED current limiting~3 RON
BreadboardCircuit prototyping~10 RON
Jumper wiresElectrical connections~5 RON
USB cableProgramming and powerAlready available

Optional components, if time allows:

DeviceUsageEstimated Price
LCD 16x2 with I2C moduleDisplay exact distance~20 RON
PotentiometerAdjustable sensitivity threshold~5 RON

Software

The software periodically sends a trigger pulse to the ultrasonic sensor and measures the duration of the echo signal. This duration is converted into distance. The measured distance is then compared with predefined thresholds.

Possible states:

  • Safe: obstacle is far away, green LED active, buzzer off
  • Attention: obstacle is at medium distance, yellow LED active, slow buzzer beeps
  • Close: obstacle is near, red LED active, fast buzzer beeps
  • Stop: obstacle is very close, red LED active, continuous buzzer signal

The implementation will use GPIO pins for LEDs and buzzer control, and timing mechanisms for measuring the ultrasonic echo signal.


Log

Week 1

  • Project idea selected and approved
  • Initial documentation created
  • Basic architecture and component list defined

Future Improvements

  • Add LCD display for showing the measured distance
  • Add filtering to reduce unstable sensor readings
  • Add adjustable thresholds using a potentiometer
  • Design a small enclosure for a cleaner final prototype
  • Add serial logging for debugging and testing