Interfacing SIM900A GSM Modem With Arduino

158,408

55

32

About: We are 4 Electronics Engineer working towards the betterment of new technology and bring to you the basic as well as advanced instructables one can easily follow and make.

This is a very low cost and simple Arduino GSM and GPRS module. We use the module SIMCom SIM900A . It’s the cheaper module now avalaible in the market.This post will allow you to make arduino controlled calls and also send text messages.

Step 1: Some Important Notes and Powering Up the GSM Module

1. We use SIM900 GSM Module – This means the module supports communication in 900MHz band. We are from India and most of the mobile network providers in this country operate in the 900Mhz band. If you are from another country, you have to check the mobile network band in your area. A majority of United States mobile networks operate in 850Mhz band (the band is either 850Mhz or 1900Mhz). Canada operates primarily on 1900 Mhz band.

2. Check the power requirements of GSM module – GSM modules are manufactured by different companies. They all have different input power supply specs. You need to double check your GSM modules power requirements. In this tutorial, our gsm module requires a 12 volts input. So we feed it using a 12V,1A DC power supply. I have seen gsm modules which require 15 volts and some other which needs only 5 volts. They differ with manufacturers. If you are having a 5V module, you can power it directly from Arduino’s 5V out.

BOOTING UP THE GSM:

1. Insert the SIM card to module and lock it.

2. Connect the adapter to module and turn it ON!

3. Now wait for some time (say 1 minute) and see the blinking rate of ‘status LED’ (GSM module will take some time to establish connection with mobile network)

4. Once the connection is established successfully, the status LED will blink continuously every 3 seconds.

Step 2: Making Connections

There are two ways of connecting GSM module to arduino. In any case, the communication between Arduino and GSM module is serial. So we are supposed to use serial pins of Arduino (Rx and Tx). So if you are going with this method, you may connect the Tx pin of GSM module to Rx pin of Arduino and Rx pin of GSM module to Tx pin of Arduino.

Now connect the ground pin of arduino to ground pin of gsm module! So that’s all! You made 3 connections and the wiring is over! Now you can load different programs to communicate with gsm module and make it work.

Note:- The problem with this connection is while programming. Arduino uses serial ports to load program from the Arduino IDE. If these pins are used in wiring, the program will not be loaded successfully to Arduino. So you have to disconnect wiring in Rx and Tx each time you burn the program. Once the program is loaded successfully, you can reconnect these pins and have the system working! To avoid this difficulty, I am using an alternate method in which two digital pins of arduino are used for serial communication. We need to select two PWM enabled pins of arduino for this method. So I choose pins 9 and 10 (which are PWM enabled pins). This method is made possible with theSoftwareSerial Library of Ardunio. SoftwareSerial is a library of Arduino which enables serial data communication through other digital pins of Arduino. The library replicates hardware functions and handles the task of serial communication.

Step 3: The Code: Calling and Messaging

Share

Recommendations

  • Optics Contest

    Optics Contest
  • Plastics Contest

    Plastics Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018

32 Discussions

0
None
JoysonD

7 months ago

hello i am joyson .

i am doing one project using sim900a gsm module , it works properly but each time when i power off and on gsm ; arduino board wont receive msg and call properly . i need to upload program newly each time . Why it is happening like this ? is there any solution for it ?

0
None
pritishk1996

8 months ago

In our gsm kit only power LED is working and network LED is not working and we are giving prefect power supply 12 volt 2 amp dc power through adapter what can i do for get network LED on

IMG_20180225_224555.jpg
0
None
pritishk1996

8 months ago

In my gsm kit only my power led is working but network led is not working what I have to do for it.

0
None
mikudesu360

2 years ago

Im using GSM Module Sim900A Mini V3.8.2 2014.10 and it works easily using this method on arduino uno, by putting 5VT on pin 9 and 5VR on pin 10.

5 replies
0
None
mikudesu360mikudesu360

Reply 2 years ago

here's my program i'm editing it from the source (tribute to the builder)

//ERFINDER CODE

#include <SoftwareSerial.h>

String pilih;

SoftwareSerial mySerial(9, 10);

void setup()

{

mySerial.begin(9600); // Setting the baud rate of GSM Module

Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)

RecieveMessage();

delay(100);

}

void loop()

{

if (Serial.available()>0)

switch(Serial.read())

{

case 's':

SendMessage();

break;

case 'r':

RecieveMessage();

break;

}

if (mySerial.available()>0)

{ Serial.write(mySerial.read());

pilih = mySerial.read();}

}

void SendMessage()

{

mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+62xxxxxxxxx\"\r"); // Replace x with mobile number

delay(1000);

mySerial.println("Message Send :)");// The SMS text you want to send

mySerial.println(pilih);

delay(100);

mySerial.println((char)26);// ASCII code of CTRL+Z

delay(1000);

}

void RecieveMessage()

{

mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to recieve a live SMS

delay(1000);

//There are different AT commands for different tasks. If you want to read

//all SMS’s stored in your SIM card, send the following AT Command

//to gsm module – “AT+CMGL=\”ALL\”\r”

}

0
None
Rahulgolumikudesu360

Reply 11 months ago

Hey your code is not working on my GSM module for recieving message. Can you help me with that? Or can you tell me how can I detect a message or a call had come in the SIM (which is in GSM module). Also can I get the mobile number from which the message or call had come?

0
None
RobodiaRmikudesu360

Reply 1 year ago

Hi Brother,
While using Arduino and Sim900a (Mini V3.8 2014.10) I am getting "Error".

I have attached Error MSG in the image.

My connections are
Sim900a --------------> Arduino

VCC --------------------+5v

GND---------------------GND

5VT(TX)-----------------------9(RX)

5VR(RX)-----------------------10(TX)

---------------------------------------------

Is there any other connections i have to do?

Plz Guide me for that. Thanks for your help.

Error Msg .png
0
None
meniaouiamikudesu360

Reply 2 years ago

hi , I just try the same what u sayed but no way , I can't make a call or send a msg

:(

0
None
RobodiaR

1 year ago

Hi Brother,

While using Arduino and Sim900a (Mini V3.8 2014.10) I am getting "Error".

I have attached "Error MSG" image.

My connections are
Sim900a --------------> Arduino

VCC --------------------+5v

GND---------------------GND

5VT(TX)-----------------------9(RX)

5VR(RX)-----------------------10(TX)

---------------------------------------------

Is there any other connections i have to do?

Plz Guide me for that. Thanks for your help.

Error Msg .png
2 replies
0
None
MohanS53RobodiaR

Reply 1 year ago

do not connect +5 v vcc to gsm modem pin..

make only 3 connections

tx of gsm to rx of controller

rx of gsm to tx of controller

gnd of gsm to gnd of controller

and provide separate power supply to gsm modem..

like 12v adapter

0
None
soardrMohanS53

Reply 1 year ago

Can we power the SIM900 A6 GSM Module with batteries. What is the use of the '5.0VCC' pin on the module? Please help.

0
None
Zeeshan AhmedV

1 year ago

Hii,
I want to get location also so can u please help

0
None
RoshniM4

1 year ago

hello ,

I am unable to interface Arduino 101 with gsm module . will u please provide the solution for it .

anxiously waiting for the solution.....

0
None
vineethe

1 year ago

sir help me ,

can we use gsm library to code the gsm module as shown in the official website of arduino instead of using AT commands.if possible tell me as soon as possible.and the website is https://www.arduino.cc/en/Tutorial/GSMExamplesSendSMS

0
None
akosijn

1 year ago

Sir can u help me, what if i want to add an if in the receive message, lets say

void RecieveMessage()

{

mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to recieve a live SMS

if(mymssage== "Open the door");

digitalWrite(13,HIGH)

delay(1000);

}

problem is i dunno what kind of code/syntax should i use. TIA!

0
None
SiddarthJ1

2 years ago

I'm using sim800 and I dont have an antenna. Where can I buy it? Is the antenna really necessary

1 reply
0
None
arunkumar2931

2 years ago

thanks Erfinden ! helped me to learn a lot!