Home security system using arduino board

​This is an example of Arduino Based project.  We have even provide free download project with source code, projects synopsis and Project report with ease of understanding which help any student to give the primary idea before starting of your Project. In this instructional tutorial I am going to fabricate an arduino home security framework. One can introduce this diy arduino security framework venture on his home primary entryway or even main door. The diy arduino security framework checks two things.

1. It checks if somebody moved toward the entryway?

2. It checks if entryway is opened by the individual?

At the point when the previous two conditions meet a sms message is sent to the proprietor of the house, Also nearness/movement of the individual before the entryway is identified by the pir movement finder and entryway opening is checked by entryway contact switch or reed switch. Both the sensors(pir movement and reed switch) are associated with arduino uno and any interruption identified by the sensors is passed on in a split second to arduino uno. Arduino as an interruption alarm sends a sms message to the proprietor versatile number utilizing gsm module.

Below is the sensors to be used:

PIR movement location sensor  passive infrared sensor (PIR sensor)

 Apply infrared principles that is infrared movement recognition sensor in the diy venture. It can distinguish movement at a maximum separation of 7 meters. Affectability scope of hcsr501 pir movement finder can be set by pivoting the variable resistor/potentiometer mounted on the circuit leading body of hcsr501 pir movement sensor.

It additionally has a second factor resistor/potentiometer which is utilized to set the defer time. Hcsr501 pir sensor has 3 stick. Two are power pins. Vcc is associated with +ve lead of intensity supply and Gnd is associated with – ve of intensity supply. The third stick is out stick. It regularly stays low. At the point when pir sensor identifies nearness of infrared discharging body in its range it sets the out stick high. Presently the inquiry is For to what extent does pir out stick stays high once the nearness of individual is distinguished? For this reason the second factor resistor/potentiometer is available on hcsr501 pcb load up you can set the defer time or out stick high time utilizing the second factor resistor. 

So where the pir sensor is to be mounted so as to distinguish the nearness of individual. It must be mounted on the upper part of gulf of entryway. Underneath graph best outlines the mounting of pir over the entryway.

 Sim900 Gsm module(Arduino Gsm) 

All sim900 gsm modules speaks with outer controllers/microcontrollers on. It has convention pins. One is TxD(Transmit) and other is RxD(Receive). For sending and getting information to sim900 gsm module the outside microcontroller should likewise have a  port.  Gsm sim900 module has Uart port so our outer microcontroller should likewise have one to speak with gsm module. 

Entryway contact switch/Reed switch

A reed switch is an electrical gadget worked utilizing a magnet set. It comprises of two half’s. One half contains real switch and the other half contains only a magnet in it. At the point when the attractive half is brought close to the switch half it begins leading power. So how can everything occurs? As a matter of fact the switch half contains a couple of attractive poles. Regularly when their is no attractive recorded present close switch the bars are a section from each other(Open circuit – No electric way). When we bring the attractive half close to the switch a large portion of the attractive field brings the bars close and when the quality of attractive field achieves as far as possible the poles join with each other(Making a physical contact – Path for power stream). 

How to introduce the entryway reed switch? We ordinarily mount the switch half on fix/resolute surface and the attractive half is introduced on the moving surface. For our situation, I introduced the attractive half on entryway and the switch half on the divider close to entryway shutting point. Both half’s must be in right position and at right separation to reach. Underneath you can see the right arrangement and establishment of entryway contact sensor.

Source code

a

 /*************************************************

* Written By: Orengo Dickson                    *
* Dated     : 23  July 2019                     *
* Website: www.techadvisor.co.ke*
************************************************/

int Door = 9;  
//sensor pin connected to digital pin-9 of arduino
int Out =  8; 
//Pir output pin connected to digital pin-8 of arduino

void setup() {
  pinMode(Door, INPUT);  // PIR motion sensor as input 
  pinMode(Out, INPUT);   // Door contact switch as input
  //Uart channel communication initialed at 9600 baud rate
  Serial.begin(9600);
}

void loop(){
  int S1=0,S2=0;
  S1=digitalRead(Door);
  S2=digitalRead(Out);

  if(S1 ==HIGH && S2==HIGH){  
   
    //Check if the module is working/operational- It return ‘OK’
    //Not necessary in our case if want to use uncomment it you might
    //have to read serial channel to read the status of gsm
    //Serial.print(“AT”);           
    //Serial.println();
   
    Serial.println(“AT+CMGF=1”);        // Set the Sim900 SMS mode to text
    delay(1000); //Time in ms
    Serial.println();
    Serial.print(“AT+CMGS=”);           // Insert SMS number
    Serial.print(“\”+254771882303\””);  //Recepient Owner of house
    Serial.println();
    delay(100);
    Serial.print(“www.microcontroller-project.com”); // Text message
    delay(100);
    Serial.println();
    //CTRL+Z commnad to end message body and send sms
    Serial.write(26);               
    }
    else{} //Do nothing
 

There are two variables  declared S1 and S2. Both variables are used to store the status of the pir and door sensor.

The statement S1=digitalRead(door) is to  check the status of the door sensor and storing the status in S1 variable.

The statement S2=digitalRead(Out) is to check the status of pir and storing its status in S2 variable.


“AT+CMGF=1” is send. This command sets the sim900 gsm module in sms text mode. Then “AT+CMGS=” is send with “\”+254phoneNumber\””.

Leave a Reply

Your email address will not be published. Required fields are marked *