The SIM800L is a compact and versatile GSM/GPRS module that allows embedded systems to communicate over cellular networks. It is capable of sending SMS messages, making voice calls, connecting to the internet via GPRS, and even supporting Bluetooth communication. This module is widely used in IoT projects, remote monitoring systems, and mobile communication applications.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.4V to 4.4V) |
2 | RST | Reset pin (active low) |
3 | RXD | Serial data receive pin |
4 | TXD | Serial data transmit pin |
5 | GND | Ground connection |
Power Supply: Connect a stable power source capable of delivering up to 2A to the VCC and GND pins. A voltage regulator may be necessary to ensure the voltage remains within the specified range.
Serial Communication: Connect the RXD and TXD pins to the corresponding TX and RX pins of your microcontroller (e.g., Arduino UNO). Remember to cross-connect RX to TX and TX to RX.
Antenna: Attach the supplied GSM antenna to the antenna connector on the module.
SIM Card: Insert a micro SIM card into the SIM card holder.
#include <SoftwareSerial.h>
SoftwareSerial sim800l(7, 8); // RX, TX
void setup() {
// Begin serial communication with Arduino and SIM800L
sim800l.begin(9600);
Serial.begin(9600);
// Set SIM800L to fixed baud rate (optional)
sim800l.println("AT+IPR=9600");
delay(1000);
// Check communication with SIM800L
sim800l.println("AT");
delay(1000);
updateSerial();
}
void loop() {
updateSerial();
}
void updateSerial() {
// Forward every message from SIM800L to the Arduino Serial Monitor
while (sim800l.available()) {
Serial.write(sim800l.read());
}
// Forward every message from the Serial Monitor to SIM800L
while (Serial.available()) {
sim800l.write(Serial.read());
}
}
Q: Can I use the SIM800L with a 5V microcontroller? A: Yes, but you will need a level shifter for the RX and TX pins.
Q: How do I know if the SIM800L is connected to the network?
A: Send the command AT+CREG?
and check for a response indicating registration.
Q: What is the default baud rate of the SIM800L? A: The default baud rate is auto-bauding, but it can be set to a fixed rate using AT commands.
Remember to always consult the SIM800L datasheet for the most accurate and detailed information.