DIY Arduino Smart Car Parking System
Introduction
Managing parking spaces efficiently is crucial in urban areas. In this project, we will build an Arduino Smart Car Parking System that uses 4 PIR sensors, 2 servo motors, an LCD display, and a voltage regulator. The system will detect car movement using PIR sensors and control the entrance and exit gates automatically.
Components Required
Arduino Uno
4 PIR Sensors
2 Servo Motors
16x2 LCD Display
7805 Voltage Regulator
Power Supply (12V DC)
Jumper Wires
Resistors and Capacitors (as needed)
Breadboard/PCB
Circuit Diagram
Before assembling, ensure you understand the circuit connections:
PIR Sensors:
Connect the VCC and GND of each PIR sensor to the 5V and GND of Arduino.
Connect the Output pin of each PIR sensor to Arduino digital pins (e.g., D2, D3, D4, D5).
Servo Motors:
Connect the signal wires of two servos to Arduino PWM pins (e.g., D6 and D9).
Power the servo motors using a 5V regulated power supply.
LCD Display:
Connect RS, EN, D4, D5, D6, and D7 of LCD to Arduino (e.g., D7, D8, D10, D11, D12, D13).
Connect the LCD VCC and GND to 5V and GND.
Voltage Regulator (7805):
Input: 12V DC Power Supply.
Output: 5V regulated power to Arduino and components.
Circuit diagram
Code Implementation
Upload the following Arduino code:
#include<LiquidCrystal.h>
#include<Servo.h> //Library for the servo motor
Servo S1,S2;
#define IR_Slot1 9 //Define pins
#define IR_Slot2 10
#define IR_entry 8
#define IR_exit 11
int pos=0;
LiquidCrystal lcd(7,6,5,4,3,2);
void setup() {
S1.attach(13);
S2.attach(12);
S1.write(pos);
S2.write(pos);
pinMode(IR_Slot1, INPUT);
pinMode(IR_Slot2, INPUT);
pinMode(IR_entry, INPUT);
pinMode(IR_exit, INPUT);
lcd.begin(16, 2);
lcd.print(" Smart Parking");
lcd.setCursor(0, 1);
lcd.print(" System");
delay (2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Slot 1 = A");
lcd.setCursor(0, 1);
lcd.print("Slot 2 = B");
delay(2000);
}
void loop()
{
if(digitalRead(IR_Slot1)==HIGH)
{
lcd.setCursor(0, 0);
lcd.print("Slot 1 = NA");
}
else
{
lcd.setCursor(0, 0);
lcd.print("Slot 1 = A");
}
if(digitalRead(IR_Slot2)==HIGH)
{
lcd.setCursor(0, 1);
lcd.print("Slot 2 = NA");
}
else
{
lcd.setCursor(0, 1);
lcd.print("Slot 2 = A");
}
if(digitalRead(IR_entry)==HIGH)
{
S1.write(pos+90);
}
else
{
S1.write(pos);
}
if(digitalRead(IR_exit)==HIGH)
{
S2.write(pos+90);
}
else
{
S2.write(pos);
}
}
Working Principle
Vehicle Detection: The PIR sensors detect incoming and outgoing vehicles.
Automatic Gate Control: The servos open the gate when a car is detected and close it after entry/exit.
Slot Monitoring: The LCD displays the available parking slots dynamically.
Power Regulation: The voltage regulator ensures a stable 5V supply to the components.
FAQs
Q1: Can I use an ultrasonic sensor instead of a PIR sensor? Yes, ultrasonic sensors can provide better accuracy for detecting distance and presence.
Q2: What happens if all slots are full? The system will prevent new cars from entering by keeping the entry gate closed.
Q3: Can I extend this system to more parking slots? Yes, you can add more PIR sensors and modify the code accordingly.
Q4: Is this system suitable for outdoor use? It can be used outdoors with waterproof enclosures for components.
Conclusion
This Arduino Smart Car Parking System is an efficient way to automate parking management. It is beginner-friendly and can be expanded for real-world