Automated Parking Lot System

Automated Parking Lot System

Based on Arduino, open your gate only to verified individuals.

  • 4,738 views
  • 1 comment
  • 12 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
Servos (Tower Pro MG996R)
×1
RFID Module (Generic)
×1
Bluetooth Low Energy (BLE) Module (Generic)
×1

Apps and online services

About this project

Since we had to use several RFID tags before starting, we needed a procedure to check each UID, a unique ID. I have uploaded the following code with the circuit configured. We have made UIDs display in hexadecimal and decimal notation. The unique number you find here will be used later when you register the card you want to authorize.

In an Arduino program, it’s not possible to have a function that performs two actions with the same name. So, a function has to be declared that moves the servo motor through Bluetooth and a function that moves the servo motor by identifying the user with RFID.

If both operations put into loop () function at once, it will not work normally. So I fixed the error by putting each function separately in the loop function.

Code

CAR_2.inoC/C++
working with both RFID module and Bluetooth module
#include <SoftwareSerial.h> 
#include "Servo.h" 
#include <SPI.h>  
#include <MFRC522.h>
#define SS_PIN 10  
#define RST_PIN 9
#define PICC_0 0xD4
#define PICC_1 0x87
#define PICC_2 0x75
#define PICC_3 0xA7

MFRC522 rfid(SS_PIN, RST_PIN); 
 
Servo myservo;
int blueTx=2;   
int blueRx=3;   
SoftwareSerial mySerial(blueTx, blueRx); 
String myString=""; 


void setup() {
  myservo.attach(6);  
  myservo.write(0);    
  mySerial.begin(9600); 
SPI.begin();
rfid.PCD_Init();
}


void RFID_S() {
  if ( ! rfid.PICC_IsNewCardPresent())
    return;
  
  if ( ! rfid.PICC_ReadCardSerial())
    return;

  Serial.print(F("PICC type: "));
  MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
  Serial.println(rfid.PICC_GetTypeName(piccType));

 
  if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI &&  
    piccType != MFRC522::PICC_TYPE_MIFARE_1K &&
    piccType != MFRC522::PICC_TYPE_MIFARE_4K) {
    Serial.println(F("Your tag is not of type MIFARE Classic."));
    return;
  }

   if (rfid.uid.uidByte[0] != PICC_0 || 
      rfid.uid.uidByte[1] != PICC_1 || 
      rfid.uid.uidByte[2] != PICC_2 || 
      rfid.uid.uidByte[3] != PICC_3 ) {

    Serial.println(F("This is a confirmed Card."));   
    Serial.println(F("Motor On!!"));   

 
    myservo.write(90);
    delay(3000);
    myservo.write(0);
  }
   
  rfid.PICC_HaltA();
  rfid.PCD_StopCrypto1();

}

void Blue_motor() {
   while(mySerial.available())  
  {
    char myChar = (char)mySerial.read();  
    myString+=myChar;   
    delay(5);    }
  
  if(!myString.equals(""))  
  {
    Serial.println("input value: "+myString);
 
      if(myString=="on") 
      {
        myservo.write(90); 
        delay(3000);
        myservo.write(0);
     
    myString="";  
  }
}
}
void loop() {

  Blue_motor();
  RFID_S(); 
}

Schematics

hdphoto1_pIyeqXTW5D.wdp
hdphoto1_pIyeqXTW5D.wdp

Comments

Similar projects you might like

Arduino Automated Parking Garage

Project tutorial by ashraf_minhaj

  • 4,180 views
  • 11 comments
  • 24 respects

Home/Hotel Monitoring System with Automated controls

Project tutorial by Anas Siddiqui

  • 4,183 views
  • 10 comments
  • 15 respects

Smart Parking System

Project in progress by Md. Khairul Alam

  • 43,049 views
  • 32 comments
  • 104 respects

Smart Parking System

Project tutorial by Husinul

  • 9,586 views
  • 14 comments
  • 23 respects

Automated Plant Watering System

Project in progress by Ammar Shahid

  • 4,425 views
  • 2 comments
  • 23 respects
Add projectSign up / Login