Contents
How to develop working model of Send Receive SMS & Call with SIM800L GSM Module
SIM800L is one of those modules that helps the user to interact with mobile phones by sending or receiving updates. Hence this compact and portable device can be integrated with many IoT devices. Moreover, it also allows the user to connect to the internet by the GPRS, IP, TCP, etc.
SIM800L Module:
The module contains the cellular chip of SimCom. The module has a Helical Antenna that gets soldered directly to the NET pin on the PCB. Also, it has a SIM socket that allows any micro 2G SIM card. Furthermore, the module uses the AT command to start the communication. The module holds the LED on the top right side which shows the status of the network. Hence, the LED blinks at various rates to indicate the states.
Circuit Diagram:


Working Details:
Connect SIM800L GSM Module & Arduino according to the circuit diagram. Now, for the initialization of commands use AT command code and upload the code in Arduino IDE. Hence you will analyze the initialization of the commands on the serial monitor. Write the sending SMS code and upload that too to send the message. To receive the message, write the receiving message code and upload it to your Arduino. To make a call, upload the code of making the call. And, to receive the call, write the code for receiving the code. Also, you can observe the readings on the Serial Monitor.
Code Explanation
Include the SoftwareSerial.h library.
Initialize the Arduino pins that are connected to the transmitter and the receiver.
In the void setup, Initialize the serial monitor by Serial.begin( ). Initialize the link between the module and Arduino by using mySerial.begin( ). After that, create the basic connections to communicate with the module. Send different commands by using mySerial. println( ). In the bracket write the required commands.
For example, use AT command to send some commands to query the module. Similarly, use AT+CSQ to test the signal quality. In the same vein, to read the sim data use AT+CCID. To check whether you are registered on the network, use AT+CREG.
In the void loop, call the function updateSerial( ) to wait for the coming input from the serial monitor and then send it to the module by the receiver pin (D2) of the module. Also, it read the transmitter pin (D3) continuously.
FOR SENDING SMS:
The code is almost the same as the above-mentioned code of AT command except for some snippets. Like in the void setup, use mySerial.prinln(AT+CMGF=1) to select the format of the message. Use mySerial.prinln(AT+CMGS=\”+91xxxxxxxxx\”) to send the SMS to this phone number given in the bracket. xxxxxxxx code for the phone number. use mySerial. Print( ) to send the text message to that number.
SENDING SMS CODE:
#include <SoftwareSerial>
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino PIN 3 & PIN 2
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT");
updateSerial();
mySerial.println("AT+CMGF=1");
updateSerial();
mySerial.println("AT+CMGS=\"+91xxxxxxxxxx\"");//change xxxxxxxxxxx with phone number to sms
updateSerial();
mySerial.print("Iam Fine"); //text content
updateSerial();
mySerial.write(26);
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
FOR READING SMS:
This code is also the same as the given code of AT command except for some snippets. Like in the void setup, use mySerial.prinln(AT+CMGF=1). Use mySerial. printin(“AT+CNMI=1,2,0,0,0”) to receive the message.
FOR MAKING CALL:
In the making call sketch, make changes in the void setup of the above code. Use mySerial.prinln(“AT”) for the handshake. Now, use mySerial.prinln(AT+CMGS=\”+91xxxxxxxxx\”) to make a call on this phone number given in the bracket. Use mySerial.prinln(“ATH”) to hang up the call.
FOR RECEIVING THE CALL:
#include<SoftwareSerial>
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino pin 3 & pin 2
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT");
updateSerial();
mySerial.println("ATD+ +91xxxxxxxxxx;"); // change xxxxxxxxxxx with phone number to dial
updateSerial();
delay(20000); // wait for 20 seconds...
mySerial.println("ATH"); //hang up
updateSerial();
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
Application:
1. In the automotive industry.
2. For personal tracking.
3. In IoT devices.



