Tutorial to Interface GSM SIM900A With Arduino

140,958

63

48

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

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

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

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

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

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

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

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

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.

5 People Made This Project!

Recommendations

  • Colors of the Rainbow Contest

    Colors of the Rainbow Contest
  • IoT Challenge

    IoT Challenge
  • Classroom Science Contest

    Classroom Science Contest

48 Discussions

0
None
Lakrellon

Question 5 days ago on Introduction

have you got any projects based on sim800L gsm/gprs module.
i want to use it to access uk gsm network

0
None
Aadityaraj1111205624

Question 5 weeks ago

Please answer the questions given below...Please

1
None
Prashanth R S

8 weeks ago

Sir, I have connected the 5v and gnd to the gsm module .network led is blinking and status led is blinking slowly, but network is not established. I am using tata docomo 3G sim. Please help me

0
None
Dhanashri Bhoj

Question 2 months ago on Step 9

How to parse only text from whole string and store it into any variable?

0
None
PallaviS22

Question 2 months ago on Step 9

I have done all the steps as per the guidance but i am to able to do any of the operation through serial monitor . please help

0
None
bryanm161

2 months ago

Hello Im planning to convert this to c# code, what library can i use for reference.

1
None
AnimeshN2

Question 2 months ago on Step 1

My sim900A is blinking fast i think it is not getting connected to the network ...
On writing AT command I am getting reverse "???" what might be the problem

0
None
AaronPrice

3 months ago

Hey. Super cool tutorial. I'm looking to use a GSM module to relay data from the ocean back to us onshore. I'm searching for the module you have and am having some trouble finding it. Could you link the website to which you purchased it below.

2
None
smkiron

9 months ago

hello, i need your help,my GSM LED not blink continuously every 3 seconds like you mentioned in your tutorial. i think it not connect to the network, how to i solve this problem? please, help me.

IMG_20180725_004203_HHT.jpgIMG_20180725_004201_HHT.jpg
1 reply
0
None
AhmadS262smkiron

Reply 4 months ago

try use 5V 2A power adapter, mine works.

0
None
smkiron

9 months ago

New module Sim900a whats problems sir
My Country Bangladesh

Screenshot (16).png
1 reply
0
None
RashidMostafasmkiron

Reply 5 months ago

Desher networkta bhinno code lage. But I'm not sure what variations there are. Google Banglar phone networker technical spec.

0
None
MedasaryS

Question 5 months ago

Hello,
I used the same code in my arduino+sim900a kit, it is perfectly uploaded, but not sending SMS or call or receiving...
please suggest and if possible tell me how do i make it work or active GSM shield.

IMG_20181206_155554.jpg
0
None
WenukaB

1 year ago

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

2 replies
0
None
RafaelD113WenukaB

Reply 11 months ago

SIM900A module works only in asian countries, because it is dual-band not quad-band.

0
None
AshyrafMRafaelD113

Reply 9 months ago

my gsm working like that blinking faster(not blinking every 3 second) but why at serial monitor show (yyyyyyyyyyyyyyyyyy) without stop after connect all port by following the pictures above.

0
None
NitinC30

10 months ago on Step 5

Which port of arduino we r generally used?? And in programing what we have to choose

0
None
ΝίκοςΝ1

2 years ago

Hi there
i am getting the message "NO CARRIER"

Does anybody knows what it means?

2 replies
0
None
RafaelD113ΝίκοςΝ1

Reply 11 months ago

Thats because you cannot connect to the network.

If youre using SIM900A

SIM900A module works only in asian countries, because it is dual-band not quad-band.

0
None
KrishnaK159ΝίκοςΝ1

Reply 1 year ago

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