hariprasad_lokesh
Published

Smart parking system

Smart prarking lot forpublic parkingd

IntermediateFull instructions provided749
Smart parking system

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
RGB LCD Shield Kit, 16x2 Character Display
RGB LCD Shield Kit, 16x2 Character Display
×1
IR Transceiver (Generic)
×5

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

Story

Read more

Schematics

circuit diagram

Code

code for smart parking system

Arduino
#include <LiquidCrystal.h> 
LiquidCrystal lcd(12, 15, 16, 17, 18, 19); int ir1 = 2; int ir2 = 3; int ir3 = 4; 
int ir4 = 5; int ir5 = 6; #define a 10 #define b 11 void setup() 
{ 
  Serial.begin(9600);   lcd.begin(16, 2);   lcd.clear();   pinMode(ir1, INPUT);   pinMode(ir2, INPUT);   pinMode(ir3, INPUT);   pinMode(ir4, INPUT);   pinMode(ir5, INPUT); 
 
  pinMode(a, OUTPUT);   pinMode(b, OUTPUT); 
 } 
void loop() 
{ 
  lcd.setCursor(0, 0);   lcd.print("Slot1:");   lcd.print(digitalRead(ir1));   lcd.setCursor(7, 0);   lcd.print("  Slot2:");   lcd.print(digitalRead(ir2));   lcd.setCursor(0, 1);   lcd.print("Slot3:");   lcd.print(digitalRead(ir3));   lcd.setCursor(7, 1);   lcd.print("  Slot4:");   lcd.print(digitalRead(ir4));   if ((digitalRead (ir1) == 1) && ( digitalRead (ir2) == 1) && ( digitalRead (ir3) == 1) && ( digitalRead (ir4) == 1)) 
  { 
 
    lcd.clear();     lcd.print("parking full");     delay(1000);     digitalWrite(a, LOW);     digitalWrite(b, LOW); 
  } 
  else if ( digitalRead (ir5) == 1) 
  { 
    digitalWrite(a, HIGH);     digitalWrite(b, LOW);     delay(280);     digitalWrite(a, LOW);     digitalWrite(b, LOW);     delay(5000);     digitalWrite(a, LOW);     digitalWrite(b, HIGH);     delay(280);     digitalWrite(a, LOW);     digitalWrite(b, LOW);   } 
  digitalWrite(a, LOW);   digitalWrite(b, LOW); 
} 

Credits

hariprasad_lokesh

hariprasad_lokesh

3 projects • 0 followers

Comments