DIY PIR sensor based Burglar Alarm, How does a PIR motion sensor work?, What is an LM2596 DC-DC buck converter?, What is a SIM800L Module?

Let's get started with this innovative Arduino tutorial on how to build your own burglar alarm system. You will learn to interface Sim800L GSM GPRS module, PIR (Passive Infrared Receiver) sensor and Piezo buzzer with Arduino board. Every time you leave your house, there is a chance that a burglar will break in. This project will help you create a system to get rid of this issue.


Components Required:


What is a SIM800L Module?

What is a SIM800L Module?
What is a SIM800L Module? , SIM800L pinout
 
SIM800L GSM/GPRS module is a small GSM modem that can be integrated into a variety of projects. You can use this module to do almost anything a standard cell phone can do: send SMS text messages, make or receive phone calls, connect to the internet via GPRS, TCP/IP, and more! To top it all off, the module supports a quad-band GSM/GPRS network, which means it will work almost anywhere in the world. 
SimCom's SIM800L GSM cellular chip is at the heart of the module. The chip's operating voltage ranges from 3.4V to 4.4V, making it an excellent candidate for direct LiPo battery supply. This makes it an excellent choice for embedding into projects with limited space.
To use the module for voice or data communications, as well as some SIM commands, an antenna is required.
The first is a Helical GSM antenna, which is usually included with the module and connects directly to the NET pin on the PCB. 
The second is a 3dBi GSM antenna and a U.FL to SMA adapter, both of which can be purchased online for less than 200INR. Snap-fit this antenna to the small U.FL connector on the module's top-left corner.
One of the most important aspects of getting the SIM800L module to work is providing it with enough power.

Depending on which state it is in, the SIM800L can be a relatively power-hungry device. During transmission burst, the module's maximum current draw is around 2A. It won't usually pull that much, but it may need around 216mA during phone calls or 80mA during network transmissions.

The SIM800L Cellular Module has an LED on the top right side that indicates the status of your cellular network. It will blink at different rates depending on the state it is in.

  1. LED blinking every 1 second indicates that the module is operational but has not yet connected to the cellular network.

  2. LED  Blinking every 2 seconds indicates that the GPRS data connection you requested is active.

  3. LED blinking every 3 seconds indicates that the module has made contact with the cellular network and can send/receive voice and SMS messages.

    As the SIM800L module lacks an onboard voltage regulator, an external power supply with a voltage range of 3.4V to 4.4V (ideal 4.1V) is required. The power supply should also be capable of supplying 2A of surge current, or else the module will continue to shut down. Here are some options for properly powering your GSM module.

    1. 3.7V Li-Po Battery

    2. DC-DC Buck Converter


      Caution:
      You must be extremely careful not to disconnect GND before VCC and to always connect GND before VCC. Otherwise, the module will use the low voltage serial pins as ground and will be destroyed.

       

      How does a PIR motion sensor work?

      How does a PIR motion sensor work? PIR sensor
       
      How does a PIR motion sensor work? PIR sensor
      Heat energy in the form of infrared radiation is emitted by all objects, including inanimate objects. Humans, animals, and plants emit more infrared signals than inanimate objects because they use energy to generate heat in order to maintain a specific temperature.
      PIR sensors detect infrared light emitted by objects in their field of view. Anything that moves in front of a PIR sensor with a temperature different than the background temperature of the view area will cause a pair of pyroelectric elements on the sensor to react to the temperature change with instantaneous output differences. These variations in output generate energy, causing the sensor to send a detection signal to activate the alarm. The sensor detects motion that indicates the presence of an occupant in the space, and the call is initiated.

       

      What is an LM2596 DC-DC buck converter?

      What is an LM2596 DC-DC buck converter?
       
      What is an LM2596 DC-DC buck converter?, LM2596

      It is an LM2596 DC-DC buck converter step-down power module with a high-precision potentiometer that can drive a load of up to 3A with high efficiency and is compatible with Arduino UNO, other mainboards, and basic modules. The LM2596 converter is a switch-mode power supply with significantly higher efficiency than popular three-terminal linear regulators, especially at higher input voltages. The LM2596 has a switching frequency of 150 kHz thus allowing smaller-sized filter components than what would be needed with lower frequency switching regulators.

      Working:

      SIM800L Module, PIR sensor,  Piezo buzzer are connected with Arduino board. If the PIR sensor detects any unwanted movement in the area it makes digital input HIGH at pin 7 of Arduino and Arduino trigger the piezo buzzer and SIM800L module, GSM module connect a call to the number stored in Arduino memory. You can even add a Reed switch as a sensor to the door/window, If someone tries to open the door/window you will get an alert call on your mobile phone.

       

      Circuit Diagram:

      Circuit Diagram of PIR sensor based Burglar Alarm

      Arduino Code:

      #include <SoftwareSerial.h>
      const int PIR= 7;
      //Create software serial object to communicate with SIM800L
      SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2

      void setup()
      {
      //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
      Serial.begin(9600);

      //Begin serial communication with Arduino and SIM800L
      mySerial.begin(9600);
      pinMode(PIR,INPUT);

      }

      void loop()
      {
      if(PIR==HIGH)
      {

      digitalWrite(5, HIGH);
      Serial.println("Initializing...");
      delay(1000);

      mySerial.println("AT"); //Once the handshake test is successful, i t will back to OK
      updateSerial();

      mySerial.println("ATD+ +91xxxxxxxxxx;"); // change xxxxxxxxxxx with phone number to dial
      updateSerial();
      delay(20000); // wait for 20 seconds...
      mySerial.println("ATH"); //hang up
      updateSerial();
      }
      else
      {

      }
      }

      void updateSerial()
      {
      delay(500);
      while (Serial.available())
      {
      mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
      }
      while(mySerial.available())
      {
      Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
      }
      }

      Dc-dc step downDiy projectsHc-sr501Lm2596 dc-dc buck converterPiezo buzzerPirSim800l module

      Leave a comment

      All comments are moderated before being published