Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!

Automatic Car Parking System Using Arduino Uno -B24

This automated car parking system is aimed at managing parking lots efficiently.

BeginnerFull instructions provided802
Automatic Car Parking System Using Arduino Uno -B24

Things used in this project

Hardware components

Arduino Uno Rev3
Seeed Studio Arduino Uno Rev3
×1
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Male/Male Jumper Wires
×5
Male/Female Jumper Wires
Male/Female Jumper Wires
×10
IR Obstacle Avoidance Sensor
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Automatic Car Parking System-schematic

Code

Automatic Car Parking System-code

Arduino
// Created by Simple Circuits 

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);   

#include <Servo.h> 



Servo myservo;



int IR1 = 2;

int IR2 = 3;



int Slot = 8; //Total number of parking Slots



int flag1 = 0;

int flag2 = 0;



void setup() {

  Serial.begin(9600); 

    lcd.init(); //initialize the lcd

    lcd.backlight(); //open the backlight

 

 

pinMode(IR1, INPUT);

pinMode(IR2, INPUT);

  

myservo.attach(4);

myservo.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){myservo.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){myservo.write(0); Slot = Slot+1;}

}



if(flag1==1 && flag2==1){

delay (1000);

myservo.write(100);

flag1=0, flag2=0;

}



lcd.setCursor (0,0);

lcd.print("    WELCOME!    ");

lcd.setCursor (0,1);

lcd.print("Slot Left: ");

lcd.print(Slot);

}

Credits

Hannah Khairunnisa Filzah
1 project • 0 followers
Contact
dirakit community
23 projects • 109 followers
Indonesia IoT Community by Informatics UIN Sunan Kalijaga Yogyakarta
Contact

Comments

Please log in or sign up to comment.