0% found this document useful (0 votes)
23 views3 pages

Parking System

Uploaded by

fakhrul helmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Parking System

Uploaded by

fakhrul helmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

In this article, we are going to make an automatic car parking

system project using Arduino UNO. For detecting the


movement of vehicles we are using IR sensors and to display the
parking status we are using a 16×2 LCD.

Also, do check out the latest projects on Arduino and Raspberry


Pi. Make the connections according to the given diagram and
upload the code.

automatic car parking system project


Working?
There are two parking slots in our project. If you want to increase
the number of paring slots then add a few more IR sensors and
modify the code accordingly.

The system automatically detects whether the parking slot is


empty or not. If the slot is empty in the automated car
parking the new vehicles are allowed to enter else the entrance
is blocked by the servo barrier in case the parking is full.

The visitors can see the status for the availability of the free
space outside the parking on a 16×2 LCD. They can also see on
the LCD how many parking slots are free. The data keeps
updating as the vehicles move in and out of the parking. Also,
check our basic electronics projects on 555 timer ic, Arduino
projects, and IoT projects.
Components Required
Arduino UNO
Two IR sensors
Servo motor
Jumper wires and a breadboard
16×2 LCD and an I2C module
USB cable for uploading the code

Coding

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
#include <Servo.h>
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.begin();
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);
}

You might also like