Projects Based On Automatic Door Sensor

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

Automatic Door Opener using Arduino

and PIR Sensor


An Automatic Door Opener System is a simple project based on PIR
Sensor and Arduino, which automatically opens and closes the door by
detecting a person or object.

You might have seen Automatic Door Opener Systems at shopping malls,
cinemas, hospitals etc. where, as soon as a person approaches the door
(at about 2 or 3 feet), the door automatically slides open. And after some
time (about 5 to 10 seconds), the door closes by sliding in the reverse
direction.

Such Automatic Door Opener Systems are very useful as you do not need
a person to standby the door and open it whenever a guest comes. Also,
since the doors are opened and closed only when a person approaches the
door, there is significantly less loss of air conditioning.

So, in order to understand the potential of this concept, we have


implemented a simple Automatic Door Opener System using Arduino and
PIR Sensor. 
Table of Contents
 Overview
 Circuit Diagram of Automatic Door Opener System
 Components Required for Automatic Door Opener System
 Component Description
o Arduino UNO
o PIR Sensor
o L298N Motor Driver Module
 Circuit Design
 Code
 Working of Automatic Door Opener System
 Applications
Overview
In the Automatic Door Opening System, the main component or hardware
is the sensor which detects the persons (well, the motion of the person in
our case). For this purpose, we will be using the PIR Motion Detector
Sensor.

We have already seen in the Arduino PIR Sensor Tutorial about how a PIR
Sensor Works and how to interface a PIR Sensor to an Arduino.
Before continuing with this project, I suggest you to take a look at
the Arduino PIR Sensor Tutorial.

For the purpose of demonstration, I have used a CD Tray to replicate the


door. Whenever the PIR Sensor detects a motion, the CD Tray opens and
then closes after some time.

In order to control the 5V DC motor in the CD Tray, I’ve used the L298N
Motor Driver Module. I’ve already done a tutorial on controlling a DC Motor
using Arduino and L298N Motor Driver Module.

Also read: Arduino DC Motor Control using L298N    

Circuit Diagram of Automatic Door Opener System

Components Required for Automatic Door Opener


System
 Arduino UNO  [Buy Here]
 PIR Sensor  
 L298N Motor Driver Module  [Buy Here]
 CD Tray with 5V Motor
 Breadboard  
 Connecting Wires  
 Power Supply  

Component Description
Arduino UNO
In this project, Arduino UNO acts as the main controlling part. It reads the
data from the PIR Sensor and activates the L298N Motor Driver based on
the data from the PIR Sensor.  

PIR Sensor
Detecting human motion is done with the help of PIR Sensor.

L298N Motor Driver Module


Motor Driver is an important part of the project as it is responsible for
driving the motor of the door (CD Tray Motor in this case). In this project,
we have used the very common and very popular L298N Motor Driver
Module. 
Circuit Design
First, the Data OUT of the PIR Sensor is connected to Digital Pin 8 of
Arduino. The other two pins of PIR Sensor i.e. Vs and GND are connected
to +5V and GND respectively.

Coming to the Motor Driver, we have used the second channel of the
L298N Motor Driver Module. Hence, the IN3 and IN4 of the L298N Motor
Driver are connected to Digital Pins 2 and 3 of Arduino.

The Enable Pin of the Second Motor on the L298N Module us connected to
+5V. Usually, all the L298N Modules consists of a jumper to directly
connected the Enable pins to +5V. You can use this option.

Since the motor used in the project is a 5V Motor, I’ve connected a 5V


Supply to the Motor Driver Module.

Finally, the Motor of the CD Tray is connected to the OUT3 and OUT4 of
L298N Motor Driver Module.   
Code
The code for the project is given below. It can be used with any Arduino
Board (Arduino UNO, Arduino Nano or Arduino Mega).

int in1 = 2;
int in2 = 3;
int sensor = 8;
int led = 13;

void setup()
{
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(sensor, INPUT);
pinMode(led, OUTPUT);

digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
//digitalWrite(sensor,LOW);
digitalWrite(led,LOW);

while(millis()<13000)
{
digitalWrite(led,HIGH);
delay(50);
digitalWrite(led,LOW);
delay(50);
}
digitalWrite(led,LOW);
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);

void loop()
{
if(digitalRead(sensor)==HIGH)
{
digitalWrite(in1,HIGH);
digitalWrite(in2,LOW);
digitalWrite(led,HIGH);
delay(2000);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);

digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
digitalWrite(led,LOW);
delay(2000);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);

Working of Automatic Door Opener System


The working of the Automatic Door Opener System using Arduino and PIR
Sensor is very simple. This project can be considered as an extension of
Arduino PIR Sensor Tutorial and Arduino L298N DC Motor Control Tutorial.

When the PIR Sensor detects any motion of a person, its Data OUT Pin will
become HIGH. As this pin is connected to the Arduino, it will detect this
HIGH Signal and understands that there is person approaching the door.

Arduino then immediately activates the L298N Motor Driver module to open
the door. After some time (about 2 to 5 seconds in this project), the Arduino
will once again activate the Motor Drive to close the door.      

Applications
 Arduino based Automatic Door Opener System is a very useful
project as it enables you to understand the concept of such automatic
door opener systems and how they work.
 These systems are already being used in many places like malls,
theatres and hospitals.
 You can implement this Arduino based project at you home in
Garage Door Openers, toilet cover openers, Office door openers, etc.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy