67% found this document useful (3 votes)
3K views16 pages

Auto Door Using Arduino

This document describes an automatic door opening and closing system using an Arduino Uno microcontroller, servo motor, PIR motion sensor, jumper wires, and battery. The system uses a PIR sensor to detect human movement and signals the Arduino to open or close the door via a servo motor. When someone approaches the door, the PIR sensor detects the infrared radiation from their body and sends a signal to the Arduino, which activates the servo motor to open the door. When the person moves away from the door, the PIR sensor no longer detects movement and sends another signal to the Arduino to close the door with the servo motor. The system provides automatic door operation for commercial or other buildings based on motion detection.

Uploaded by

Ayeshá Khán
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
3K views16 pages

Auto Door Using Arduino

This document describes an automatic door opening and closing system using an Arduino Uno microcontroller, servo motor, PIR motion sensor, jumper wires, and battery. The system uses a PIR sensor to detect human movement and signals the Arduino to open or close the door via a servo motor. When someone approaches the door, the PIR sensor detects the infrared radiation from their body and sends a signal to the Arduino, which activates the servo motor to open the door. When the person moves away from the door, the PIR sensor no longer detects movement and sends another signal to the Arduino to close the door with the servo motor. The system provides automatic door operation for commercial or other buildings based on motion detection.

Uploaded by

Ayeshá Khán
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Automatic door opening and closing System

Final project
5th semester

Automatic door opening


and closing system

s
H
d
a
m
h
.A
r
g
n
E
Automatic door opening and closing System

Abstract:
Auto door opening and closing system is a very simple system in which door is
controlled using PIR Sensor. This project demonstrates the principle and operation of
application based on different PIR sensor Arduino UNO R3 and Servo motor circuit. In this
circuit we have learnt the basic operation and applications of PIR sensor, the different
operating of Arduino UNO R3 and operating of the Servo motor SG90. The circuit is divided
into three parts: Input, microcontroller and output.
Automatic door opening and closing System

Table of Contents
Automatic Door opening and closing System
Title page
Abstract:----------------------------------------------------------------------------------------------------------------------- i
Table of Contents----------------------------------------------------------------------------------------------------------- ii
Table of figures:------------------------------------------------------------------------------------------------------------ iii
1. Introduction:----------------------------------------------------------------------------------------------------------- 1
2. Components:----------------------------------------------------------------------------------------------------------- 1
2.1. Aurduino UNO R3:-------------------------------------------------------------------------------------------- 1
2.2. Servo Motor:---------------------------------------------------------------------------------------------------- 2
2.3. Battery:----------------------------------------------------------------------------------------------------------- 4
2.4. PIR motion sensor:--------------------------------------------------------------------------------------------- 4
2.5. Jumper wires:--------------------------------------------------------------------------------------------------- 5
3. Theory:------------------------------------------------------------------------------------------------------------------ 6
3.1. Construction:---------------------------------------------------------------------------------------------------- 6
3.1.1. Schematic:------------------------------------------------------------------------------------------------------ 6
3.1.2. Connections:--------------------------------------------------------------------------------------------------- 6
3.1.3. Code:[10]--------------------------------------------------------------------------------------------------------- 7
3.2. Working Principle:------------------------------------------------------------------------------------------- 10
4. Observations:-------------------------------------------------------------------------------------------------------- 10
5. Precautions:---------------------------------------------------------------------------------------------------------- 10
6. Applications:--------------------------------------------------------------------------------------------------------- 11
7. Advantages:---------------------------------------------------------------------------------------------------------- 11
8. Deliverable:---------------------------------------------------------------------------------------------------------- 11
9. Enhancement:-------------------------------------------------------------------------------------------------------- 11
10. Conclusion:------------------------------------------------------------------------------------------------------- 11
References:------------------------------------------------------------------------------------------------------------------ 12
Automatic door opening and closing System

Table of figures:
Figure 1.Arduino UNO R3......................................................................................................................2
Figure 2.Servo Motor SG90....................................................................................................................3
Figure 3. Pin configuration for Servo motor..........................................................................................3
Figure 4.Servo motor measurements....................................................................................................3
Figure 5. Battery connector...................................................................................................................4
Figure 6. Battery 9V...............................................................................................................................4
Figure 7. PIR Motion sensor...................................................................................................................5
Figure 8. PIR sensor configuration.........................................................................................................5
Figure 9. Jumper Wires..........................................................................................................................6
Figure 10. Auto door system Schematic diagram..................................................................................6
Figure 11.circuit diagram.......................................................................................................................7
Automatic door opening and closing system
1. Introduction:
The automatic door opening systems are used in commercial buildings,
shopping malls, theatres, etc. These systems are used to open the door when a person comes
near to the entrance of the door and close it after he moves away from the door or after
entered into the door. There are various kinds of sensors are available in the market to make
such types of systems such as Radar sensors, PIR sensors, Infrared sensors and Laser sensors,
etc. This project uses a PIR sensor to open or close the door automatically which senses the
infrared energy produced by the human body.
When someone approaches the door, the IR energy sensed by the PIR sensor changes and
activates the sensor to open and close the door automatically. Further, the signal sent to
microcontroller to control the door.

2. Components:
The following components are used in this project:
Table 1.components table

Arduino UNO 3 1 -
Battery 1 9v
Servo motor 1 9g,SG90
PIR motion sensor 1 -
Jumper wires 10-20 -

2.1. Aurduino UNO R3:


Arduino is an open source computer hardware and software company, project,
and user community that designs and manufactures single-board microcontrollers and
microcontroller kits for building digital devices and interactive objects that can sense
and control objects in the physical world. The project's products are distributed as open-
source hardware and software, which are licensed under the GNU Lesser General
Public License (LGPL) or the GNU General Public License (GPL),[1] permitting the
manufacture of Arduino boards and software distribution by anyone. Arduino boards
are available commercially in preassembled form, or as do-it-yourself (DIY) kits.
Arduino board designs use a variety of microprocessors and controllers. The boards are
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced
to various expansion boards (shields) and other circuits. The boards feature serial
communications interfaces, including Universal Serial Bus (USB) on some models,
which are also used for loading programs from personal computers. The
microcontrollers are typically programmed using a dialect of features from the
programming languages C and C++. In addition to using traditional compiler tool
chains, the Arduino project provides an integrated development environment (IDE)
based on the Processing language project.
Automatic door opening and closing System

The Arduino project started in 2003 as a program for students at the Interaction Design
Institute Ivrea in Ivrea, Italy,[2] aiming to provide a low-cost and easy way for novices
and professionals to create devices that interact with their environment using sensors
and actuators. Common examples of such devices intended for beginner hobbyists
include simple robots, thermostats, and motion detectors.
The name Arduino comes from a bar in Ivrea, Italy, where some of the founders of the
project used to meet. The bar was named after Arduino of Ivrea, who was the margrave
of the March of Ivrea and King of Italy from 1002 to 1014.[3]

This is the new Arduino Uno R3. In addition to all the features of the previous board,
the Uno now uses an ATmega16U2 instead of the 8U2 found on the Uno (or the FTDI
found on previous generations). This allows for faster transfer rates and more memory.
No drivers needed for Linux or Mac (.inf file for Windows is needed and included in
the Arduino IDE), and the ability to have the Uno show up as a keyboard, mouse,
joystick.

The Uno R3 also adds SDA and SCL pins next to the AREF. In addition, there are two
new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt
to the voltage provided from the board. The other is a not connected and is reserved for
future purposes. The Uno R3 works with all existing shields but can adapt to new
shields which use these additional pins.

Figure 1.Arduino UNO R3

2.2. Servo Motor:


A servomotor is a rotary actuator or linear actuator that allows for precise
control of angular or linear position, velocity and acceleration.[4] It consists of a suitable
motor coupled to a sensor for position feedback. It also requires a relatively
sophisticated controller, often a dedicated module designed specifically for use with
servomotors.
Servomotors are not a specific class of motor although the term servomotor is often
used to refer to a motor suitable for use in a closed-loop control system.
Automatic door opening and closing System

Servomotors are used in applications such as robotics, CNC machinery or automated


manufacturing.
A servomotor is a closed-loopservomechanism that uses position feedback to control its
motion and final position. The input to its control is a signal (either analogue or digital)
representing the position commanded for the output shaft. A servomotor consumes
power as it rotates to the commanded position but then the servomotor rests.

Figure 2.Servo Motor SG90

Figure 3. Pin configuration for Servo motor

Figure 4.Servo motor measurements

Table 2.specifications of Servo motor SG90

 Weight(g) 9
 Torque(kg)(4.8v)  1.8
 Speed(sec/60deg)  0.1
 A(mm)  34.5
 B(mm)  22.8
 C(mm)  26.7
 D(mm)  12.6
 E(mm)  32.5
 F(mm)  16
Operating voltage: 4.8 V (~5V)
Dead band width: 10 μs
Automatic door opening and closing System

2.3. Battery:
An electric battery is a device consisting of one or more electrochemical cells
with external connections provided to power electrical devices such as flashlights,
smartphones, and electric cars.[5]When a battery is supplying electric power, its positive
terminal is the cathode and its negative terminal is the anode.[6] The terminal marked
negative is the source of electrons that when connected to an external circuit will flow
and deliver energy to an external device. When a battery is connected to an external
circuit, electrolytes are able to move as ions within, allowing the chemical reactions to
be completed at the separate terminals and so deliver energy to the external circuit. It is
the movement of those ions within the battery which allows current to flow out of the
battery to perform work.[7]Historically the term "battery" specifically referred to a
device composed of multiple cells, however the usage has evolved additionally to
include devices composed of a single cell.[8]

Figure 5. Battery connector

Figure 6. Battery 9V

2.4. PIR motion sensor:


PIR sensor detects any change in heat, and whenever it detects any change, its
output PIN becomes HIGH. They are also referred as Pyro electric or IR motion
sensors.
Here we should note that every object emits some amount of infrared when heated.
Human also emits infrared because of body heat. PIR sensors can detect small amount
of variation in infrared. Whenever an object passes through the sensor range, it
produces infrared because of the friction between air and object, and get caught by PIR.
The main component of PIR sensor is Pyro electric sensor shown in figure (rectangular
crystal behind the plastic cap). Along with BISS0001 ("Micro Power PIR Motion
Automatic door opening and closing System

Detector IC"), some resistors, capacitors and other components used to build PIR
sensor. BISS0001 IC take the input from sensor and does processing to make the output
pin HIGH or LOW accordingly.
Pyro electric sensor divide in two halves, when there is no motion, both halves remain
in same state, means both senses the same level of infrared. As soon as somebody enters
in first half, the infrared level of one half becomes greater than other, and this causes
PIRs to react and makes the output pin high.
Pyro electric sensor is covered by a plastic cap, which has array of many Fresnel Lens
inside. These lenses are curved in such a manner so that sensor can cover a wide range.

Figure 7. PIR Motion sensor

Figure 8. PIR sensor configuration

2.5. Jumper wires:


A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire, or
DuPont cable – named for one manufacturer of them) is an electrical wire or group of
them in a cable with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of a
Automatic door opening and closing System

breadboard or other prototype or test circuit, internally or with other equipment or


components, without soldering.[9]
Individual jump wires are fitted by inserting their "end connectors" into the slots
provided in a breadboard, the header connector of a circuit board, or a piece of test
equipment.

Figure 9. Jumper Wires

3. Theory:
This project is based on its construction and working.
3.1. Construction:
In this project we followed the following steps:
3.1.1. Schematic:
The schematic explains the basic working of the auto door. PIR sense and
generate signal while getting the sense of human and the Arduino send it to motor and
rotate it according to requirements.

Figure 10. Auto door system Schematic diagram

3.1.2. Connections:
After getting the material we made the connections of the circuits by following
steps.
 Firstly we connected the PIR out pin to pin 12 on Arduino
 Then connected the PIR VCC to pin 13 of Arduino
Automatic door opening and closing System

 After that we connected the PIR Ground pin to Ground pin on Arduino
 After connecting the PIR sensor we connected the servo motor signal pin
to pin 4 on Arduino
 After that we connected the VCCto 5V pin and ground to ground pin on
Arduino.
 After that we burned the code given below on the Arduino using
software and monitor it.
 After that we connected a battery to the Arduino and tested the circuit
and observed the requirements according to which it was made.
 At the end we make the sample of house and install the circuit in it and
check the working of door.

Figure 11.circuit diagram

3.1.3. Code:[10]
#include <Servo.h>

Servo myservo; //creates a servo object

//a maximum of eight servo objects can be created

int pos = 0; //variable to store servo position

//amount of time we give the sensor to calibrate (10-60 secs according to the datasheet)

int calibrationTime = 20;

//the time when the sensor outputs a low impulse

long unsigned int lowIn;

//the amount of milliseconds the sensor has to be low

//before we assume all motion has stopped

long unsigned int pause = 5000;

boolean lockLow = true;

boolean takeLowTime;

int pirPin = 12; //digital pin connected to the PIR's output

int pirPos = 13; //connects to the PIR's 5V pin


Automatic door opening and closing System

void setup(){

myservo.attach(4); //attaches servo to pin 4

Serial.begin(9600); //begins serial communication

pinMode(pirPin, INPUT);

pinMode(pirPos, OUTPUT);

digitalWrite(pirPos, HIGH);

//give the sensor time to calibrate

Serial.println("calibrating sensor ");

for(int i = 0; i < calibrationTime; i++){

Serial.print(calibrationTime - i);

Serial.print("-");

delay(500);

Serial.println();

Serial.println("done");

//while making this Instructable, we had some issues with the PIR's output

//going HIGH immediately after calibrating

//this waits until the PIR's output is low before ending setup

while (digitalRead(pirPin) == HIGH) {

delay(200);

Serial.print(".");

Serial.print("SENSOR ACTIVE");

void loop(){

if(digitalRead(pirPin) == HIGH){ //if the PIR output is HIGH, turn servo

/*turns servo from 0 to 180 degrees and back it does this by increasing the variable "pos"
by 1 every 5 milliseconds until it hits 180 and setting the servo's position in degrees to
"pos" every 5 milliseconds it then does it in reverse to have it go back to learn more about
this, google "for loops" to change the amount of degrees the servo turns, change the
number 180 to the number of degrees you want it to turn **/

for(pos = 0; pos < 180; pos += 1) //goes from 0 to 180 degrees


Automatic door opening and closing System

{ //in steps of one degree

myservo.write(pos); //tells servo to go to position in variable "pos"

delay(5); //waits for the servo to reach the position

delay(2000); //delay to wait the door to enter the person

for(pos = 180; pos>=1; pos-=1) //goes from 180 to 0 degrees

myservo.write(pos); //to make the servo go faster, decrease the time in delays for

delay(15); //to make it go slower, increase the number.

if(lockLow){

//makes sure we wait for a transition to LOW before further output is made

lockLow = false;

Serial.println("---");

Serial.print("motion detected at ");

Serial.print(millis()/1000);

Serial.println(" sec");

delay(50);

takeLowTime = true;

if(digitalRead(pirPin) == LOW){

if(takeLowTime){

lowIn = millis(); //save the time of the transition from HIGH to LOW

takeLowTime = false; //make sure this is only done at the start of a LOW phase

//if the sensor is low for more than the given pause,

//we can assume the motion has stopped

if(!lockLow && millis() - lowIn > pause){

//makes sure this block of code is only executed again after

//a new motion sequence has been detected


Automatic door opening and closing System

lockLow = true;

Serial.print("motion ended at "); //output

Serial.print((millis() - pause)/1000);

Serial.println(" sec");

delay(20);

3.2. WorkingPrinciple:
This proposed system uses a PIR sensor to sense the human body movement
near to the door. Generally a human body emits infrared energy in the form of heat, which is
detected by the PIR sensor from a particular distance. Then the sensing signal is fed to a
microcontroller to function a door motor via motor driver IC.
When a live body approaches in the operating range of the PIR sensor, it sends a signal to
open the door. The door routinely closes with a particular time delay. If there is no extra
movement within the operating range of a PIR sensor. Interrupt indications are used through
limit switches to avoid the motor’s locked rotor condition.

4. Observations:
We observed that when someone approaches the door, the IR energy sensed by
the PIR sensor changes and activates the sensor to open and close the door automatically.
Further, the signal sent to microcontroller to control the door.

5. Precautions:
Every human made thing is not perfect so to work it properly we need some
precaution for our own safety and for the thing safety. There are following precaution which
should be taken to make the circuit work properly.
 Make sure that all the connection are done properly.
 Don’t make the circuit oily or moisture.
 Put the circuit in a proper box so that it wouldn’t be damaged by the touch of any
metal or other conductor or hard material and also does not get any motion
detection out of requirement.
 Make the battery change when it is discharged.
 Don’t use the battery near the flame as it may explode.
 Give proper calibration time to sensor.
 Give the rotation properly to servo
 Burn the code on Arduino properly

6. Applications:
This project can be used in many applications such as:
Automatic door opening and closing System

 Automatic door opening and closing system is used where a person is always
required to open the door for visitors such as hotels, shopping malls and theatres.
 It can be used to create a motion activated nerf gun.

7. Advantages:
 For people Inwheelchairs and other disabled individuals, automatic doors are an
immense bone.
 Opening and closing of doors have been always a boring job, especially in places
where a person is always required to open the door for visitors such as hotels,
shopping malls and theatres. Here is a solution to open and close the door i.e,
movement sensed automatic door opening and closing system.
 In hospitals and specific labs, automatic doors can be used to secure an area by
ensuring that the doors are shut all times ,while reducing the risk of cross-
contamination since people do not need to handle the doors to pass through them
 Automatic doors can also be useful in warehouses and other facilities where
people frequently have their hands full, contributing to safety and efficiency by
making it easier for people to get around.

8. Deliverable:
This circuit takes a motion to sense and generate a signalthen process it and at
the end makes an output bygiving the rotation to motor. It is easier to get rid of opening the
door by hand.

9. Enhancement:
This circuit can be used in many future applications related to the automatic
working based on motion detection. We can modify the circuit as per our requirements by
changing the output motors and PIR sensor according to the sensitivity level.Coding to get
our required output or working. Moreover, the proposed system can be developed by
interfacing a counting arrangement to count the entry and exit of people at a specific place.
This can be accomplished by interfacing an EEPROM to store the data when there is no
power.

10. Conclusion:
From this project we concluded the things which make us to understand the
basic phenomenon of the working of PIR sensor, Arduino UNO and Servo motors. This
projectdemonstrated the sensitivity of PIR sensor, working of Arduino and Servo motor
circuit which works properly in its circumstances.
Automatic door opening and closing System

References:
[1
"Arduino - Introduction". arduino.cc.
[2
David Kushner (2011-10-26). "The Making of Arduino". IEEE Spectrum.
[3]
Justin Lahart (27 November 2009). "Taking an Open-Source Approach to Hardware". The Wall
Street Journal. Retrieved 2014-09-07.
[4]
Internet:http://www.princeton.edu/~mae412/TEXT/NTRAK2002/292-302.pdf
[5]
Crompton, T. R. (2000-03-20). Battery Reference Book (third ed.). Newnes. p. Glossary 3.
ISBN 0080499953. Retrieved 2016-03-18.
[6]
Pauling, Linus (1988). "15: Oxidation-Reduction Reactions; Electrolysis.". General Chemistry.
New York: Dover Publications, Inc. p. 539. ISBN 978-0-486-65622-9.
[7]
"Battery - Definition of battery by Merriam-Webster". merriam-webster.com.
[8]
Pistoia, Gianfranco (2005-01-25). Batteries for Portable Devices. Elsevier. p. 1.
ISBN 0080455565. Retrieved 2016-03-18.
[9]
Internet:Jump wire patents
[10]
Internet:http://www.instructables.com/id/Motion-Activated-Servo/

You might also like