Home

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. 

Automatic Door Opener using Arduino and PIR Sensor Image 1
Automatic Door Opener using Arduino and PIR Sensor Image 4
Automatic Door Opener using Arduino and PIR Sensor Image 2
Automatic Door Opener using Arduino and PIR Sensor Image 3

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

Automatic Door Opener using Arduino and PIR Sensor Circuit Diagram

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.

Arduino PIR Sensor Tutorial PIR Sensor 1

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. 

Arduino DC Motor Control using 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).

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.  

  

22 Responses

  1. i want to know how to programm the ardunio ? anybody plz help me, which is the best self learning language app or website ?

      1. hello sir, i have problem….

        the tray always open and close ….on and on…..

        it should be opened when my hand in forint of PIR…, and close whe my hand off….

        please give me your your solution

        thank u

  2. Plz can u help me with the circuit diagram with that of l293d motor driver instead of l298n… Can’t find it

  3. My door opens and closes automatically
    It has to open when I keep my hand and it has to close when I take my hand
    Can u help me with program

  4. I have the same problem as fredega the motor always open and close ….on and on….. it doesn’t stop!!!
    is it possible that the adjusments of the potentiometers from the pir sensor influence the code
    regards

Leave a Reply

Your email address will not be published. Required fields are marked *