Smart Parking Using IR,Servo motor and Arduino Uno(Automation Project)
The Automated Parking System using Arduino is a project designed to efficiently manage parking spaces. It uses IR sensors to detect the presence of vehicles, a servo motor to control the parking barrier, and an LCD display to provide real-time updates on the availability of parking slots. This system aims to optimize the parking process, ensuring that users are informed about slot availability and the barrier operates automatically based on the sensor inputs.
Project : 6
Description
The Automated Parking System using Arduino is a project
designed to efficiently manage parking spaces. It uses IR sensors to detect the
presence of vehicles, a servo motor to control the parking barrier, and an LCD
display to provide real-time updates on the availability of parking slots. This
system aims to optimize the parking process, ensuring that users are informed
about slot availability and the barrier operates automatically based on the
sensor inputs.
Required Components
- Arduino
Board: The main microcontroller to process the data from the sensors
and control the servo motor and LCD.
- IR
Sensors: Detects the presence of vehicles at the entrance and exit.
- IR1:
Entrance sensor (connected to pin 4)
- IR2:
Exit sensor (connected to pin 7)
- Servo
Motor: Controls the parking barrier (connected to pin 9).
- LiquidCrystal_I2C
Display: Displays the number of available slots and status messages.
- Connecting
Wires: For establishing connections between components.
- Power
Supply: Adequate power supply for the Arduino and sensors.
Working Principle
- Initialization:
- The
Arduino initializes the LCD display, IR sensors, and servo motor.
- A
welcome message is displayed on the LCD.
- Slot
Detection and Barrier Control:
- When
a vehicle is detected by IR1 (entrance sensor), the system checks if
slots are available.
- If
slots are available, the servo motor moves to open the barrier, and the
slot count decreases.
- If
no slots are available, a "Parking Full" message is displayed.
- When
a vehicle is detected by IR2 (exit sensor), the slot count increases, and
the servo motor opens the barrier for exit.
- The
system ensures the barrier opens only when both entry and exit conditions
are met, then resets the flags and closes the barrier after a delay.
- Real-Time
Slot Update:
- The
LCD displays the number of available slots in real-time.
- If
the parking is full, an appropriate message is shown to inform the user.
Circuit Diagram:
Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo myservo1;
int IR1 = 4; // IR Sensor 1
int IR2 = 7; // IR Sensor 2
int Slot = 4; // Enter Total number of parking Slots
int flag1 = 0;
int flag2 = 0;
void setup() {
lcd.init();
lcd.backlight();
pinMode(IR1, INPUT);
pinMode(IR2, INPUT);
myservo1.attach(9);
myservo1.write(100);
lcd.setCursor(0, 0);
lcd.print(" ARDUINO ");
lcd.setCursor(0, 1);
lcd.print("
PARKING SYSTEM ");
delay(2000);
lcd.clear();
}
void loop() {
if (digitalRead(IR1)
== LOW && flag1 == 0) {
if (Slot > 0) {
flag1 = 1;
if (flag2 == 0)
{
myservo1.write(0);
Slot = Slot -
1;
}
} else {
lcd.setCursor(0,
0);
lcd.print(" SORRY :( ");
lcd.setCursor(0,
1);
lcd.print("
Parking Full ");
delay(3000);
lcd.clear();
}
}
if (digitalRead(IR2)
== LOW && flag2 == 0) {
flag2 = 1;
if (flag1 == 0) {
myservo1.write(0);
Slot = Slot + 1;
}
}
if (flag1 == 1
&& flag2 == 1) {
delay(1000);
myservo1.write(100);
flag1 = 0;
flag2 = 0;
}
lcd.setCursor(0, 0);
lcd.print(" WELCOME! ");
lcd.setCursor(0, 1);
lcd.print("Slot
Left: ");
lcd.print(Slot);
}
Conclusion
The Automated Parking System using Arduino is an efficient
and user-friendly solution for managing parking spaces. By utilizing IR sensors
to detect vehicle presence and a servo motor to control the barrier, the system
automates the entry and exit processes. The real-time updates on the LCD
display keep users informed about slot availability, making parking management
easier and more efficient. This system can be further enhanced with additional
features such as remote monitoring, mobile notifications, and integration with
payment systems for a complete automated parking solution.