กลับหน้าหลัก
views
How to Use Arduino SIM800L GPRS GSM Module for SMS and Calls
Last updated on

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

Circuit diagram showing Arduino UNO connected to SIM800L Module with wires: 5V to +5V, GND to GND, Pin 2 to SIM_TXD, Pin 3 to SIM_RXD on a breadboard

Connection reference:

ArduinoSIM800L
5V+5V
GNDGND
Pin 2SIM_TXD
Pin 3SIM_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

  1. Download GSM900 Library from MediaFire
  2. Extract with WinRAR or WinZip
  3. Copy the GSM900 folder to Documents/Arduino/libraries/
  4. Open Arduino IDE
File Explorer window showing path Documents/Arduino/libraries/GSM900 with the library folder visible

Testing SIM800L Connection

  1. Go to File > Examples > GSM900 > GSM_GPRSLibrary_AT
  2. Select Board: Arduino UNO
  3. Select the correct Port
  4. Upload the code
  5. 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:

  1. Use a male-to-female jumper wire to connect the RST pin to GND
  2. Hold for 3-5 seconds, then remove
  3. Press the Reset button on Arduino once
Close-up diagram pointing to the RST pin on SIM800L Module with an arrow showing connection to GND

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:

CommandPurpose
ATTest 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 PatternMeaning
Fast blinkNo SIM signal detected
Slow blinkConnected 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

จ้างทำโปรเจคเลย

ความคิดเห็น

Verified user reviews

รีวิวและความคิดเห็นจากผู้ใช้จริง

ล็อกอินด้วยบัญชีบนเว็บนี้แล้วให้คะแนนหรือคอมเมนต์ได้เลย ระบบเก็บผ่าน Supabase ไม่ต้องใช้ GitHub แล้ว

กำลังโหลดรีวิว...