Smart Parking

Smart Parking using Arduino Uno, Ethernet Shield and IR sensors.

Leds represent the Parking slots.


Code:

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>
char auth[] = "";
WidgetLED led1(V1);
WidgetLED led2(V2);
WidgetLED led3(V3);
WidgetLED ldr(V0);
int rcvpin=A0;
int sensor1 = 2;
int sensor2 = 3;
int sensor3 = 4;
SimpleTimer timer;

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);
  pinMode(sensor3,INPUT);
  pinMode(7,INPUT);
  
  pinMode(sensor2,INPUT);
  
  pinMode(sensor1,INPUT);

  while (Blynk.connect() == false) {
    // Wait until connected
  }
}
 void loop() {  
   int ldrval=analogRead(rcvpin);
   Serial.println(ldrval);
   int sensorval1 = digitalRead(sensor1);
   int sensorval2 = digitalRead(sensor2);
   int sensorval3 = digitalRead(sensor3);
   Serial.println(sensorval1);
   Serial.println(sensorval2);
   Serial.println(sensorval3);
   delay(10000);
   if (sensorval1 == 1)
   {
led1.on();
}
   if (sensorval2 == 1)
   {
led2.on();
}
   if (sensorval3 == 1)
   {

led3.on();}
    if (sensorval1 == 0)
   {

led1.off();
}
   if (sensorval2 == 0)
   {
led2.off();
}
   if (sensorval3 == 0)
   {
led3.off();
}   
   
if(ldrval<100)

{

ldr.on();
}
else {
     
     ldr.off();
      }
    
    Blynk.run();
    timer.run();
     }
2 Likes

The application itself sounds like a really needed one!

Yes very much. Users can save a lot of time and gas if they already know whether the parking is full or not. If not, they can easily spot the free slots.

1 Like