Wednesday, 30 December 2020

Smart TollGate Barrier Using RFID Module

 Circuit:- 



Code:-

#include<Servo.h>
Servo servo;
int count = 0;  
char input[12];


void setup() {
  Serial.begin(9600);
 servo.attach(8);
 servo.write(0);
}

void loop() {
  if(Serial.available())
  {
    count = 0;
    while(Serial.available() && count < 12)
    {
      input[count] = Serial.read();
      count++;
      delay(5);
    }
    if(input[0] == '4' && input[1] == '0' && input[2] == '0' && input[3] == '0' &&
       input[4] == '3' && input[5] == '5' && input[6] == '0' && input[7] == '5' &&
       input[8] == '9' && input[9] == '1' && input[10] == 'E' && input[11] == '1' )
    {
      servo.write(90);
      delay(2000);
      servo.write(0);
    
      
    }
  }
}

Saturday, 26 December 2020

Automatic car parking using 2 IR sensors Part (2)

 Circuit:-

We are adding one more IR sensor on the 10th pin of Arduino



Code:- 

#include<Servo.h>
int IR1 = 10;
int IR2 = 11;


Servo servo1;
Servo servo2;
void setup() {
pinMode(IR1,INPUT);
pinMode(IR2,INPUT);
servo1.attach(8);
servo2.attach(9);
servo2.write(0);
servo1.write(120);
delay(1000);
}

void loop() {
  if(digitalRead(IR1)==LOW && digitalRead(IR2)==HIGH)
  
 {
  servo2.write(90);
 servo1.write(0);
  
  
 
 }
 else if(digitalRead(IR1)==HIGH && digitalRead(IR2)==LOW)
 {
   servo2.write(0);
  servo1.write(120);
 }
}
 
You can purchase the raw material for this project from here:- 
https://amzn.to/3oKeh3C https://amzn.to/3nU8bxB https://amzn.to/2L00cjO https://amzn.to/37Rjp0p


Automatic Car parking system Part (1)

 Circuit:-




Code:-

#include<Servo.h>
int IR1 = 10;

Servo servo1;
Servo servo2;
void setup() {
pinMode(IR1,INPUT);
servo1.attach(8);
servo2.attach(9);
servo2.write(0);
servo1.write(180);
delay(1000);
}

void loop() {
  if(digitalRead(IR1)==LOW)
  
 {
  servo2.write(90);
 servo1.write(0);
  
  delay(3000);
 
 }
 else
 {
   servo2.write(0);
  servo1.write(120);
 }
}
 

You can purchase the raw material for this project from herre:-
https://amzn.to/3nU8bxB
https://amzn.to/2L00cjO
https://amzn.to/37Rjp0p