3.7. Smart Vehicle Parking Management System
| Description | In this project, learners will build an automated parking management system using an Ultrasonic Sensor, Servo Motor, LCD Display, and Buzzer. The system detects approaching vehicles, automatically opens a gate when space is available, and alerts users when the parking area is full. This project demonstrates automation systems commonly used in shopping malls, office complexes, and smart city infrastructure. |
|---|---|
| Use case | This project is connected to real-world uses such as: This project demonstrates automated vehicle access systems used in modern parking facilities and smart transportation infrastructure. |
Components (Things You will need)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|---|---|
Building the circuit
Things Needed:
- Arduino Uno
- Ultrasonic Sensor (HC-SR04)
- Servo Motor
- LCD Display
- Buzzer
- Breadboard
- Jumper Wires
- Arduino USB Cable
Mounting the component on the breadboard and wiring the circuit
Step 1: Connect the Arduino 5V pin to the breadboard’s red (+) power rail.
Step 2: Connect the Arduino GND pin to the breadboard’s blue/black (−) ground rail.
Step 3: Connect the I2C LCD Display’s VCC to the 5V power rail.
Step 4: Connect the I2C LCD Display’s GND to the ground rail.
Step 5: Connect the I2C LCD Display’s SDA to Arduino pin A4.
Step 6: Connect the I2C LCD Display’s SCL to Arduino pin A5.
Step 7: Place the Ultrasonic Sensor (HC-SR04) on the breadboard.
Step 8: Connect the Ultrasonic Sensor’s VCC to the 5V power rail.
Step 9: Connect the Ultrasonic Sensor’s GND to the ground rail.
Step 10: Connect the Ultrasonic Sensor’s Trig pin to Arduino digital pin 9.
Step 11: Connect the Ultrasonic Sensor’s Echo pin to Arduino digital pin 10.
Step 12: Connect the Servo Motor’s VCC (red) wire to the 5V power rail.
Step 13: Connect the Servo Motor’s GND (brown/black) wire to the ground rail.
Step 14: Connect the Servo Motor’s Signal (orange/yellow) wire to Arduino digital pin 6.
Step 15: Insert the Buzzer into the breadboard.
Step 16: Connect the Buzzer’s positive (+) leg to Arduino digital pin 8.
Step 17: Connect the Buzzer’s negative (−) leg to the ground rail.
Step 18: Verify that all components share the common 5V and GND rails.
Step 19: Check the orientation and polarity of all components carefully before connecting the USB cable and testing the circuit.

Make sure to connect the Arduino USB cable to the Arduino board.
PROGRAMMING
Step 1: Open your Arduino IDE. See how to set up here: Getting Started.
Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Create LCD object
LiquidCrystal_I2C lcd(0x27,16,2);
// Create servo object
Servo gateServo;
// Pin definitions
int trigPin = 9;
int echoPin = 10;
int buzzerPin = 8;
void setup() {
// Initialize LCD
lcd.init();
lcd.backlight();
// Configure pins
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzerPin, OUTPUT);
// Attach servo
gateServo.attach(6);
// Keep gate closed initially
gateServo.write(0);
}
void loop() {
// Generate ultrasonic pulse
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read distance
long duration = pulseIn(echoPin, HIGH);
int distance = duration * 0.034 / 2;
lcd.setCursor(0,0);
lcd.print("Vehicle:");
lcd.print(distance);
lcd.print("cm ");
// Vehicle detected
if(distance < 15){
lcd.setCursor(0,1);
lcd.print("Gate Opening ");
// Open gate
gateServo.write(90);
delay(3000);
// Close gate
gateServo.write(0);
}
else{
lcd.setCursor(0,1);
lcd.print("Waiting... ");
}
delay(200);
}
Step 3: Save your code. See the Getting Started section
Step 4: Select the arduino board and port _See the Getting Started.
Step 5: Upload your code.
CONCLUSION
When the program is running, the Smart Vehicle Parking Management System continuously monitors the distance between the ultrasonic sensor and nearby objects. When a vehicle is detected within the predefined range, the servo motor automatically responds according to the programmed logic, such as opening or closing a parking barrier. The system provides real-time feedback through the connected outputs, demonstrating automated vehicle detection and parking access control.







