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.
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
- PIR Sensor
- L298N Motor Driver Module
- CD Tray with 5V Motor
- Connecting Wires
- Power Supply
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.
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.
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.
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.
- 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.