Smart Car Parking System Using Arduino | Obstacle Detection with Ultrasonic Sensor
Overview
This project is about a parking system. Whenever we park our vehicle, we face a problem that our vehicle should not get damaged by colliding with another vehicle or wall or any other object. This common problem can be solved by a smart parking system.
In this smart parking system, whenever your car comes closer to 100cm to any obstacle, it will give you a sound to tell you to stop. Not only this, but the LCD will also display the distance from the obstacle.
Hardware requiredÂ
- Arduino Uno R3
- Resistor
- Jumper Wires
- Potentiometer
- Buzzer
- Ultrasonic Sensor
- LCD
Schematic Diagram

Fig 1. Circuit Diagram
Arduino Code :Â
#include <LiquidCrystal.h>
LiquidCrystal lcd(7 , 6, 5, 4, 3, 2);
const int trigPin = 11;
const int echoPin = 10;
int const buzzPin = 12;
long duration;
int distanceCm, distanceInch;
void setup() {
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzPin, OUTPUT);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
distanceInch = duration*0.0133/2;
lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Distance: "); // Prints string "Distance" on the LCD
lcd.print(distanceCm); // Prints the distance value from the sensor
lcd.print(" cm");
delay(10);
lcd.setCursor(0,1);
lcd.print("Distance: ");
lcd.print(distanceInch);
lcd.print("inch");
delay(10);
if (distanceCm <= 100 && distanceCm >= 0) {
// Buzz
digitalWrite(buzzPin, HIGH);
} else {
// Don't buzz
digitalWrite(buzzPin, LOW);
}
// Waiting 60 ms won't hurt any one
delay(60);
}
Precautions
- Connections should be done properly.
- Arduino is case Sensitive, so code accordingly.
- Give different and appropriate colours to the wires.
- Use resistors for sensors and LCDs.
Conclusion:
This smart parking system using Arduino provides a practical solution to avoid accidental vehicle damage by alerting drivers with both sound and distance display. It is simple, effective, and a great project for beginners to understand the integration of sensors, buzzers, and LCDs with Arduino.
Exploring such projects builds confidence in embedded systems and problem-solving. For more innovative learning experiences and hands-on coding guidance, check out coding schools at Maker’s Muse.