With the increasing number of vehicles, managing parking spaces efficiently has become a challenge in urban areas. An automatic car parking system can solve this problem by automating entry, exit, and slot allocation using sensors and microcontrollers. In this project, we use an Arduino Uno, IR sensors, a servo motor, and an LCD display to create a simple yet functional prototype of an automatic parking system.
Components RequiredArduino Uno – 1
- Arduino Uno – 1
IR sensors – 2 (for entry and exit detection)
- IR sensors – 2 (for entry and exit detection)
Servo motor (SG90 or similar) – 1
- Servo motor (SG90 or similar) – 1
16x2 LCD display (with I2C module) – 1
- 16x2 LCD display (with I2C module) – 1
Jumper wires – several
- Jumper wires – several
Breadboard – 1
- Breadboard – 1
USB cable for Arduino – 1
- USB cable for Arduino – 1
External 5V power supply (optional, for servo stability)
- External 5V power supply (optional, for servo stability)
The automatic parking system works by using IR sensors to detect vehicles at the entry and exit points. When a car approaches the entrance, the entry IR sensor detects it. If a parking slot is available, the Arduino triggers the servo motor to open the barrier. After a short delay, the barrier closes again.
Every time a vehicle enters, the system reduces the available slot count by 1. Similarly, when a car exits the parking area, the exit IR sensor increases the available slot count by 1. A 16x2 LCD display is used to continuously show the number of available parking slots in real-time.
If the parking area is full, the gate remains closed, and the LCD displays a message indicating that no slots are available.
Circuit Connections OverviewIR sensor (entry) → Digital pin 2
- IR sensor (entry) → Digital pin 2
IR sensor (exit) → Digital pin 3
- IR sensor (exit) → Digital pin 3
Servo motor → PWM pin 9
- Servo motor → PWM pin 9
LCD (I2C) → SDA (A4), SCL (A5)
- LCD (I2C) → SDA (A4), SCL (A5)
Power and GND → Connected appropriately to Arduino
- Power and GND → Connected appropriately to Arduino
cpp
CopyEdit
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Servo gate;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int irEntry = 2;
int irExit = 3;
int slots = 2; // Total available slots
void setup() {
pinMode(irEntry, INPUT);
pinMode(irExit, INPUT);
gate.attach(9);
lcd.begin();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Parking System");
updateLCD();
}
void loop() {
if (digitalRead(irEntry) == LOW && slots > 0) {
slots--;
gate.write(90); delay(2000); gate.write(0);
updateLCD();
delay(1000);
}
if (digitalRead(irExit) == LOW && slots < 2) {
slots++;
updateLCD();
delay(1000);
}
}
void updateLCD() {
lcd.setCursor(0, 1);
lcd.print("Slots Available: ");
lcd.print(slots);
}
cpp
CopyEdit
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Servo gate;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int irEntry = 2;
int irExit = 3;
int slots = 2; // Total available slots
void setup() {
pinMode(irEntry, INPUT);
pinMode(irExit, INPUT);
gate.attach(9);
lcd.begin();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Parking System");
updateLCD();
}
void loop() {
if (digitalRead(irEntry) == LOW && slots > 0) {
slots--;
gate.write(90); delay(2000); gate.write(0);
updateLCD();
delay(1000);
}
if (digitalRead(irExit) == LOW && slots < 2) {
slots++;
updateLCD();
delay(1000);
}
}
void updateLCD() {
lcd.setCursor(0, 1);
lcd.print("Slots Available: ");
lcd.print(slots);
}
Key FeaturesAutomatic gate control using servo motor
- Automatic gate control using servo motor
Real-time parking slot tracking
- Real-time parking slot tracking
LCD display for user-friendly feedback
- LCD display for user-friendly feedback
Compact design suitable for model demos and learning
- Compact design suitable for model demos and learning
Smart parking lots
- Smart parking lots
Shopping malls and office buildings
- Shopping malls and office buildings
University campuses
- University campuses
Robotics and IoT learning projects
- Robotics and IoT learning projects
Add more sensors for individual slot monitoring
- Add more sensors for individual slot monitoring
Use ultrasonic sensors for more accurate distance detection
- Use ultrasonic sensors for more accurate distance detection
Integrate LEDs or buzzers for visual/audio feedback
- Integrate LEDs or buzzers for visual/audio feedback
Expand the system for multi-slot or multi-level parking
- Expand the system for multi-slot or multi-level parking
Use RFID or license plate recognition for secure vehicle identification
- Use RFID or license plate recognition for secure vehicle identification
This Arduino-based automatic parking system is an excellent example of how basic electronics and coding can solve real-world problems. Using simple components like IR sensors, a servo motor, and a display, you can build a functional prototype that demonstrates automated vehicle entry and slot tracking. It’s a great project for students, hobbyists, and anyone interested in smart city or IoT applications.
Comments