Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Smart Car Parking System with LCD Display and Servo Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Car Parking System with LCD Display and Servo Control

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to implement an Arduino-based car parking system. The system uses an Arduino UNO microcontroller to control a 16x2 I2C LCD display, a micro servo motor, and two IR sensors. The LCD displays the status of the parking slots, while the IR sensors detect the presence of cars. The servo motor acts as a gate that opens and closes based on the availability of parking slots.

Component List

  1. 16x2 I2C LCD

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  2. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  3. Micro Servo 9G

    • Description: A small servo motor used for precise control of angular position.
    • Pins: GND, +5V, PWM
  4. IR Sensor (1)

    • Description: An infrared sensor used to detect the presence of objects.
    • Pins: out, gnd, vcc
  5. IR Sensor (2)

    • Description: An infrared sensor used to detect the presence of objects.
    • Pins: out, gnd, vcc

Wiring Details

16x2 I2C LCD

Arduino UNO

Micro Servo 9G

IR Sensor (1)

IR Sensor (2)

Documented Code

Arduino UNO Code

// Viral Science www.viralsciencecreativity.com www.youtube.com/c/viralscience
// Arduino Car Parking System

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2);  //Change the HEX address
#include <Servo.h> 

Servo myservo1;

int IR1 = 2;
int IR2 = 4;

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(3);
  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);
}

16x2 I2C LCD Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This documentation provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code running on the microcontrollers.