Introduction: Tutorial to Interface GSM SIM900A With Arduino

Picture of Tutorial to Interface GSM SIM900A With Arduino

Description

SIM900A Modem is built with Dual Band GSM/GPRS based SIM900A modem from SIMCOM. It works on frequencies 900/ 1800 MHz. SIM900A can search these two bands automatically. The frequency bands can also be set by AT Commands. The baud rate is configurable from 1200-115200 through AT command. The GSM/GPRS Modem is having internal TCP/IP stack to enable you to connect with internet via GPRS. SIM900A is an ultra compact and reliable wireless module. This is a complete GSM/GPRS module in a SMT type and designed with a very powerful single-chip processor integrating AMR926EJ-S core, allowing you to benefit from small dimensions and cost-effective solutions.

Specification

  • Dual-Band 900/ 1800 MHz

  • GPRS multi-slot class 10/8GPRS mobile station class B

  • Compliant to GSM phase 2/2+

  • Dimensions: 24*24*3 mm

  • Weight: 3.4g

  • Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands)

  • Supply voltage range : 5V

  • Low power consumption: 1.5mA (sleep mode)

  • Operation temperature: -40°C to +85 °

Step 1: Material Preparation

Picture of Material Preparation

In this tutorial, you will need :

1. GSM SIM900A (MINI V3.9.2)
2. Arduino Uno Board and USB
3. Jumper Wire
4. Power adapter 5V
5. SIM card
6. Breadboard

Step 2: Booting Up SIM900A

Picture of Booting Up SIM900A

1. Insert your SIM card to GSM module and lock it. (picture 1 and 2)
2. power up your gsm by connecting it to Arduino's 5V and GND (picture 3)
3. Connect the Antenna (picture 4)
4. Now wait for some time (say 1 minute) and see the blinking rate of ‘status LED’ or ‘network LED’ (D6, refer picture 5) //GSM module will take some time to establish connection with mobile network//
5. Once the connection is established successfully, the status/network LED will blink continuously every 3 seconds. You may try making a call to the mobile number of the sim card inside GSM module. If you hear a ring back, the gsm module has successfully established network connection.

Step 3: Pin Connection

Picture of Pin Connection

You can see a TTL pin with 3VR, 3VT, 5Vr, 5VT, VCC and GND on your sim900a near your power supply pin. You have to connect GSM's 5VT to Arduino D9 and GSM's 5VR to Arduino's D10 for serial communication between arduino and sim900a module.

Step 4: Basic AT Command

1. To change sms sending mode : AT+CMGF=1

mySerial.println("AT+CMGF=1");

2. To read SMS in text mode : AT+CNMI=2,2,0,0,0

mySerial.println("AT+CNMI=2,2,0,0,0");

3. To make a call : ATD+60XXXXXXXXX; //replace X with number you want to call, change +60 to your country code

mySerial.println("ATD+60XXXXXXXXX;"); 

4. To disconnect / hangup call : ATH

mySerial.println("ATH");

5. To redial : ATDL

mySerial.println("ATDL");

6. To receive a phone call : ATA

mySerial.println("ATA");

Step 5: Library

Picture of Library

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. To be able to interface gsm module with arduino, you will have to download this library and extract it into your Arduino's libraries.

Step 6: Sample Source Code

Picture of Sample Source Code

Download the sample source code below and open it on your Arduino IDE. Select the correct board and port and upload it into your Arduino Uno Board.

Step 7: Serial Monitor

Picture of Serial Monitor

After you has succesfully uploaded your source code, open your serial monitor. Serial monitor will display as shown in the picture above.

Step 8: Result : Call / Redial

Picture of Result : Call / Redial

1. As you key-in c : to make a call, gsm will read the ATD command and make a call to a phone number you have upload in your source code. (Picture 1 and 2)

2. When you key-in h : to disconnect/hangup call, gsm will read the ATH command and disconnect the connection. (Picture 3)

3. When you key-in e : to redial, gsm will read the ATDL command and redialing previous number it has called.(Picture 4)

4. When there is an incoming call, you can see RING printed on serial monitor and you can click i : to receive a call and GSM's ATA command will be carried out and you will be connected to a call connection. (Picture 5)

Step 9: Result : Send and Receive SMS

Picture of Result : Send and Receive SMS

1. Key-in s to send SMS. Recepient's number and text message printed on serial monitor. NOTE : You can edit the recepient's phone number and text message on your source code.

2. When gsm receive a message, text message and number will be printed on serial monitor.

Step 10: Video Demonstration

This video shows how SIM900A MINI make a call, receive a call, send sms, receive sms, redial and hangup call based on the sample source code uploaded in this tutorial.

Comments

chewc1 made it! (author)2017-10-08

Anyone can help me ?
why it will show no dialtone?

IsraelG36 (author)2017-10-07

Hi I can't Download your Code it is empty .ino file can you help me ?

Thanks

Happymacer (author)2017-09-01

hi Mybotic I can't understand how this works, as to transmit the module draws some 2A, and that draw using your connections resets the module as the supply voltage falls too low. This is a commonly known issue with these modules. What did you do to make it work?

WenukaB (author)Happymacer2017-10-06

Hi happy macer,

I'm facing the same problem! Can you tell me a method to suppy the required voltage.

Happymacer (author)WenukaB2017-10-06

hi WenukaB, I talk about that in my Instructables about the same module-do a search using my handle and I’m sure you will find them.

Anyhow what worked for me was a cheap power regulator from eBay and a large storage cap on the output. I happened to have a 5V 1F super cap so I used that and it worked 100%. Smaller caps may work too, you must just be able to supply the instantaneous peak current. There are also standard websites that also talk about the required power supply.

WenukaB (author)2017-10-06

Hello,

My GSM Module is not connecting to the cellular network. The network status indicator is keep blinking faster. (not every 3 seconds)

Can someone tell me how to fix that.

Thank you

SagaraK1 (author)2017-09-16

Sir, Can we save a received message to a array? I need to use the content of the message for another task. Could you help me sir. ?Please give an example code.

sankanva (author)2017-09-08

hi Is it possible to use for MMS?

ΝίκοςΝ1 (author)2017-05-04

Hi there
i am getting the message "NO CARRIER"

Does anybody knows what it means?

You Sim card is not getting registered with the gsm module... Usually it takes around few minutes.. Wait the status light to stabilize and network light to blink every 3 seconds.. then you would be good to go

KrishnaK159 made it! (author)2017-07-18

Perfect.. But I am Not able to receive text messages...

All Other Functions working fine

bibek_s1 (author)2017-06-05

thank you sir ....
it is very helpful to me for completing the major project

neildiamzon (author)2017-05-16

Works perfectly with Arduino UNO but it is not responding with the Mega2560. Is there a compatibility issue between GSM SIM900A and Mega 2560?

Raja47 made it! (author)2017-05-15

hi bro! you are a genius your code is working. but can u provide me a code to make it automatic

spiroskalantzis5 (author)2017-04-27

hello, it isn't working.. ERROR

Michael JohnG (author)2017-03-18

hi.. i used all of your codes but its sending a message automatically 3 times and in the serial monitor theirs nothing message to be displayed as well i cant receive any message .. what do you think is the problem?? thank you..

AsimZ (author)2017-01-10

thank you bro you just made my day

fateme33 (author)2016-12-19

hi ,thanks for your best site

I have problem with your library(softwareserial) because I buy arduino due.

can you help me?