How to Use Arduino SIM800L GPRS GSM Module for SMS and Calls
How to Use Arduino SIM800L GPRS GSM Module for SMS and Calls
The SIM800L is the world’s smallest GSM module, featuring a built-in antenna and micro SIM support. It can send SMS, make outgoing calls, and connect to the internet like larger GSM modules. However, speaker and microphone pins are removed, so voice calls cannot be answered. It’s ideal for cost-effective projects.
Required Components
- Arduino UNO R3 with USB cable
- Power Adapter 9V 2A (5.5x2.5mm jack)
- SIM800L GPRS GSM Module
- MB-102 Breadboard 830 Point
- Jumper wires M-M, M-F, F-F 20cm each (40 pieces per type)
Wiring Diagram: Arduino to SIM800L
Connection reference:
| Arduino | SIM800L |
|---|---|
| 5V | +5V |
| GND | GND |
| Pin 2 | SIM_TXD |
| Pin 3 | SIM_RXD |
Important: SIM800L draws up to 5A peak current. USB power alone is insufficient. Connect a 9V 2A power adapter or external power source.
Installing GSM900 Library
- Download GSM900 Library from MediaFire
- Extract with WinRAR or WinZip
- Copy the GSM900 folder to
Documents/Arduino/libraries/ - Open Arduino IDE
Testing SIM800L Connection
- Go to File > Examples > GSM900 > GSM_GPRSLibrary_AT
- Select Board: Arduino UNO
- Select the correct Port
- Upload the code
- Open Serial Monitor at 9600 baud
#include <GSM900.h>
// GSM module connected to TX Pin 2, RX Pin 3
#define SIM_TXD 2
#define SIM_RXD 3
GSM900 gsm(SIM_TXD, SIM_RXD);
void setup() {
Serial.begin(9600);
gsm.begin();
// Wait for module initialization
while (!gsm.isReady()) {
Serial.println("Connecting to GSM module...");
delay(1000);
}
Serial.println("GSM Module Ready");
}
void loop() {
// Check for data from GSM module
if (gsm.available()) {
Serial.write(gsm.read());
}
// Forward Serial input to GSM module
if (Serial.available()) {
gsm.write(Serial.read());
}
}
When upload completes, check Serial Monitor. Status=READY and ATT: SHUT OK indicate successful connection.
Fixing RIC: ERROR
If Serial Monitor shows RIC: ERROR, the board communicates with the module but the module can’t connect to the SIM card.
Solution:
- Use a male-to-female jumper wire to connect the RST pin to GND
- Hold for 3-5 seconds, then remove
- Press the Reset button on Arduino once
If successful, RIC changes from ERROR to SHUT OK, and the LED blink rate slows down.
Checking Connection Status
Use these AT commands in Serial Monitor:
| Command | Purpose |
|---|---|
| AT | Test connection - returns OK if working |
| AT+COPS? | Check cellular signal - returns network name if connected |
Making Outgoing Calls
Type ATD followed by the phone number, ending with ;
Example - Calling 092-756-6556:
ATD0927566556;
Wait a moment and the target phone will receive an incoming call. If unanswered, Serial Monitor shows BUSY.
Receiving Incoming Calls
When a call comes to the SIM number in the module, Serial Monitor displays the caller’s phone number.
Sending SMS via AT Commands
Step 1: Set Text Mode
AT+CMGF=1
This configures the module for English text messages only.
Step 2: Send SMS
AT+CMGS="0927566556"
A > prompt appears. Type your message and press Ctrl+Z to send.
[image: Serial Monitor screenshot showing SMS commands AT+CMGF=1 and AT+CMGS with the > prompt waiting for message input]
Sending SMS via Library
Use the example at File > Examples > GSM900 > GSM_GPRSLibrary_SMS
#include <GSM900.h>
#include <SMS.h>
SMS sms;
// TX Pin 2, RX Pin 3
#define SIM_TXD 2
#define SIM_RXD 3
GSM900 gsm(SIM_TXD, SIM_RXD);
void setup() {
Serial.begin(9600);
gsm.begin();
// Wait for GSM module initialization
while (!gsm.isReady()) {
delay(1000);
}
// Initialize SMS
sms.begin(gsm);
Serial.println("Sending SMS...");
// TODO: Modify phone number and message as needed
// Example: sending to 0927566556 with message "Hi CyberTice"
sms.sendSMS("0927566556", "Hi CyberTice");
}
void loop() {
// Forward data between Serial and GSM module
if (Serial.available()) {
gsm.write(Serial.read());
}
if (gsm.available()) {
Serial.write(gsm.read());
}
}
Note: Before uploading, modify the phone number and message in the setup() function.
On success, you see “SMS sent successfully” or a deprecation warning indicating the message was sent. Consider using GetSMS from the SMS class for future projects.
LED Status Indicators
| LED Pattern | Meaning |
|---|---|
| Fast blink | No SIM signal detected |
| Slow blink | Connected to cellular network |
Summary
SIM800L offers excellent value for SMS and outgoing call projects. The key is ensuring adequate power supply. Library usage mirrors SIM900, making it familiar to those who have used that module. Installation is straightforward and operation is relatively simple once connected.
อยากทำโปรเจคแบบนี้?
รับทำโปรเจค Arduino / IoT จบงานไว ส่งงานครบ พร้อมสอน
If you need Arduino project service or urgent IoT development, see full service details on the home page
จ้างทำโปรเจคเลย