ULTRASONIC PARKING ASSIST SYSTEM
The objective of this project is to create a simple parking assistance system using an ultrasonic sensor, OLED display, and buzzer. The system measures the distance between the vehicle and an obstacle and provides visual and audio warnings when the vehicle gets closer to the obstacle.
Downloads
Supplies
Deshbot
Arduino Nano
HC-SR04 Ultrasonic Sensor
0.96-inch OLED Display (128×64, I2C)
Buzzer
Pin Connections
ComponentArduino Pin
Ultrasonic TRIG - A0
Ultrasonic ECHO - D13
Buzzer - D11
OLED SDA - A4
OLED SCL - A5
OLED VCC - 5V
OLED GND - GND
Working Principle
The ultrasonic sensor sends a short ultrasonic pulse through the TRIG pin. When the pulse hits an obstacle, it reflects back to the sensor.
The Arduino measures the time taken for the echo to return through the ECHO pin and calculates the distance using:
Distance = Time × Speed of Sound ÷ 2
The measured distance is displayed on the OLED screen.
The system also changes the buzzer sound according to the distance from the obstacle.
Distance Warning Levels
DistanceDisplay StatusBuzzer
More than 40 cm
SAFE
OFF
21–40 cm
CAUTION
Slow beep
11–20 cm
VERY CLOSE
Faster beep
0–10 cm
!!! STOP !!!
Continuous tone
Program Operation
- The Arduino initializes the ultrasonic sensor, buzzer, OLED display, and Serial Monitor.
- The OLED first displays "PARKING ASSIST".
- The ultrasonic sensor sends a pulse.
- The Arduino measures the returning echo.
- The distance is calculated in centimeters.
- The distance is displayed on the OLED.
- The system checks the distance against the warning levels.
- The buzzer produces different sounds depending on how close the obstacle is.
- The process continuously repeats.
Conclusion
The Ultrasonic Parking Assist System demonstrates how an Arduino can measure the distance to an obstacle and provide both visual and audio warnings. The OLED displays the measured distance and parking status, while the buzzer gives increasingly urgent warnings as the obstacle gets closer. This project can be further expanded into a complete smart parking or vehicle safety system.