SHARE YOUR KNOWLEDGE

                                                                   

                                                            DOWNLOAD

Breaking

WELCOME TO ALL IN ALL INFOS. OUR GOAL IS TO SHARE THE KNOWLEDGE TO EVERYONE

Monday, 27 August 2018

PIR SECURITY SYSTEM USING ARDUINO AND LCD

OBJECTIVES:

        The goals of the motion alarm system are to detect heat movements in a specified area triggering a siren/buzzer to sound. This design promotes added control to the crime rate of the regulated work environment after hours of work operation.

DESCRIPTION:

         The need for motion sensing alarm systems nowadays is a serious demand As the number of crimes are increasing every day, there has to be something that will keep us safe. We are all aware of the high end security systems present in the market but they are not easily available to everyone. We therefore intend to provide a solution by constructing a cost efficient electronic system that has the capability of sensing the motion of the intruders and setting on the alarm. The basic idea behind this project is that all the bodies generate some heat energy in the form of infrared which is invisible to human eyes. But, it can be detected by electronic motion sensor.

COMPONENTS REQUIRED:

   Arduino Mega 2560 or UNO  
   L.E.D·  P.I.R Sensor Module 
  9V Battery and  Clip 
   L.C.D(16 X 2)
  Piezo Buzzer·  Breadboard
  An USB Cable·
  Some Jumper Wires 
  A Computer

CIRCUIT DIAGRAM:

The circuit connection is fully explained below source code.

WORKING:

       This system is a basic motion activated alarm. It is built around an Arduino Micro controller. It is connected to a PIR motion sensor, a buzzer, a resistor, and a pair of external terminals. The whole system is battery powered so that it is easily portable. Once you have the code, you can connect all the external parts. The easiest way to do this is with a breadboard. This will let you make temporary connections to test everything out. The project involves the use of Arduino, motion sensor, buzzer, LCD display and a simple program. The sensor detect any motion in its permissible range and triggers the alarm. It will also send the signal to Arduino which processes the signal and set off the alarm along with detection message on display. With this system we can easily set up a security alarm in our home for unwanted intruders.

ADVANTAGES:

        1. The given system is handy and portable, and thus can be easily carried from one place to another.
        2. The circuitry is not that complicated and thus can be easily troubleshooted.
        3. The given system sets off a powerful buzzer, and it is effective as any other alarm system available in the market.

APPLICATIONS:

           This type of motion sensing alarm system can be easily employable for security purposes at banks, various offices and even for sensitive establishments such as for military. We can easily set up this system for household purposes.

FUTURE SCOPE:

1. We can add a keypad to arm or disarm the alarm.
        2. We can determine the position of the intruder and then send a SMS to the concerned authorities

CONSLUSION:

       Thus, we have designed a home security alarm system using Arduino and PIR motion sensor, which is handy, portable, cost-effective and highly effective as well. Such alarm systems are hugely in demand for security purposes, and thus the given system can be proved useful and effective in view of the above features.

DEMO VIDEO:

A very short demo video is given below.



PROJECT CODE:


#include <LiquidCrystal.h>
int ledPin = 13; // choose the pin for the LED
int inputPin = 7; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int pinSpeaker = 10; //Set up a speaker on a PWM pin (digital 9, 10, or 11)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
void setup() { pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inputPin, INPUT);
     //declare sensor as input
pinMode(pinSpeaker, OUTPUT);
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(2, 0); // Set LCD cursor position (column, row)
lcd.print("P.I.R Motion"); // Print text to LCD
lcd.setCursor(5, 1); // Set LCD cursor position (column,row)
lcd.print("Sensor"); // Print text to LCD
delay(4000); // wait 4s // Delay to read text
lcd.clear(); // clear LCD display // Clear the display
lcd.setCursor(2, 0); // Set LCD cursor position (column, row)
lcd.print("DEVELOPED BY"); // Print text to LCD
lcd.setCursor(3, 1); // Set LCD cursor position (column, row)
lcd.print("ALL IN ALL INFOS"); // Print text to LCD
delay(5000); // Delay to read text
lcd.clear(); // Clear LCD
  lcd.setCursor(2, 0); // Set LCD cursor position (column, row)
lcd.print("GUIDANCE OF"); // Print text to LCD
lcd.setCursor(0, 1); // Set LCD cursor position (column, row)
lcd.print("PROF. ALL IN ALL INFOS"); // Print text to LCD
delay(5000); // Delay to read text
lcd.clear(); // Clear LCD  
lcd.setCursor(0, 0);
    
lcd.print("Processing Data.");
delay(3000);
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("Waiting For");
lcd.setCursor(3, 1);
lcd.print("Motion....");
}
void loop(){
   
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
playTone(300, 300);
delay(150);
if (pirState == LOW) {
// we have just turned on
          
Serial.println("Motion detected!");
lcd.clear() ;
lcd.setCursor(0, 0); // Set LCD cursor position (column 0, row 0)
lcd.print("Motion Detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); 
// turn LED OFF
playTone(0, 0);
delay(300);
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
lcd.clear() ;
lcd.setCursor(3, 0);
lcd.print("Waiting For");
lcd.setCursor(3, 1);
lcd.print("Motion...."); // We only want to print on the output change, not state
pirState = LOW; } } } // duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
duration *= 1000;
int period = (1.0 / freq) * 100000;
long elapsed_time = 0;
while (elapsed_time < duration) {
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);     
}
}

CIRCUIT CONNECTION:

Step 1: Connecting the P.I.R sensor to Arduino:

1.  Connect Vcc pin of P.I.R sensor to positive terminal of Arduino       (5V).
2.  Connect Gnd pin of P.I.R sensor to any ground pin of Arduino. 3.  Connect out pin of P.I.R sensor to Pin no. -7 of Arduino

Step 2: Connecting L.E.D and Piezo Buzzer To Arduino:

1. Connecting L.E.D Connect Positive terminal (Longer Lead) Of        L.E.D To Arduino Pin no. 13.
2. Connect Negative terminal (Shorter Lead) Of L.E.D To Any            Ground Pin.

 Connecting Piezo Buzzer 

1. Connect Positive terminal (Red Wire)      Of Buzzer to Arduino         Pin no. 10.
2. Connect Negative terminal (Black Wire) Of Buzzer to Any              Ground Pin.

Step 3: Connecting L.C.D to Arduino:

To wire your LCD screen to your Arduino, connect the following pins:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
Additionally, wire a 10K pot to +5V and GND, with its wiper (output) to LCD screens VO pin (pin3).

Step 4: Programming Arduino: 

1. Download Arduino IDE 1.0.6 from https://www.arduino.cc/en/main/software.
2. Connect Your Arduino to your computer using USB Cable.
3. Open Arduino IDE, choose your correct board from Tools--Boards
4.Choose Your Correct Port from Tools--Serial Port
5. Copy the following sketch which appears in your Web Browser to your Arduino Sketch Page.
6. Click on Upload Icon or go to File—Upload






IF YOU LIKE OUR SITE PLEASE GIVE...