Interfacing SIM800 GSM Modem with Arduino

This post is intended to help beginners interfacing SIM800 GSM Modem to Arduino.

Arduino serial

Power supply requirement:

The power supply to the board should be 12v, 1-2A.The SIM800 modem described in this link has both RS232 and TTL type inputs. Make sure that the two pins labeled as power key are shorted, it is required for the modem to turn ON.When the modem turns ON the “power” and the “stat” LEDs also turn ON and  the network LED starts blinking.

Note.1: The power key feature is included so that we can turn ON the Modem using a controller, as required ,which can be helpful for low power applications.

 

Note.2: The Blinking pattern of the network LED has the following information.

Status                               SIM800 behavior
Off                                          SIM800 is not running
64ms On/ 800ms Off       SIM800 not registered in the network
64ms On/ 3000ms Off     SIM800 registered to the network
64ms On/ 300ms Off       GPRS communication is established

The code is tested with SIM800 and Arduino UNO. Connect the Tx and Rx pins of arduino pins to Rx and Tx pins of GSM Modem.

Note: The uart pins should be cross connected, ie. GSM Tx –> Arduino Rx and GSM Rx –> Arduino Tx. Make the ground common between Arduino and GSM modem.

C360_2016-06-28-12-05-18-513

TTL pins can be seen just behind the 9 pin DB9 connector. If you are using DB9 connector for interfacing you need MAX232 circuitary for converting RS232 output of DB9 to TTL levels.

Copy and paste the following code to your Arduino IDE as a starting point for GSM-Arduino interfacing test.

Note : Before powering SIM800 module user should insert the SIM into the module.

Change the phone number in the below code before running the code.


/*
Author: Dhanish
Created on: 19-08-2014
Company: Elementz Engineers Guild Pvt Ltd
Run this code only after SIM800 Module has powered and connected to a Network.
Please make a call to the module knowing whether the connection is established.
If connected a ring will be heard at the caller end
*/

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);

delay(10000);
// print the serial data to GSM
Serial.print("ATD9020XXXXXX;" ); // change here to call a number using SIM800
// wait 10 seconds before the next loop
delay(10000);
Serial.print("ATH" ); // hold the call
}

void loop() {
}

Another code using Software serial is as seen below

Note: Connect as follows
         digital pin 10 — connect to TX of GSM Modem
         digital pin 11 — connect to RX of GSM Modem

/*
The circuit:
* RX is digital pin 10 (connect to TX of GSM Modem)
* TX is digital pin 11 (connect to RX of GSM Modem)
*/
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);

Serial.println("Calling through GSM Modem");

// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
delay(2000);
mySerial.println("ATD81290255XX;"); // ATD81290255XX; -- watch out here for semicolon at the end!!

Serial.println("Called ATD81290255XX");
}

void loop() // run over and over
{
// print response over serial port
if (mySerial.available())
Serial.write(mySerial.read());
}

Arduino sample code can also be downloaded from the following Link.

19 thoughts on “Interfacing SIM800 GSM Modem with Arduino

    • Short Answer: DIY(Do it Yourself).

      Long Answer: We cannot develop for each and every microcontroller out there in the market. All you have to do is communicate with the module serially. We are sharing the Arduino code because the Arduino ecosystem is beginner friendly and easy to use. And there is less likely to get any error even if you copy paste the code that we provide. But in the case of other microcontrollers this is not the case. However, you can get sufficient help from avrfreaks forums.

  1. hai,
    i have a sim 800c module and an arduino uno.i need an output in pin1 of arduino when a call receive at gsm module.
    please help me

  2. Hello sir,
    I baught a SIM 800L and Arduino UNO R3. But I can not run SIM 800L. Would you please help me?
    Actually I want to make a little project. Like on/off a relay by sending SMS or DTMF system. Please help me. Thanks

  3. i would try  to interface the sim800L gsm module to arduino UNo but the signal was not available and i tried with 4 gsm modules  the signal was not available and i used strip Antenna, GSM Antenna and i also  resistors connections also still it was not working please help to to get signal for this modules thank you

    • You need to power cycle the board after inserting the SIM, and check for the LED pattern. Also the SIM should be 2G compatible. Jio sim is not supported. If you have doubt about 2G compatibility, put the sim in a smart phone and select 2G only mode. If the SIM finds range in 2G mode, then it can be used with the SIM800L module. as well.

  4. I tried sim 800l module interfacing to arduino uno and i connected as per refereed circuit diagram but i connected DC-DC buck converter also in sim 800l module the signal was not defecting even buck-converter also connected what is the problem i dont know could any one know please give reply.

  5. Hi sir. I tried sim 800l module interfacing to arduino uno and i connected as pre refereed circuit diagram but i connected DC-DC buck converter also in sim 800l module the signal was not defecting even buck-converter also connected and sim is also working please give replay.

Leave a comment