GSM Alarm System Using Arduino and a PIR Sensor

(Last Updated On: July 17, 2019)

gsm

Description:

Arduino GSM Alarm System– This project is based on the Security system using PIR Sensor, Arduino Uno and GSM module “SIM900A”. The PIR sensor is used for Intruder detection. Whenever an unauthorized person is detected a message is sent on the desired number. A relay module is also connected with the Arduino Uno which can be used to turn on an Alarm or it can be used to turn on any light as an indication that intruder is detected.

As in this project which is based on the GSM Alarm System, the GSM module is used, so with the help of this project the home or office can be monitored from anywhere around the world. This project “ Arduino GSM alarm system “ can be used throughout the world, so far the GSM network is available.


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Pir Motion sensor: https://amzn.to/2KWErNd
GSM sim900A: https://amzn.to/2Nv70TI
12v 10A SPDT relay: https://amzn.to/2MThQBK
2n2222 NPN transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / stripboard: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wirecutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

PIR sensor Module used in the GSM Alarm System:

 

PIR SENSOR, PIR stands for the Passive Infrared Sensor, PIR SENSOR is most commonly known as the motion sensor. PIR “passive infrared sensor” This sensor is designed for humans and animals detections. The PIR sensor, like the one you can see in the picture above, can be easily used with Arduino Uno or Mega and other microcontrollers as well.

Product parameters:

  1. detection angle of 120 degrees.
  2. the detection range of 7 m.
  3. Size: 32x24mm
  4. 4.TTL switch signal output high signal output (3.3V), a low signal output (0.4V).
  5. 5 the trigger time is adjustable 0.3 seconds to 10 mins
  6. commonly used in security projects/devices
  7. 7 has a reusable trigger.
  8. 4.5 to the 20V working voltage


Gsm Sim900A/Sim900D Module:

 

This is the GSM module that I will be using in the GSM Alarm System project, in the market we have different types of GSM modules, the one I will be using today is sim900A, the same code is also tested on sim900D, so if you want you can also use sim900D.

If you are from Pakistan, Bangladesh or India make sure you purchase the unlocked version of the sim900A. This GSM sim900A module the one we will be using in this tutorial, as you can see on the screen has no Onboard voltage regulator, so be careful while applying the voltage. Ideal voltage for this GSM module is 4.7v but you can also connect it with the 5v adaptor.


As the ideal voltage for this gsm module is 4.7v to 5volts, so any voltage above this can damage the gsm module. If you don’t have the regulated 5v adaptor then you can also use an lm317t adjustable voltage regulator. I have a very detailed tutorial on this. Watch the video “Click Here”

As you can see sim900A module have so many pins which are clearly labeled but we will be using only 5 of these pins, the power supply pins, GND, Rxd 5v, and Txd 5v. The GND of the gsm sim900A module will be connected with the Arduino GND, Txd of the gsm sim900A will be connected with the Arduino pin7 and finally, the Rxd of the gsm sim900A module will be connected with the  Arduino pin8.

Circuit Diagram of the GSM Alarm System:

The recommended voltage for the GSM sim900A module is 4.7 volts to 5 volts. The TX and RX pins of the gsm module are connected with the Arduino’s pin number 7 and pin number 8, and the Ground of the GSM module is connected with the Arduino’s Ground. A relay module is connected with pin number 13 of the Arduino, while the PIR sensor is connected with the pin number 2 of the Arduino. The VCC and GND of the PIR sensor are connected with the Arduino’s 5 volts and Ground.

Arduino Programming of the GSM Alarm System:

We start by including the softwareserial.h header file. The softwareSerial library is used for creating multiple serial ports. As I always say never use the Arduino’s default serial port for the debugging purposes. Now the question is if we use the Arduino’s default serial port for the debugging purposes then how we will connect the GSM module. well, no worries at all we can create multiple serial ports using the softwareserial library. I created a serial port on pin number 7 and pin number 8 with the name SIM900. Pin number 7 is the RX will Pin number 8 is the TX. If you want you can select any other pins. then I defined three variables of the type String and integer. The variable txtForSMS will be used for storing the complete message. A PIR sensor is connected with pin number 2 and a relay is connected with pin number 13.


Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply