Original address: https://circuitdigest.com/microcontroller-projects/automatic-door-opener-project-using-arduino
Automatic door opener using Arduino
Pass by** Saddam **July 12, 2015 96
You must have seen automatic door openers in shopping malls and other commercial buildings. When someone approaches the entrance, they open the door and close it after a period of time. There are many technologies that can be used to manufacture such systems, such as PIR sensor, radar sensor, laser sensor, infrared sensor and so on. In this arduino based project, we tried to replicate the same system by using PIR sensors.
It uses the motion detection sensor (PIR sensor) to open or close the door to detect the infrared energy missing from the human body. When someone comes to the door, the infrared energy detected by the sensor changes. As long as someone approaches the door, it will trigger the sensor to open the door. The signal is further sent to the arduino uno of the control door.
Circuit element
- Arduino UNO
- 16x2 LCD
- Passive infrared sensor
- Connecting line
- Bread board
- 1 k resistance
- Power supply
- Motor driver
- CD case (DVD tray)
Passive infrared sensor
PIR sensor Any heat change is detected, and its output PIN will change to high level whenever a heat change is detected. They are also known as pyroelectric or IR motion sensors.
Here, we should note that each object will emit a certain amount of infrared light when heated. The human body also emits infrared rays due to human body heat. The PIR sensor can detect a small change in infrared. Whenever an object passes through the sensor range, due to the friction between air and the object, it will generate infrared and be captured by PIR.
The main component of PIR sensor is pyroelectric sensor (as shown in the figure) (rectangular crystal behind plastic cover). Together with BISS0001 ("micro power PIR Motion Detector IC"), some resistors, capacitors and other components used to build PIR sensors. The BISS0001 IC receives the input from the sensor and processes it to make the output pin HIGH or LOW accordingly.
The pyroelectric sensor is divided into two halves. When there is no movement, the two halves remain in the same state, which means that they both sense the same infrared level. Once someone enters the upper half, half of the infrared level will become greater than the other half, which will cause the PIR to respond and make the output pin higher.
The pyroelectric sensor is covered by a plastic cover with many Fresnel lens arrays. These lenses are curved, so the sensor can cover a wide range.
Circuit diagram and description
The figure above shows the connection of door opener circuit based on arduino. Here, the PIR sensor is used to sense human motion. The sensor has three terminals Vcc, GND and dout. Dout is directly connected to pin 14 (A0) of arduino uno. 16x2 LCD is used to display status. RS, EN pin and data pin D0-D7 of LCD connected to 13 and 12 of arduino are connected to digital pins 11, 10, 9 and 8 of arduino. RW is directly grounded. The L293D motor driver is connected to arduino pins 0 and 1 for opening and closing the door. In the circuit, we use the door motor.
Programming instructions
The concept used here for programming is very simple. In the program, we only use digital input and output.
DigitalRead is used to read the output of the PIR sensor.
Thereafter, if the PIR sensor detects any movement, the program sends a command to open the gate, stop the gate, close the gate and stop the gate.
Please refer to the complete code of automatic door opener based on arduino below.
#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.setCursor(0,1); lcd.print(" Door Opener "); delay(3000); lcd.clear(); lcd.print("CIRCUIT DEGEST "); delay(2000); } void loop() { if(digitalRead(PIR_sensor)) { lcd.setCursor(0,0); lcd.print("Movement Detected"); lcd.setCursor(0, 1); lcd.print(" Gate Opened "); digitalWrite(m11, HIGH); // gate opening digitalWrite(m12, LOW); delay(1000); digitalWrite(m11, LOW); // gate stop for a while digitalWrite(m12, LOW); delay(1000); lcd.clear(); lcd.print(" Gate Closed "); digitalWrite(m11, LOW); // gate closing digitalWrite(m12, HIGH); delay(1000); digitalWrite(m11, LOW); // gate closed digitalWrite(m12, LOW); delay(1000); } else { lcd.setCursor(0,0); lcd.print(" No Movement "); lcd.setCursor(0,1); lcd.print(" Gate Closed "); digitalWrite(m11, LOW); digitalWrite(m12, LOW); } }