AUTOMATIC CLOSE AND OPEN Door System

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

AUTOMATIC CLOSE AND OPEN-DOOR SYSTEM

Hello guys, welcome to Smartkembo discovery science, Hope you are fine. So today we are going to
make a very cool project which is Automatic close and open-door system. As the name described a door
system it can help us into avoiding from dangerous of sharing hands during opening and closing the
door. For example if you want to enter or to leave into the room the system will open and close the door
automatically without no need of touch

There is a lot of search for this awesome project, thus we choose to make the articles with all the
direction needed to make it.

In this project you will learn a lot of things like Ultrasonic sensor, Arduino uno and servo motor, so we
are going to make it possible. The system is very easy to make and very interesting to make.

WHAT IS AUTOMATIC CLOSE AND OPEN-DOOR SYSTEM.

This is the system in which the door will open and close automatically when there is presence of object
or human within its radar.

HOW IT WORKS

The automatic door system use ultrasonic sensor to detect the presences of human or objects within its
radar and send signal to Arduino microcontroller who instructs the servo motor to open the door and
keep it open at a certain period of time while the Lcd will display PLEASE ENTER, and when there is
nothing at the radar the ultrasonic sensor send again the signal to Arduino microcontroller who instruct
the servo motor to close the door automatically and the Liquid crystal will display WELCOME.

Diagram functions
CIRCUIT DIAGRAM

CODE FOR THIS PROJECT

//SMARTKEMBO DISCOVERY SCIENCE

#include<LiquidCrystal.h>
#include<Servo.h>

Servo myservo;

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

int trigPin = 13;

int echoPin = 10;

void setup()

pinMode(trigPin,OUTPUT);

pinMode(echoPin,INPUT);

lcd.begin(16,2);

myservo.attach(9);

Serial.begin(9600);

void loop()

long duration,distance;

digitalWrite(trigPin,LOW);

delayMicroseconds(2);

digitalWrite(trigPin,HIGH);

delayMicroseconds(10);

digitalWrite(trigPin,LOW);

duration = pulseIn(echoPin,HIGH);

distance = (duration/2)/29.412;

if (distance>20)

{
lcd.setCursor(0,0);

lcd.print("WELCOME");

lcd.setCursor(0,2);

lcd.print("DISTANCE:");

lcd.print(">20cm");

else if(distance<=20 || distance>10)

lcd.setCursor(0,0);

lcd.print("PLEASE ENTER");

lcd.setCursor(0,2);

lcd.print("DISTANCE:");

lcd.print(distance);

lcd.print("cm");

if(distance >= 20)

myservo.write(120);

delay(1000);

else

myservo.write(0);

Serial.print("distance");

Serial.println(distance);
delay(100);

Smartkembo discovery science

THANKS, YOU AND WELCOME AGAIN FOR AWASOME PROJECTS

You might also like