Meta Description: Learn how to build an ultrasonic reverse parking sensor using Arduino, HC-SR04 sensor, buzzer and LCD. Follow the circuit connections, programming code and step-by-step construction guide.
1. Introduction
Parking a vehicle in a limited space can be challenging, particularly when reversing towards walls, other vehicles or obstacles. Drivers may sometimes struggle to estimate the distance between the rear of their vehicle and nearby objects.
An Ultrasonic Reverse Parking Sensor System Using Arduino, Buzzer, and LCD is an electronic project designed to assist drivers during reversing.
The system uses an HC-SR04 ultrasonic sensor to detect obstacles behind a vehicle. An Arduino Uno processes the distance measurements and provides feedback through a buzzer and an LCD display.
As the vehicle approaches an obstacle, the buzzer produces increasingly frequent warning sounds. The LCD simultaneously displays the measured distance, helping the driver estimate how much space remains.
This project demonstrates the practical application of ultrasonic sensing, microcontroller programming and electronic warning systems in automotive technology.
2. Objectives of the Project
The main objectives are:
- To design an ultrasonic parking assistance system using Arduino.
- To measure the distance between a vehicle and nearby obstacles.
- To display obstacle distance on an LCD screen.
- To generate audible warning signals using a buzzer.
- To increase warning frequency as the vehicle approaches an obstacle.
- To improve parking awareness and reduce accidental collisions.
- To demonstrate the use of sensors in automotive applications.
3. Components and Materials Required
The following components are required to construct the project.
| No. | Component | Quantity | Purpose |
|---|---|---|---|
| 1 | Arduino Uno | 1 | Main microcontroller |
| 2 | HC-SR04 ultrasonic sensor | 1 | Detects obstacles |
| 3 | 16×2 LCD with I2C module | 1 | Displays distance |
| 4 | Active buzzer | 1 | Produces warning sounds |
| 5 | 220 Ω resistor | 1 | Optional current limiting |
| 6 | Breadboard | 1 | Circuit assembly |
| 7 | Jumper wires | As needed | Electrical connections |
| 8 | USB cable | 1 | Programming and power |
| 9 | Cardboard or model vehicle | 1 | Demonstration structure |
| 10 | 5V power supply | 1 | Powers the circuit |
4. Understanding the Main Components
A. Arduino Uno

The Arduino Uno is the main controller of the system. It receives distance information from the ultrasonic sensor, processes the measurements and controls the LCD and buzzer.
B. HC-SR04 Ultrasonic Sensor
The HC-SR04 measures the distance between the sensor and an obstacle using ultrasonic sound waves. It has four pins: VCC, TRIG, ECHO and GND.
C. 16×2 LCD Display with I2C
The LCD displays the measured distance in centimetres and provides parking instructions such as SAFE, CAUTION and STOP.
D. Buzzer
The buzzer produces audible warning signals. Its beeping frequency increases as the distance between the vehicle and obstacle decreases.
5. Circuit Diagram and Arduino Connections
The circuit connects the HC-SR04 ultrasonic sensor, LCD display and buzzer to the Arduino Uno.
Pin connection table
| Component | Pin | Arduino Uno |
|---|---|---|
| HC-SR04 | VCC | 5V |
| HC-SR04 | GND | GND |
| HC-SR04 | TRIG | Digital 9 |
| HC-SR04 | ECHO | Digital 10 |
| LCD I2C | VCC | 5V |
| LCD I2C | GND | GND |
| LCD I2C | SDA | A4 |
| LCD I2C | SCL | A5 |
| Active buzzer | Positive (+) | Digital 8 |
| Active buzzer | Negative (-) | GND |
Important: All components must share a common GND connection. Check the buzzer’s voltage and current requirements before connecting it directly to an Arduino output. Use a transistor driver if it exceeds the pin’s safe output capability.
6. Step-by-Step Project Construction
Follow these steps to assemble the ultrasonic reverse parking sensor.
Step 1: Prepare the Arduino Uno
Place the Arduino Uno on a breadboard or mounting surface. Connect it to a computer using a USB cable.
Step 2: Connect the ultrasonic sensor
Connect the HC-SR04 VCC to 5V and GND to GND. Connect TRIG to digital pin 9 and ECHO to digital pin 10.
Step 3: Connect the LCD display
Connect the LCD I2C module’s VCC and GND to the Arduino power supply. Connect SDA to A4 and SCL to A5.
Step 4: Connect the buzzer
Connect the positive terminal of the active buzzer to digital pin 8 and its negative terminal to GND.
Step 5: Assemble the circuit
Check all connections carefully, ensuring that the sensor faces the direction in which obstacles will be detected.
Step 6: Upload the Arduino program
Open Arduino IDE, enter the program provided below and upload it to the Arduino Uno.
Step 7: Test the system
Place an object in front of the ultrasonic sensor and gradually move it closer. Observe the LCD readings and listen to the buzzer warning sounds.
7. Arduino IDE Programming Code
The following program measures the distance to an obstacle, displays the result on the LCD and controls the buzzer according to the measured distance.
Required Arduino library
Install the following library using Arduino IDE Library Manager:
– LiquidCrystal_I2C
The example uses the common LCD I2C address 0x27. Some modules use 0x3F; change the address if necessary.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// LCD address and dimensions
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Ultrasonic sensor pins
const int trigPin = 9;
const int echoPin = 10;
// Buzzer pin
const int buzzerPin = 8;
float distance;
long duration;
// Buzzer timing variables
unsigned long previousBeep = 0;
const unsigned long beepDuration = 100;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzerPin, OUTPUT);
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Reverse Parking");
lcd.setCursor(0, 1);
lcd.print("System Ready");
delay(2000);
lcd.clear();
}
void loop() {
// Send ultrasonic pulse
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Measure reflected pulse
duration = pulseIn(echoPin, HIGH, 30000);
if (duration == 0) {
noTone(buzzerPin);
lcd.setCursor(0, 0);
lcd.print("No Object Found ");
lcd.setCursor(0, 1);
lcd.print("Check Sensor ");
delay(200);
return;
}
// Calculate distance in centimetres
distance = duration * 0.0343 / 2.0;
// Display distance
lcd.setCursor(0, 0);
lcd.print("Distance: ");
lcd.print(distance, 1);
lcd.print(" cm ");
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
unsigned long currentTime = millis();
// More frequent warnings as obstacle approaches
if (distance > 100) {
noTone(buzzerPin);
lcd.setCursor(0, 1);
lcd.print("Status: SAFE ");
}
else if (distance > 50) {
lcd.setCursor(0, 1);
lcd.print("Status: CAUTION ");
if (currentTime - previousBeep >= 1000) {
tone(buzzerPin, 2000);
previousBeep = currentTime;
}
if (currentTime - previousBeep >= beepDuration) {
noTone(buzzerPin);
}
}
else if (distance > 20) {
lcd.setCursor(0, 1);
lcd.print("Status: WARNING ");
if (currentTime - previousBeep >= 400) {
tone(buzzerPin, 2500);
previousBeep = currentTime;
}
if (currentTime - previousBeep >= beepDuration) {
noTone(buzzerPin);
}
}
else {
lcd.setCursor(0, 1);
lcd.print("STOP! TOO CLOSE ");
tone(buzzerPin, 3000);
}
delay(50);
}
Explanation of the Arduino program
| Code instruction | Function |
|---|---|
| LiquidCrystal_I2C lcd(0x27,16,2) | Initializes the LCD |
| trigPin = 9 | Defines the ultrasonic trigger pin |
| echoPin = 10 | Defines the ultrasonic echo pin |
| buzzerPin = 8 | Defines the buzzer output |
| pulseIn() | Measures the echo pulse duration |
| duration * 0.0343 / 2 | Calculates distance in centimetres |
| lcd.print() | Displays information on the LCD |
| tone() | Produces an audible warning |
| noTone() | Stops the buzzer sound |
Note: This is a beginner demonstration program. For a finished installation, improve the buzzer timing with a dedicated non-blocking beep controller, filter unstable distance readings and validate the sensor’s minimum and maximum operating range.
8. Understanding the Distance Measurement Formula
The ultrasonic sensor calculates the distance to an obstacle using the time taken by sound waves to travel to the obstacle and return.
The formula is:
d=\frac{v\times t}{2}
Where:
- = Distance to the obstacle.
- = Speed of sound in air (approximately 343 m/s).
- = Time taken for the sound wave to travel to the obstacle and return.
For measurements in centimetres:
\boxed{d=\frac{t\times0.0343}{2}}
Example calculation
Suppose the ultrasonic sensor records a return time of 2,000 microseconds.
d=\frac{2000\times0.0343}{2}d=34.3\text{ cm}
The obstacle is approximately 34.3 cm away from the sensor.
9. Buzzer Warning Levels
The system uses different warning levels depending on the distance between the sensor and the obstacle.
| Distance | LCD indication | Buzzer response |
|---|---|---|
| Above 100 cm | SAFE | Silent |
| 51–100 cm | CAUTION | Slow beeping |
| 21–50 cm | WARNING | Faster beeping |
| 20 cm or less | STOP! TOO CLOSE | Continuous sound |
The warning levels can be adjusted depending on the vehicle, sensor mounting position and parking environment.
10. How the Reverse Parking Sensor System Works
The system operates through the following sequence:
- The HC-SR04 sensor sends ultrasonic sound waves towards an obstacle.
- The sound waves bounce off the obstacle and return to the sensor.
- The sensor produces an Echo pulse corresponding to the travel time.
- The Arduino calculates the distance using the measured pulse duration.
- The LCD displays the distance in centimetres.
- The Arduino compares the distance with programmed warning thresholds.
- The buzzer produces warning sounds depending on how close the obstacle is.
11. Testing and Expected Results
After uploading the program, test the system using different objects placed at varying distances from the ultrasonic sensor.
| Test | Object distance | Expected response |
|---|---|---|
| 1 | 150 cm | LCD displays SAFE |
| 2 | 90 cm | Slow buzzer beeps |
| 3 | 40 cm | Faster buzzer beeps |
| 4 | 15 cm | Continuous buzzer sound |
| 5 | No detected echo | LCD displays sensor warning |
For the demonstration, use a cardboard box, wall or another flat object as the obstacle.
12. Applications of the Project
The Ultrasonic Reverse Parking Sensor System has several practical applications.
- Vehicles: Assists drivers when reversing into parking spaces.
- Residential garages: Helps prevent vehicles from hitting walls.
- Parking facilities: Supports safer vehicle positioning.
- Robotics: Helps robots detect nearby obstacles.
- Industrial automation: Supports object detection and distance measurement.
- STEM education: Demonstrates practical applications of sensors and microcontrollers.
13. Advantages of the System
- Provides real-time distance measurements.
- Produces audible warnings when obstacles are detected.
- Displays distance information on an LCD.
- Uses affordable and readily available electronic components.
- Reduces dependence on visual distance estimation.
- Can be modified for different parking environments.
- Provides practical experience in Arduino programming and automation.
14. Possible Project Improvements
The basic system can be upgraded with additional components to improve its functionality.
A. Multiple Ultrasonic Sensors
Additional sensors can be installed at different positions around the vehicle to detect obstacles on the left, right and centre.
B. LED Distance Indicator
Red, yellow and green LEDs can be integrated to provide visual warnings alongside the buzzer.
C. Wireless Monitoring
An ESP32 or ESP8266 can be added to transmit distance measurements to a smartphone or web dashboard.
D. Automatic Camera Integration
A rear-view camera can be integrated to provide visual assistance while reversing.
E. Adjustable Warning Levels
The system can be programmed with adjustable distance thresholds to suit different vehicle sizes and parking conditions.
15. Troubleshooting Common Arduino Upload Errors
| Problem | Possible cause | Solution |
|---|---|---|
| LCD displays nothing | Incorrect I2C address | Check whether address is 0x27 or 0x3F |
| LCD displays squares | LCD initialization problem | Check library and contrast adjustment |
| Sensor gives incorrect readings | Incorrect wiring | Check TRIG and ECHO connections |
| Buzzer does not sound | Incorrect polarity | Check buzzer connections |
| Arduino fails to upload | Wrong board or port | Select Arduino Uno and correct COM port |
| Distance readings fluctuate | Sensor reflections or unstable targets | Filter readings and reposition sensor |
Important: This is an educational parking assistance prototype, not a certified vehicle safety device. The HC-SR04 can be affected by rain, dirt, angled surfaces, temperature and other environmental conditions. A real vehicle installation requires automotive-grade waterproof sensors, proper mounting, electrical protection and independent safety testing. Drivers should never rely on this prototype as a replacement for mirrors, cameras or direct observation.
16. Conclusion
The Ultrasonic Reverse Parking Sensor System Using Arduino, Buzzer, and LCD demonstrates how electronic sensors and microcontrollers can improve vehicle parking assistance.
By combining an HC-SR04 ultrasonic sensor with an Arduino Uno, the project measures the distance between a vehicle and nearby obstacles. The LCD displays the measured distance while the buzzer provides audible warnings as the vehicle approaches an object.
The project is affordable, practical and suitable for students interested in electronics, automotive technology, robotics and automation.
With further improvements such as multiple sensors, LED indicators, wireless monitoring and camera integration, the system can be developed into a more advanced smart parking assistance solution.






