Gsm Sim900a Module and Arduino: Security Alert message to multiple numbers

Gsm Sim900a Module

Description:

Gsm Sim900a Module and Arduino: Security Alert message to multiple numbers-In this tutorial, you will learn how to make an Advanced security system and send the Security Alert message to multiple numbers using Arduino and A GSM Sim900A Module. For the demonstration purposes, I will be using an LDR, which makes this project as the laser security system, but if you want you can also replace the LDR with a PIR sensor or Magnetic reed switch Sensor or a limit switch and so on. You can also use multiple sensors.

This is basically the 2nd version of the Gsm Sim900a laser security system in which I used the LDR sensor for the intruder detection and I used the same GSM sim900A module. in this project the security alert message is only sent to one number.But in many situations, we need to send the same security alert message to multiple numbers. So this tutorial is all about how to write a very simple program and how to connect all the components together to make the advanced security system. In this tutorial, we will cover

  1. GSM SIM900A module Pinout explanation
  2. Complete Circuit Diagram
  3. Programming and finally number
  4. Testing



The components and Tools used in this Gsm Sim900a Module and Arduino project can be purchased from Amazon; the components purchase links are given in the description.

GSM sim900A

Cell Phone

Arduino Uno:

Mega 2560:

lm7805 Voltage Regulator:

330-ohm resistors pack:

female DC power jack socket:

470uf capacitors: 5×7 cm Vero board:

female headers:

connection wires:

Super Starter kit for Beginners:

Jumper Wires:

Bread Board:

12v Adaptor:

PCB plate:

Variable Supply:

Digital Multimeter:

Vero Board / stripboard:

Soldering iron kit: “best” definitely purchase this:

Solder wire:

Wire Stripper:

wirecutter:

PCB small portable drill machine:

DISCLAIMER:

Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!


GSM SIM900A module pinout:

Gsm Sim900a Module: Security Alert message to multiple numbers

Gsm Sim900a Module

This is the GSM sim900A module, in the market, we have different types of GSM modules, the one I will be using today is Gsm Sim900a Module if you want you can also use any other gsm module, like for example sim900D. I have also tested the same programming using sim900D but with a different baud rate, the rest of the program remains the same.

If you are from Pakistan, Bangladesh or India make sure you double check the GSM module and purchase the unlocked version of the Gsm Sim900a Module. This GSM sim900A module as you can see on the screen has no Onboard voltage regulator, so be careful while applying the voltage. Ideal voltage for this Gsm Sim900a Module is 4.7v but you can also connect it with a 5v adaptor. If you don’t have a 5v adaptor then you can make your power supply using lm317t adjustable variable voltage regulator. As you can see clearly in the picture above this module has 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 will be connected with the Arduino’s GND, TXD will be connected with the Arduino’s pin number 7 and RXD will be connected with the Arduino’s pin number 8.


Gsm Sim900a Module and Arduino – Circuit Diagram:

Gsm Sim900a Module

This schematic is designed in cadesoft eagle 9.1.0 version,

Tx of the Gsm Sim900a Module is connected with pin number 7 of the Arduino, the Rx pin of the Gsm Sim900a Module is connected with pin number 8 of Arduino and GND is connected with the Arduino’s ground. a power supply is connected with the Gsm Sim900a Module ideal voltage is 4.7v to 5v as already explained. An LDR is connected in series with a 10k resistor which makes a voltage divider circuit. As you know an LDR is basically a variable resistor, whose resistance changes with the amount of light falling on the LDR. So a change in resistance will result in a change in voltage. This change in voltage can be monitored using The analog pin A1 of the Arduino.



Interfacing Gsm Sim900a Module And Arduino:

Gsm Sim900a Module

All the components are interfaced as per the circuit diagram, this is the LDR circuit, as you can see an LDR is connected in series with a 10k resistor. A wire from the middle of the LDR and 10k resistor is connected with the analog pin A1 of the Arduino.

The GSM sim900A module txd and rxd pins are connected with the Arduino pin number 7 and pin number 8, and make sure you connected the ground of the gsm module with the ground of the Arduino. This Gsm Sim900a Module will be powered up using this Regulated 5v power supply. Now let’s discuss the Arduino Programming.


Gsm Sim900a Module and Arduino Programming:

Gsm Sim900a: Security Alert message to multiple numbers


Programming Explanation:

#include <SoftwareSerial.h>

SoftwareSerial SIM900(7, 8); Gsm Module connected here

String textForSMS;

int data = 0;

int sensor = A1; // LDR is connected with the analog pin A1 of the Arduino

// cell numbers to which you want to send the security alert message

String f1001 = “+923351920959”;

String f1002 = “+923108688660”;

String f1003 = “+923339218213″;

void setup() {

randomSeed(analogRead(0));

Serial.begin(9600);

SIM900.begin(9600); // original 19200. while enter 9600 for sim900A

Serial.println(” logging time completed!”);

pinMode(sensor, INPUT);

delay(5000); // wait for 5 seconds

}

void loop() {

data = analogRead(sensor);

Serial.println(data);

if ( data < 400) //

{

textForSMS = “\nIntruder detected”;

//sendSMS(textForSMS);

sendsms(textForSMS, f1001); // you can use a variable of the type String

Serial.println(textForSMS);

Serial.println(“message sent.”);

delay(5000);

sendsms(“Intruder Detected!!!!!!!!!”, f1002); // you can also write any message that you want to send.

Serial.println(textForSMS);

Serial.println(“message sent.”);

delay(5000);

sendsms(“Intruder Detected!!!!!!!!!”, f1003); // you can also write any message that you want to send.

Serial.println(textForSMS);

Serial.println(“message sent.”);

delay(5000);

}

}

void sendsms(String message, String number)

{

String mnumber = “AT + CMGS = \””+number+”\””;

SIM900.print(“AT+CMGF=1\r”);

delay(1000);



SIM900.println(mnumber); // recipient’s mobile number, in international format

delay(1000);

SIM900.println(message); // message to send

delay(1000);

SIM900.println((char)26); // End AT command with a ^Z, ASCII code 26

delay(1000);

SIM900.println();

delay(100); // give module time to send SMS

// SIM900power();

}

Watch Video Tutorial:

Related Tutorial:

Arduino Gas/smoke leakage detection and sms alert system programming

 

Recommended For You

Fawad

About the Author: Fawad

My name is Shahzada Fawad and I am a Programmer. Currently, I am running my own YouTube channel "Expertstech", and managing this Website. My Hobbies are * Watching Movies * Music * Photography * Travelling * gaming and so on...

Leave a Reply

%d bloggers like this: