LAB Project

Movement Sensed Automatic Door Opener Using Arduino uno r3

ABSTRACT

  • The main aim of the project is to design and implement the automatic door opening system.
  • This project describes the design and implementations of an Arduino for the door.
  • The door opens when any movement is detected near the door. A PIR sensor detects the movement and sends a signal to the Arduino which opens the door for a particular amount of time according to the program.
  • Interrupt signals are used to stop power to the motor in the event of locked rotor condition.

PROJECT BLOCK DIAGRAM

HARDWARE REQUIREMENTS

  • Ardunio UNO
  • 16X2 LCD
  • PIR Sensor
  • Motor Driver
  • Connecting Wires
  • DOT Board
  • 1 K Resistor
  • Power Supply (5V, USB)
  • Motor

ARDUNIO UNO R3

  • It is a microcontroller board based on the ATmega328p.Has on 14 digital I/O pins (of which 6 can be used as PWN Outputs), a USB connection, a power jack, an ICSP Header and a reset button.

FEATURES OF ARDUNIO UNO R3

  • Microcontroller: ATmega328
  • Operating Voltage: 5V
  • Input Voltage (recommended): 7-12V
  • Input Voltage (limits):6-20V
  • Digital I/O Pins: 14 (of which 6 provide PWM output)
  • Analog Input Pins: 6
  • DC Current per I/O Pin: 40 mA
  • DC Current for 3.3V Pin: 50 mA
  • Flash Memory: 32 KB of which 0.5 KB used by boot-loader
  • SRAM: 2 KB (ATmega328)
  • EEPROM: 1 KB (ATmega328)
  • Clock Speed: 16 MHz

INTERNAL PIN STRUCTURE OF AN ARDUINO UNO R3

PIN DESCRIPTION OF AN ARDUINO UNO R3

 

 

MOTOR DRIVER (L293D)

FEATURES:

  • Wide supply-voltage range: 4.5V to 36V
  • Separate input- logic supply
  • Internal ESD protection
  • Thermal shutdown
  • High-Noise-Immunity input
  • Functional Replacements for SGS L293 and SGS L293D
  • Output current 1A per channel (600 mA for L293D)
  • Peak output current 2 A per channel (1.2 A for L293D)
  • Output clamp diodes for Inductive Transient suppression(L293D)

DESCRIPTION

  • L293D is a dual H-bridge motor driver integrated circuit (IC).
  • In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction.
  • The motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15.
  • Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions, respectively.
  • Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable input is high, the associated driver gets enabled.

DC- MOTOR

  • A DC motor is an electric motor that runs on direct current (DC) electricity. In any electric motor, operation is based on simple electromagnetism.
  • A simple 2-pole DC electric motor (here red represents a magnet or winding with a “North” polarization, while green represents a magnet or winding with a “South” polarization).
  • Every DC motor has six basic parts — axle, rotor (a.k.a., armature), stator, commutator, field magnet(s), and brushes.

PIR SENSORS

  • The PIR (Passive Infra-Red) Sensor is a Pyroelectric device that detects motion by measuring changes in the infrared levels emitted by surrounding objects. This motion can be detected by checking for a high signal on a single I/O pin.
  • Apparent motion is detected when an infrared source with one temperature, such as a human, passes in front of an infrared source with another temperature, such as a wall.

Features:

  • Single bit output.
  • Small size makes it easy to conceal.
  • Complete with PIR, Motion Detection.
  • Supply Voltage – 5V.
  • Delay TimeAdjustable.
  • Standard TTLOutput.
  • Dual Element Sensor with Low Noise and High Sensitivity.

 

  • The PIR sensor IC consists of 3 pins- Vcc, Ground and Output.
  • A PIR or a Passive Infrared Sensor can be used to detect presence of human beings in its proximity. The output can be used to control the motion of door.
  • Basically motion detection use light sensors to detect either the presence of infrared light emitted from a warm object or absence of infrared light when an object interrupts a beam emitted by another part of the device.
  • A PIR sensor detects the infrared light radiated by a warm object. It consists of pyro electric sensors which introduce changes in their temperature (due to incident infrared radiation) into electric signal. When infrared light strikes a crystal, it generates an electrical charge.

Working of project

  • Connections for arduino based door opener circuit 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.
  • A16x2 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. Here in circuit we have used a motor for gate. The program is so returned that it delivers appropriate input to the driver IC L293D as explained above, to run the motor as it indicate if motor rotates one direction and vice versa indicating door open and close.

Software Requirements

  • The concept used here for programming is very simple. In program we have only used digital input output.
  • DigitalRead is used for reading output of PIR sensor.
  • After that, if PIR sensor senses any motion then program sends a command to open door, stop door, closing door and stop door.

Let’s see the program……………

Program with details (C Program).

#include <stdio.h>                   // C header.
#include <conio.h>                  // C header.
#include <LiquidCrystal.h>     // to use liquid crystal library.
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);            // Defines which pins of Arduino are to be connected to which pins of LCD display.
#define PIR_sensor 14 //variable declaration.
#define m11 0             //variable declaration.
#define m12 1             //variable declaration.
void setup()                 //structure (main function).
{
lcd.begin(16, 2);        //indicates no of columns and rows.
pinMode(m11, OUTPUT);     //set pin to output.
pinMode(m12, OUTPUT);     //set pin to output.
pinMode(PIR_sensor, INPUT);          //set pin to input.
lcd.print(”    Automatic    “);             //display message.
lcd.setCursor(0,1);    //set the cursor to column 0 an row 1.
lcd.print(”   Door Opener   “);           //display message.
delay(3000);              //pause the program.
lcd.clear();     //clears the lcd screen.
lcd.print(”   CIRCUIT BY  “);               //display message.
lcd.setCursor(0,1);                //set the cursor to column 0 an row 1.
lcd.print(”     CSE_161   “);                //display message.
delay(2000);              //pause the program 2 sec.
}
void loop()       //loop function continuously executes the codes (i.e. reading inputs and triggering outputs).
{
if(digitalRead(PIR_sensor))               //read the value from specified digital pin with result either LOW or HIGH.
{
lcd.setCursor(0,0);  //set the cursor to top left corner.
lcd.print(“Movement Detected”);               //display message.
lcd.setCursor(0, 1);             //set the cursor to top bottom left corner.
lcd.print(”   Door Opened    “);       //display message.
digitalWrite(m11, HIGH);         //display message Door opening.
digitalWrite(m12, LOW);
delay(1000);            //pause the program for 1 sec.
digitalWrite(m11, LOW);          //Door stop for a while(no movement).
digitalWrite(m12, LOW);
delay(2000);            //pause the program for 2 sec.
lcd.clear();               //clears the lcd screen.
lcd.print(”   Door Closed    “);         //display message.
digitalWrite(m11, LOW);
digitalWrite(m12, HIGH);           // Door closing.
delay(1000);
digitalWrite(m11, LOW);            // Door closed.
digitalWrite(m12, LOW);
delay(1000);            //pause the program for 1 sec.
}
else
{
lcd.setCursor(0,0);              //set the cursor to top left corner.
lcd.print(”   No Movement   “);       //display message.
lcd.setCursor(0,1);              //set the cursor to bottom left corner.
lcd.print(”   Door Closed   “);          //display message.
digitalWrite(m11, LOW);
digitalWrite(m12, LOW);    //no movement of gate.
}
}
Programmed By
 Sarwar Hossain

  • We need to download the Arduino Software package for our operating system we’ve downloaded and opened the application we should see something like this:
  • This is where we type the code, we want to compile and send to the Arduino board.
    • The Initial Setup
    • We need to setup the environment to Tools menu

    And select Board.

     

    • Then select the type of Arduino we want to program, in our case it’s the Arduino Uno.
    • Type program and click the upload button.Now times to see the practical project……….

 

Leave a comment