Sensors/ SIM/ SIM800L

SIM800L GSM/GPRS Module

The SIM800L is a GSM/GPRS communication module that supports voice, SMS, and data transmission. It is ideal for IoT applications requiring wireless connectivity over quad-band GSM networks.

SIM800L GSM/GPRS Module image
SIM800L · UART
UART
Interface
6pins
Connections
3.4-4.4V
Supply
-40 to +85 °C
Operating temp
0.7mA
Power
$6.00
Typical price
On this page

SIM800L pinout

6 pins · UART

The SIM800L is a compact GSM/GPRS module with UART communication:

View:
SIM800L GSM/GPRS Module pinout
PinTypeDescriptionNotes
VCCPowerPower input3.4V to 4.4V (NOT 5V tolerant!)
GNDPowerGround connection
TXDCommunicationUART transmitSends data from module (connect to ESP32 RX)
RXDCommunicationUART receiveReceives commands (connect to ESP32 TX)
RSTControlReset pinActive low reset
NETControlNetwork status indicatorExternal antenna connection pad
  • GSM Bands: Quad-band 850/900/1800/1900MHz

  • Power: 3.4V-4.4V (use dedicated power supply!)

  • Interface: UART (typically 9600 or 115200 baud)

  • Current: Peak 2A during transmission

  • Antenna: External antenna required on NET pad

  • SIM Card: Nano-SIM or adapter needed

  • Features: Voice calls, SMS, GPRS data

  • Protocols: TCP/IP, HTTP, FTP, MMS

  • Applications: IoT, SMS alerts, remote monitoring

Wiring the SIM800L to ESP32

6 connections · 1 optional

To interface the SIM800L with an ESP32 via UART:

SIM800L GSM/GPRS Module wiring with ESP32
SIM800L pinESP32 pinPurpose
VCCExternal 4VStable power supply (NOT from ESP32!)
GNDGNDGround (shared with ESP32)
TXDGPIO16 (RX2)Module transmit to ESP32 receive
RXDGPIO17 (TX2)Module receive from ESP32 transmit
RSTGPIO5Reset control (optional) · optional
NETExternal AntennaGSM antenna connection
  • Power Warning: SIM800L requires 3.4-4.4V with 2A peak current - do NOT power from ESP32!

  • Power Supply: Use dedicated power supply or LiPo battery (3.7V) with large capacitors (100µF + 1000µF)

  • Baud Rate: Default 9600 or 115200 bps (check module specs)

  • TX/RX: Connect module TXD to ESP32 RX, module RXD to ESP32 TX

  • Antenna: External GSM antenna is mandatory for reliable operation

  • SIM Card: Insert nano-SIM with PIN disabled

  • Voltage Drop: Use thick wires (22AWG) and low-ESR capacitors

  • AT Commands: Control via AT command set

SIM800L code examples

5 platforms
Platform:

SIM800L Arduino example

Copy
#include <Arduino.h>

// Define baud rate for Serial communication
#define SERIAL_BAUD 115200
#define SIM800_BAUD 9600  // SIM800L default baud rate

// Initialize Serial2 (UART2) on ESP32 (RX=16, TX=17)
HardwareSerial serial2(2);

void setup() {
  // Initialize Serial Monitor
  Serial.begin(SERIAL_BAUD);
  delay(1000);  // Small delay to stabilize serial

  // Initialize SIM800L Serial (Serial2)
  serial2.begin(SIM800_BAUD, SERIAL_8N1, 16, 17); // TX=17, RX=16
  delay(1000);

  Serial.println("\nSIM800 EVB to ESP32 Serial port 2 test");
  Serial.println("Sending AT commands to check communication...\n");

  // Send AT command and check response
  sendATCommand("AT");          // Check if module is responding
  sendATCommand("AT+CGMI");     // Get manufacturer name
  sendATCommand("AT+CGMM");     // Get module model number
  sendATCommand("AT+CGMR");     // Get firmware version
  sendATCommand("AT+CGSN");     // Get serial number
}

void loop() {
  // Read data from SIM800L and print to Serial Monitor
  while (serial2.available() > 0) {
    Serial.write(serial2.read());
  }

  // Read data from Serial Monitor and send to SIM800L
  while (Serial.available() > 0) {
    serial2.write(Serial.read());
  }
}

// Function to send AT command and wait for response
void sendATCommand(const char *command) {
  Serial.print("Sending: ");
  Serial.println(command);
  serial2.println(command);  // Send command to SIM800L
  delay(1000);               // Wait for response

  // Print response from SIM800L
  while (serial2.available()) {
    Serial.write(serial2.read());
  }
  Serial.println("----------------------");
}

This Arduino sketch interfaces with the SIM800L module using the ESP32’s hardware serial communication (UART2). The ESP32 has multiple hardware serial ports, and this code uses Serial2 for communication with the SIM800L module.

Hardware Serial (UART2)

Unlike SoftwareSerial, which is used on boards like Arduino Uno, ESP32 has dedicated hardware UARTs. This code initializes Serial2 with the correct baud rate and assigns GPIO pins for RX and TX:

  • serial2.begin(9600, SERIAL_8N1, 16, 17);
  • Pin 16 (RX) and Pin 17 (TX) are used for UART communication.
  • The baud rate for SIM800L is set to 9600.

Setup Process

  1. Serial.begin(115200); initializes the Serial Monitor for debugging.
  2. serial2.begin() initializes communication with SIM800L over hardware serial.
  3. The sketch sends a series of AT commands (AT, AT+CGMI, AT+CGMM, AT+CGMR, AT+CGSN) to check the module’s response.

Loop Function

  • Any data received from the SIM800L module is read and printed to the Serial Monitor.
  • Any input from the Serial Monitor is forwarded to the SIM800L module.

Sending AT Commands

A function sendATCommand() is used to send commands and wait for responses:

  • It prints the command to the Serial Monitor.
  • Sends the command to the SIM800L module.
  • Waits for a response and prints it.

This sketch allows real-time communication with the SIM800L module through Serial Monitor, making it useful for debugging and testing AT commands.

SIM800L ESP-IDF example

Copy
#include <stdio.h>
#include <string.h>
#include "driver/uart.h"
#include "freertos/task.h"

#define TX_PIN 17
#define RX_PIN 16
#define UART_PORT UART_NUM_1

void app_main(void) {
    uart_config_t uart_config = {
        .baud_rate = 9600,
        .data_bits = UART_DATA_8_BITS,
        .parity = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE
    };

    uart_param_config(UART_PORT, &uart_config);
    uart_set_pin(UART_PORT, TX_PIN, RX_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
    uart_driver_install(UART_PORT, 1024, 0, 0, NULL, 0);

    char *test_cmd = "AT\r\n";
    uart_write_bytes(UART_PORT, test_cmd, strlen(test_cmd));

    while (true) {
        char data[128];
        int len = uart_read_bytes(UART_PORT, data, sizeof(data), 100 / portTICK_PERIOD_MS);
        if (len > 0) {
            data[len] = '\0';
            printf("Response: %s\n", data);
        }
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}

This ESP-IDF example demonstrates UART communication with the SIM800L module. The UART interface is configured with GPIO17 as TX and GPIO16 as RX. An AT command is sent to test communication, and responses from the module are printed to the console. The module’s replies are read using the uart_read_bytes function in a loop.

SIM800L ESPHome example

Copy
uart:
  tx_pin: GPIO17  # module RXD
  rx_pin: GPIO16  # module TXD
  baud_rate: 9600

sim800l:
  on_sms_received:
    - logger.log:
        format: "Received '%s' from %s"
        args: [ 'message.c_str()', 'sender.c_str()' ]

ESPHome's sim800l component gives native SMS support: on_sms_received triggers plus sim800l.send_sms and USSD actions. Wire the module's TXD to GPIO16 and RXD to GPIO17 (UART2, 9600 baud) per the wiring above, and power it from a supply that can deliver its 2A transmit bursts.

SIM800L PlatformIO example

Copy
[env:sim800l]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
src/main.cppCopy
#include <HardwareSerial.h>

HardwareSerial sim800l(1);

void setup() {
    Serial.begin(115200);
    sim800l.begin(9600, SERIAL_8N1, 16, 17); // RX, TX

    sim800l.println("AT"); // Test AT command
    delay(1000);
    while (sim800l.available()) {
        Serial.write(sim800l.read());
    }
}

void loop() {
    sim800l.println("AT+CMGF=1"); // Set SMS to text mode
    delay(1000);
    sim800l.println("AT+CMGS=\"+1234567890\""); // Replace with recipient's number
    delay(1000);
    sim800l.print("Hello from PlatformIO");
    delay(1000);
    sim800l.write(26); // CTRL+Z to send SMS
    delay(5000);
}

This PlatformIO code interfaces with the SIM800L module using HardwareSerial on an ESP32. The AT command is sent to test communication, and SMS functionality is implemented in the loop. GPIO16 (RX) and GPIO17 (TX) are configured as serial pins.

SIM800L MicroPython example

Copy
from machine import UART
import time

# Initialize UART
uart = UART(2, baudrate=9600, tx=17, rx=16)

def send_at(command):
    uart.write(command + '\r\n')
    time.sleep(1)
    while uart.any():
        print(uart.read().decode('utf-8'), end='')

# Test communication
send_at('AT')

# Send SMS
send_at('AT+CMGF=1')  # Set SMS to text mode
send_at('AT+CMGS="+1234567890"')  # Replace with recipient's number
uart.write("Hello from MicroPython" + chr(26))

This MicroPython code communicates with the SIM800L module over UART. It defines a function to send AT commands and display the response. The script tests communication with an AT command and sends an SMS by setting the module to SMS text mode, specifying the recipient, and finalizing the message with CTRL+Z (ASCII 26).

SIM800L specifications

From the datasheet
Frequency Bands
Quad-band 850/900/1800/1900MHz
Voltage Range
3.4V to 4.4V
Current Consumption (Sleep Mode)
0.7mA
Dimensions
15.8mm x 17.8mm x 2.4mm
Temperature Range
-40°C to +85°C
Protocol Support
TCP/IP, HTTP, FTP, MMS
SIM Card
Supports 1.8V and 3V SIM cards
Interface
UART (AT Command)

About the SIM800L

The SIM800L is the tiny end of the SIM800 family: a quad-band 850/900/1800/1900 MHz GSM/GPRS module on a breakout board small enough to hide inside a wearable, usually around 25 x 23 mm. It is also the module most associated with a specific piece of hardware lore: the supply has to sit between 3.4V and 4.4V (4.0V is the sweet spot) - not the ESP32’s 3.3V rail, and definitely not 5V - and during a transmit burst the module can pull up to 2A for fractions of a millisecond at a time. Powering it straight from a dev board’s onboard regulator is the single most common cause of random resets, boot loops, and “the module just won’t register” reports online; a LiPo cell, a bench supply set to 4V, or a beefy buck converter with a low-ESR bulk capacitor across VBAT is what the datasheet actually calls for.

Breakout boards vary in how they handle the antenna: some solder on a small coiled spring antenna directly, others bring out an IPEX/U.FL pad for a proper external antenna, and reception differs noticeably between the two - a spring antenna is fine on a strong signal but struggles at the edge of coverage. As with the rest of this 2G family, whether any of that matters depends entirely on the deployment country: US carriers have fully retired 2G (T-Mobile, the last holdout, shut its GSM network down on August 3, 2026), several EU carriers plan to keep limited 2G running into the late 2020s or beyond for fallback and IoT use, and 2G in India remains commercially active with no announced shutdown date as of 2026.

TinyGSM lists the SIM800L by name among its supported modems, so it works with the mainline library out of the box. Where 2G still runs, it remains a legitimate, extremely cheap way to add SMS or low-rate GPRS to a project; the SIM800C is the same generation with Bluetooth built in, and SIM808 adds GPS to the same GSM engine if location is also needed. For a build that has to keep working for years or ship to an unknown region, an LTE part like SIM7600G or SIM7000 is the safer choice.

SIM800L troubleshooting

4 common issues

Module Continuously Resets or Reboots

›

Issue: The SIM800L module restarts frequently, indicated by the status LED turning off and on repeatedly.

Possible causes include insufficient power supply or voltage drops due to wiring.

Solution: Use a dedicated power supply capable of providing 4V and at least 2A. Incorporate low ESR capacitors (e.g., 100µF tantalum and 470µF electrolytic) close to the module's power pins to handle current spikes. Additionally, use short, thick wires (e.g., 22AWG) to minimize resistance and ensure consistent voltage levels.

Failure to Connect to the Cellular Network

›

Issue: The module's network LED blinks rapidly, indicating it is not registered on the network.

Possible causes include incorrect SIM card configuration, poor signal strength, or frequency mismatch.

Solution: Ensure the SIM card is active, has sufficient balance, and the PIN lock is disabled. Check the external antenna connection and position it in a location with better network coverage. Verify that the module supports the cellular network's frequency bands in your region.

UART Communication Issues

›

Issue: No response from the module when sending AT commands.

Possible causes include incorrect baud rate, wiring errors, or power instability.

Solution: Ensure that the module and the microcontroller are set to the same baud rate (default is 9600). Confirm the RX and TX pins are connected correctly (RX to TX and TX to RX). Use a stable power source and add decoupling capacitors to avoid power fluctuations.

Unstable GSM Signal

›

Issue: The SIM800L fails to maintain a stable connection, resulting in dropped calls or intermittent data transmission.

Possible causes include poor antenna placement or interference from nearby electronics.

Solution: Use a proper external antenna and position it away from other electronic components that may cause interference. Ensure that the antenna connection to the NET pin is secure.

Where to buy the SIM800L

SIM800L GSM/GPRS Module
SIM800L GSM/GPRS Module
$6.00per unit, typical
Amazon and AliExpress links are affiliate links - buying through them supports the site at no extra cost to you.

Resources

Similar sensors