Automatic Door Controller
About the project :-
In the Automatic Door Opening System, the most component or hardware is that the sensor which detects the persons (well, the motion of the person in our case). For this purpose, we'll be using the PIR Motion Detector Sensor.
When you tread on the mat, the sensors send a sign to the automated doors that tells them to open. Other automatic doors operate on optic or motion sensors. When these optic or motion sensors sense motion nearby, they trigger the automated doors to open then close.
All project managers need to make decisions, but good decisions usually come from the use of a logical and rational process. I make this project to enhance my knowledge.
working :-
The servos are the automated gate which opens without touch and therefore the refore the first PIR sensor is for counting the amount of individuals who entered and the second PIR sensor is for counting the number of people who left the room, at a time only 5 people can enter the room, the lcd display is for displaying the number of people in the room and arduino uno controls the entire gate system.
Materials:-
- PIR sensor, 2 pics,
- Servo, 2 pics,
- Lcd display16*2, 1pics,
- Potential meter, 1 pics,
- Arduino uno, 1pics,
- 220 ohm resistor, 3 pics,
- LED(any colour), 2 pics
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMJikw549g37lp5E2P0Ut6QwEtmUUUC7Rb3qZj_sl0Zj1lURzzzIj_9dVYiHpYPjVBpKLyciUD_-5xBfV6aBbW7p-rrIjPbjLVCY85jbiYm7LrxsGmIjMyxGzgPxHxhjvf3HlcPmyt3Pk/w625-h242/ar.jpeg)
Necessary Tools:-
- Solder Iron
- Solder Wire
- Soldering Flux
CODE:-
In and out automatic door sensor code
The servos are the automated gate which opens without touch and therefore the refore the first PIR sensor is for counting the amount of individuals who entered and the second PIR sensor is for counting the number of people who left the room, at a time only 5 people can enter the room, the lcd display is for displaying the number of people in the room and arduino uno controls the entire gate system.
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#include <Servo.h>
Servo rservo;
int a=0;
int b=0;
int c=9;
int d=0;
int e=11;
int f=0;
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
rservo.attach(8);
pinMode(13, OUTPUT);
pinMode(9, INPUT);
pinMode(12, OUTPUT);
pinMode(11, INPUT);
}
void loop()
{
d=digitalRead(c);
f=digitalRead(e);
if(d==1)
{
f==0;
delay(2000);
}
else if(f==1)
{
d==0;
delay(2000);
}
if(a==0)
{
lcd.setCursor(1,0);
lcd.print("0 Person");
rservo.write(0);
a=1;
b=0;
}
else if((d==1)&&(a==1))
{
lcd.setCursor(1,0);
lcd.print("1 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
a=2;
b=4;
}
else if((d==1)&&(a==2))
{
lcd.setCursor(1,0);
lcd.print("2 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
a=3;
b=3;
}
else if((d==1)&&(a==3))
{
lcd.setCursor(1,0);
lcd.print("3 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
a=4;
b=2;
}
else if((d==1)&&(a==4))
{
lcd.setCursor(1,0);
lcd.print("4 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
a=5;
b=1;
}
else if((d==1)&&(a==5))
{
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
lcd.setCursor(1,0);
lcd.print("5 Person");
delay(2500);
rservo.write(45);
delay(2500);
rservo.write(0);
lcd.setCursor(1,0);
a=6;
b=0;
}
else if((d==1)&&(a==6))
{
rservo.write(0);
lcd.setCursor(1,0);
lcd.print("Full Capacity");
delay(2500);
lcd.setCursor(1,0);
lcd.print(" ");
delay(2500);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
lcd.print("Full Capacity");
delay(2500);
lcd.setCursor(1,0);
lcd.print(" ");
delay(2500);
}
else if((f==1)&&(b==0))
{
lcd.setCursor(1,0);
lcd.print(" ");
lcd.setCursor(1,0);
lcd.print("4 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
b=1;
a=4;
}
else if((f==1)&&(b==1))
{
lcd.setCursor(1,0);
lcd.print("3 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
b=2;
a=3;
}
else if((f==1)&&(b==2))
{
lcd.setCursor(1,0);
lcd.print("2 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
b=3;
a=2;
}
else if((f==1)&&(b==3))
{
lcd.setCursor(1,0);
lcd.print("1 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
b=4;
a=1;
}
else if((f==1)&&(b==4))
{
lcd.setCursor(1,0);
lcd.print("0 Person");
rservo.write(45);
delay(2500);
rservo.write(0);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
b=5;
a=0;
}
else if((f==1)&&(b==5))
{
rservo.write(0);
digitalWrite(13, HIGH);
}
digitalWrite(12, LOW);
digitalWrite(13, LOW);
//Serial.print(a);
//Serial.print(b);
//Serial.print(c);
//Serial.print(d);
//Serial.print(e);
//Serial.print(f);
lcd.setCursor(1,1);
lcd.print(" ");
delay(100);
lcd.setCursor(1,1);
lcd.print("Limit 5 Person");
delay(1000);
lcd.setCursor(1,1);
lcd.print(" ");
delay(100);
lcd.setCursor(1,1);
lcd.print("Stay Home");
delay(1000);
lcd.setCursor(1,1);
lcd.print(" ");
delay(100);
lcd.setCursor(1,1);
lcd.print("Stay Safe");
delay(1000);
} //Code end here
Hope You enjoyed this blog see you in the next one!!!
Comments
Post a Comment
If you have any doubts ,Please let me know.