How to make Automatic Door Opener Using Arduino UNO?

Programming, Tutorial, Coding, New Design, and/or any project for your Arduino and Raspberry Pi can post your topic /suggestion here.
User avatar
Posts: 12
Joined: Fri Mar 17, 2017 2:17 pm

How to make Automatic Door Opener Using Arduino UNO?

Fri Aug 31, 2018 2:08 am

You must have seen automatic door openers in shopping malls and other commercial buildings. They open the door when someone comes near the entrance and close it after sometime. A number of technologies are available to make such kinds of systems like PIR sensors, Radar sensors, Laser sensors, Infrared sensors, etc. In this arduino based project, we have tried to replicate the same system by using a PIR sensor.
Here is the Circuit Diagram of our Project
Automatic-Door-Opener.gif (32.68 KiB) Viewed 2297 times
Circuit Components we need:
- Arduino UNO
- 16x2 LCD
- PIR Sensor
- Connecting wires
- Breadboard
- 1 k resistor
- Power supply
- Motor driver
- CD case (DVD Troly)

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.
PIR-MOTION-DETECTOR-SENOR.jpg (68.78 KiB) Viewed 2297 times
The main component of PIR sensor is Pyroelectric sensor shown in figure (rectangular crystal behind the plastic cap). Along with BISS0001 ("Micro Power PIR Motion 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.
pyroelectric-infrared-pir-motion-sensor.jpg (37.68 KiB) Viewed 2297 times
Pyroelectric 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.

Pyroelectric 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.

Connections for arduino based door opener circuit are shown in the above diagram. Here a PIR sensor is used for sensing human motion which has three terminals Vcc, GND and Dout. Dout is directly connected to pin number 14 (A0) of arduino uno. A 16x2 LCD is used for displaying the status. RS, EN pins of LCD connected to 13 and 12 of arduino and data pins D0-D7 are connected to arduino digital pin numbers 11, 10, 9, 8. RW is directly connected to ground. L293D motor driver is connected to arduino pin 0 and 1 for opening and closing the gate.

See below the complete code for arduino based automatic door opener.:

Code: Select all

#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

#define PIR_sensor 14
#define m11 0
#define m12 1

void setup() 
  lcd.begin(16, 2);
  pinMode(m11, OUTPUT);
  pinMode(m12, OUTPUT);
  pinMode(PIR_sensor, INPUT);
  lcd.print("    Automatic    ");
  lcd.print("   Door Opener   ");
  lcd.print("Dohangout.Com Project");

void loop() 
    lcd.print("Movement Detected");
    lcd.setCursor(0, 1);
    lcd.print("    Gate Opened    ");
    digitalWrite(m11, HIGH);         // gate opening
    digitalWrite(m12, LOW);
    digitalWrite(m11, LOW);          // gate stop for a while
    digitalWrite(m12, LOW);
    lcd.print("   Gate Closed    ");
    digitalWrite(m11, LOW);           // gate closing
    digitalWrite(m12, HIGH);
    digitalWrite(m11, LOW);            // gate closed
    digitalWrite(m12, LOW);
    lcd.print("   No Movement   ");
    lcd.print("   Gate Closed   ");
    digitalWrite(m11, LOW);
    digitalWrite(m12, LOW);
We use the CD-rom drive just to replicate the door opener but you can amplify this to the real door for your bedroom or to your own door house it self. I hope you like it.