SIM800L V2 GSM GPRS Module Documentation
The SIM800L V2 is a quad-band GSM/GPRS module that supports GSM850, EGSM900, DCS1800, and PCS1900 frequencies. It is a popular choice for IoT projects that require cellular connectivity. This module is compatible with a wide range of microcontrollers and can be used for various applications, including SMS, voice calls, and data transmission.
The SIM800L V2 module has a total of 24 pins, with the following pinout:
| Pin | Description |
| --- | --- |
| 1 | VBAT (Battery Power) |
| 2 | VCC (Power Supply) |
| 3 | GND (Ground) |
| 4 | TXD (Transmit Data) |
| 5 | RXD (Receive Data) |
| 6 | RTS (Request to Send) |
| 7 | CTS (Clear to Send) |
| 8 | DTR (Data Terminal Ready) |
| 9 | DSR (Data Set Ready) |
| 10 | RI (Ring Indicator) |
| 11 | VIO (Voltage Input/Output) |
| 12-24 | GPIO (General Purpose Input/Output) |
The SIM800L V2 module supports the following communication protocols:
GSM 07.07 and 07.05 (SMS)
GSM 07.10 (Voice Call)
TCP/IP (Data Transmission)
### Example 1: Sending SMS using Arduino
In this example, we will use the SIM800L V2 module to send an SMS using an Arduino board.
Arduino Uno or compatible board
SIM800L V2 module
SIM card with a valid phone number
Breadboard and jumper wires
Arduino IDE (version 1.8.x or later)
Code:
```cpp
#include <SoftwareSerial.h>
#define SIM800_TX_PIN 10
#define SIM800_RX_PIN 11
SoftwareSerial sim800(SIM800_TX_PIN, SIM800_RX_PIN);
void setup() {
Serial.begin(9600);
sim800.begin(9600);
// Wait for the module to initialize
delay(1000);
// Check if the module is ready
sim800.println("AT");
delay(1000);
while (!sim800.available());
String response = sim800.readStringUntil('
');
if (response.indexOf("OK") != -1) {
Serial.println("SIM800L V2 module is ready");
} else {
Serial.println("SIM800L V2 module not responding");
return;
}
// Send SMS
sim800.println("AT+CMGF=1");
delay(1000);
sim800.println("AT+CMGS=""+1234567890""");
delay(1000);
sim800.println("Hello from SIM800L V2!");
delay(1000);
sim800.println((char)26);
delay(1000);
}
void loop() {
// Nothing to do here
}
```
### Example 2: Making a Voice Call using Python
In this example, we will use the SIM800L V2 module to make a voice call using a Raspberry Pi board and Python.
Raspberry Pi (any model)
SIM800L V2 module
SIM card with a valid phone number
Breadboard and jumper wires
Raspbian OS (version 10 or later)
Python 3.x
Code:
```python
import serial
# Initialize the serial connection
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
# Wait for the module to initialize
ser.write(b'AT
')
response = ser.readline()
if b'OK' in response:
print("SIM800L V2 module is ready")
else:
print("SIM800L V2 module not responding")
exit()
# Make a voice call
ser.write(b'ATD+1234567890;
')
response = ser.readline()
if b'OK' in response:
print("Call connected")
else:
print("Call failed")
```
### Example 3: HTTP GET Request using MicroPython
In this example, we will use the SIM800L V2 module to send an HTTP GET request using a MicroPython board, such as the ESP32 or ESP8266.
MicroPython board (ESP32 or ESP8266)
SIM800L V2 module
SIM card with a valid phone number
Breadboard and jumper wires
MicroPython firmware (version 1.1 or later)
Code:
```python
import machine
import urequests
# Initialize the serial connection
uart = machine.UART(1, 9600)
# Wait for the module to initialize
uart.write(b'AT
')
response = uart.readline()
if b'OK' in response:
print("SIM800L V2 module is ready")
else:
print("SIM800L V2 module not responding")
exit()
# Set up the GPRS connection
uart.write(b'AT+SAPBR=3,1,"CONTYPE","GPRS"
')
response = uart.readline()
if b'OK' in response:
print("GPRS connection established")
else:
print("GPRS connection failed")
exit()
# Send an HTTP GET request
response = urequests.get('http://example.com')
print(response.text)
# Close the GPRS connection
uart.write(b'AT+SAPBR=0,1
')
```
These code examples demonstrate the basic functionality of the SIM800L V2 module. You can use these examples as a starting point for your IoT projects that require cellular connectivity.