If you have ever dealt with the SIM800L module, you are aware of its potential as a potent tool for a variety of tasks, such as sending SMS messages, placing phone calls, and even using GPRS to access the internet. But just like any other technology, problems might arise. We’ll explain how to connect the Sim800L with the Arduino Uno in this blog post, along with some troubleshooting advice to help you get it up and running. You can see if it interests you that we have previously interfaced the Sim800L with the ESP32. You can also look at our other projects, such as GSM Based Home Automation, DIY IVR Phone Call System, Portable internet for Raspberry Pi, etc., after you know how to perform this fundamental interface.
Prior to commencing troubleshooting, Let me discuss some basic features of the GSM module.
GSM: What is it?
Global System for Mobile, or GSM, is a cellular standard that was mainly created for mobile communication. The GSM standard was created to make mobile device communication easier. Users can utilize this digital cellular network technology to send and receive messages, make calls, and access basic data services like MMS (Multimedia Messaging Service) and SMS (Short Message Service). Global GSM networks cover a range of frequency bands, giving mobile subscribers the ability to roam abroad.
GPRS: What is it?
The acronym for General Packet Radio Service is GPRS. The GSM standard has been improved by GPRS, allowing for mobile data transmission. It gives GSM networks access to packet-switched technology, which enables faster data transfer rates than those possible with circuit-switched techniques. Features like email and web browsing are made possible using GPRS. access, as well as additional mobile data-intensive apps. It is more effective for data transfer than its predecessor because it maximizes network resources by only using bandwidth when data is being transmitted.
Feature | GSM | GPRS |
Acronym | Global System for Mobile Communications | General Packet Radio Service |
Technology | Circuit-switched | Packet-switched |
Voice Communication | Primary focus, supports voice calls and SMS | Secondary, supports voice but is optimized for data |
Data Transmission | Initially designed for voice, supports data with added functionality | Optimized for data transmission |
Data Speed | Upto 9.6 kbps | Typically up to 114 kbps (2.5G), later enhancements offer higher speeds |
Connection Duration | Always-on connection for voice calls | On-demand connection, data sessions initiated as needed |
Billing | Billed based on usage (calls and SMS) | Billed based on data transferred, usually in kilobytes or megabytes |
Network Architecture | Traditional cellular network with a voice-centric focus | Overlay on GSM network, utilizing existing infrastructure for data services |
Application | Voice calls, SMS, low-bandwidth data applications | Internet browsing, email, multimedia messaging, mobile apps, IoT connectivity |
Pinout for SIM800L Module
The SIM800L module is a GSM/GPRS module with an extensive feature set. It looks like a little chip with several pins and an antenna connector. The sim800lpinout is displayed in the image below; this will be helpful for connecting the sim800l gsm module to an Arduino later on.
The pins that are on the left side of this, which include VCC, GND, TX, and RX, are of special relevance to us. These pins are essential to how it works.
How is the Sim800L GSM Module Powered?
Having a reliable power source is one important component. The 3.7V to 4.2V input voltage used by the SIM800L module may differ from what is typically seen in electronics. To satisfy this requirement, you can either use a 3.7V li-ion battery or a buck converter with a maximum current capacity of 2A or higher that is set at 4 V. Important information: The reason the buck converter’s current capacity is stated as being larger than or equal to 2A is because the GSM module uses a lot of power, especially while sending phone calls or messages.
The power supply can be further stabilized by connecting a capacitor between VCC and GND, but the module can also function without one.
Connecting the Arduino UNO to the Sim800L
The full SIM800L Arduino circuit is provided below; note that voltage compatibility is an important consideration when utilizing the SIM800L with a microcontroller such as an Arduino. While many microcontrollers, like Arduino, function internally at 5V, the module operates at 3.3V. Make sure the level shifting is done correctly to avoid damaging the module. When data is being transmitted from the microcontroller to the module, a voltage divider is frequently required.
As you can see from the above Sim800L Arduino wiring schematic, I’ve created a voltage divider by connecting one 10k and one 20k resistor in series to convert 5V to 3.3V, but you can use other values as well. I have calculated the resistor values using a voltage divider calculator. You may also attempt to alter the values.
Circuit of Sim800L
Establish the correct circuit connection, making sure your microcontroller and SIM800L module are wired together. Look for any loose connections—even the smallest mistake might cause problems. I’ve built a little circuit that resembles the picture below, however soldering is not really necessary for it to function. Simply make sure the jumper connections are correct.
Is the Sim800L not Functioning?
Assume for the moment that you have powered the Sim800l GSM module and performed all the necessary connections, but the module is not functional. Now let’s talk about some potential problems that you can run into while using the SIM800L module for the first time after turning it on.
How the SIM800L Should Be Inserted
Keep in mind that 2G SIM cards are intended to be used with the SIM800L. Make sure your SIM card is compatible with this module and installed correctly if your Sim800l isn’t detecting SIM. This is how it ought to seem.
If your Sim800l is not detecting your SIM card even after you’ve inserted it correctly, there may be an issue with your power supply or circuit connections. By observing the network status LED as indicated below, you can determine whether your SIM card is being recognized.
LED Network Status Indication for SIM800L
A network status indicator LED on the SIM800L module blinks at various rates to show the status of the network.
- A fast blink (once every second) suggests that the module is running but hasn’t connected to the cellular network.
- A slower blink (once every two seconds) indicates an active GPRS data connection.
- The desired state for this tutorial is one blink every three seconds, indicating that the module can send and receive voice and SMS.
Unable to connect to the network, Sim800L
- Verify that the 2G compatible SIM card—which comes with a call and SMS recharge—is inserted correctly and that neither the card nor the sim connector are broken or damaged.
- Raise the voltage that the buck converter supplies, but don’t go above the 4.2V maximum voltage that the module can handle.
- Check to see whether other SIM cards from the same network are properly covered where you are. If not, try again with a different SIM card.
- Should the issue continue, it may be a malfunctioning SIM800L module that needs to be changed.
Is 4G support available for the Sim800L module? is another often asked topic about it. The response, then, is no. The Sim800L module does not support 3G or 4G; it only supports 2G. That is to say, if you are in India, Airtel and Vodafone are your only options. Note: If you are not receiving a blink every three seconds, stop moving beyond this point. If the Sim800l module is not registering to the network even after doing all these procedures, there may be a problem with the module and you should consider replacing it.
Command Test for SIM800L AT
You can interface with the SIM800L module by uploading an AT command test program to your Arduino. The simplest method for texting if your SIM800L
Before sending commands to the SIM800L module, make sure you have uploaded the code below onto your Arduino device. As an alternative, you may try the same thing using a USB to TTL converter in instead of an Arduino.
// Create a SoftwareSerial object to communicate with the SIM800L module
SoftwareSerial mySerial(3, 2); // SIM800L Tx & Rx connected to Arduino pins #3 & #2
void setup()
{
// Initialize serial communication with Arduino and the Arduino IDE (Serial Monitor)
Serial.begin(9600);
// Initialize serial communication with Arduino and the SIM800L module
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); // Handshake test, should return "OK" on success
updateSerial();
mySerial.println("AT+CSQ"); // Signal quality test, value range is 0-31, 31 is the best
updateSerial();
mySerial.println("AT+CCID"); // Read SIM information to confirm whether the SIM is inserted
updateSerial();
mySerial.println("AT+CREG?"); // Check if it's registered on the network
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read()); // Forward data from Serial to Software Serial Port
}
while (mySerial.available())
{
Serial.write(mySerial.read()); // Forward data from Software Serial to Serial Port
}
}
To ensure that the module is responsive, make sure it says “OK” in response. By just entering in a different command, you can try the call and SMS functionality in the same setup if this is working for you and you’re feeling adventurous.
SMS transmission in SIM800L using Arduino
The Arduino code for sending a message on a SIM800L is shown below. Simply update the phone number (+XXXXXXXXXXXX) and text message that has to be sent, then submit the code.
This is the whole Arduino code for the Sim800l SMS.
#include <SoftwareSerial.h>
// Create a SoftwareSerial object to communicate with the SIM800L module
SoftwareSerial mySerial(3, 2); // SIM800L Tx & Rx connected to Arduino pins #3 & #2
void setup()
{
// Initialize serial communication with Arduino and the Arduino IDE (Serial Monitor)
Serial.begin(9600);
// Initialize serial communication with Arduino and the SIM800L module
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); // Handshake test, should return "OK" on success
updateSerial();
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS=\"+ZZxxxxxxxxxx\""); // Change ZZ with the country code and xxxxxxxxxxx with the phone number to send an SMS to
updateSerial();
mySerial.print("UpdatrHub | updatehub.xyz"); // SMS text content
updateSerial();
mySerial.write(26); // Send the CTRL+Z character to terminate the SMS
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read()); // Forward data from Serial to Software Serial Port
}
while (mySerial.available())
{
Serial.write(mySerial.read()); // Forward data from Software Serial to Serial Port
}
}
Check with the sim card network provider to see if 2G SMS are available on their network if your Sim800l isn’t transmitting SMS.
Making Calls with Arduino on a SIM800L
Let’s check the call feature now. Copy and paste the following code, replacing the phone number (+XXXXXXXXXXXX) with the recipient’s number.
This is the entire Arduino code for the Sim800L call where the adjustments are needed.
#include <SoftwareSerial.h>
// Create a SoftwareSerial object to communicate with the SIM800L module
SoftwareSerial mySerial(3, 2); // SIM800L Tx & Rx connected to Arduino pins #3 & #2
void setup()
{
// Initialize serial communication with Arduino and the Arduino IDE (Serial Monitor)
Serial.begin(9600);
// Initialize serial communication with Arduino and the SIM800L module
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); // Handshake test, should return "OK" on success
updateSerial();
mySerial.println("ATD+ZZxxxxxxxxxx;"); // Change ZZ with the country code and xxxxxxxxxxx with the phone number to dial
updateSerial();
delay(20000); // Wait for 20 seconds...
mySerial.println("ATH"); // Hang up the call
updateSerial();
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read()); // Forward data from Serial to Software Serial Port
}
while (mySerial.available())
{
Serial.write(mySerial.read()); // Forward data from Software Serial to Serial Port
}
}
Now, upload the code and your recipient should receive a call.