SIM800_GSM_GPRS is an Arduino-compatible library for SIM800C/SIM800L GSM/GPRS modules. It enables easy communication with GSM networks to send SMS, make/receive calls, and perform HTTP GET/POST via GPRS. Supports Arduino, ESP32, and STM32 boards.
- Initialize SIM800 module and test communication
- Send and receive SMS messages
- Make, answer, and disconnect calls
- Perform HTTP GET/POST requests via GPRS
- Retrieve IMEI and network status
- Enable event-based handling for incoming SMS and calls
- Control sleep mode and network LED
- Lightweight, dependency-free library
- Arduino UNO / Mega / Nano
- ESP32 / ESP32-WROOM / TTGO / Seeed nRF52840 Sense
- STM32 (CubeIDE and Arduino core)
- Any board supporting Serial or SoftwareSerial
- Download this repository as a ZIP.
- In Arduino IDE, go to Sketch → Include Library → Add .ZIP Library…
- Select the downloaded file.
git clone https://github.com/kbmkrishnamali1992-hub/SIM800_GSM_GPRS_LIBRARY.gitPlace the folder in your Arduino libraries directory:
Documents/Arduino/libraries/SIM800_GSM_GPRS
#include <SIM800_GSM_GPRS.h>
#include <SoftwareSerial.h>
SoftwareSerial sim800(2, 3);
SIM800_GSM_GPRS gsm(sim800);
void setup() {
Serial.begin(9600);
sim800.begin(9600);
Serial.println(F("Initializing GSM..."));
while (!gsm.begin()) delay(2000);
Serial.println(F("SIM800C Ready!"));
Serial.print(F("IMEI: ")); Serial.println(gsm.getIMEI());
gsm.gsmECHOoff();
gsm.setSMSTextMode();
gsm.enableCALL();
gsm.enableSMSNotification();
while (!gsm.wait_for_network(1000)) delay(1000);
Serial.println(F("CONNECTED TO NETWORK"));
gsm.sendSMS("9876543210", "Hello from SIM800C!");
gsm.makeCall("9876543210");
}
void loop() {}#include <SIM800_GSM_GPRS.h>
#include <SoftwareSerial.h>
SoftwareSerial sim800(2, 3);
SIM800_GSM_GPRS gsm(sim800);
void setup() {
Serial.begin(9600);
sim800.begin(9600);
while (!gsm.begin()) delay(2000);
Serial.println(F("CONNECTED TO NETWORK"));
String apn = "airtelgprs.com";
while (!gsm.connectGPRS(apn)) delay(1000);
String payload = "{\"test_name\":\"SIM800C\"}";
String response;
int status;
if (gsm.httpPost("http://httpbin.org/post", payload, status, response)) {
Serial.println(F("🌐 HTTP POST success"));
Serial.println(response);
}
if (gsm.httpGet("http://httpbin.org/get?test_name=SIM800C", status, response)) {
Serial.println(F("🌐 HTTP GET success"));
Serial.println(response);
}
gsm.DisconnectGPRS();
gsm.shutdownModule();
}
void loop() {}| Function | Description |
|---|---|
begin() |
Initialize SIM800 and test communication |
getIMEI() |
Returns the module IMEI |
wait_for_network(timeout) |
Wait for GSM network registration |
sendSMS(number, message) |
Send text SMS |
makeCall(number) |
Make an outgoing call |
answerCall() |
Answer incoming call |
disconnectCall() |
Hang up active call |
checkEvent() |
Check for incoming SMS or call events |
connectGPRS(apn) |
Connect to GPRS using given APN |
httpPost(url, payload, status, response) |
Perform HTTP POST |
httpGet(url, status, response) |
Perform HTTP GET |
DisconnectGPRS() |
Disconnect GPRS session |
shutdownModule() |
Power down SIM800 safely |
enableSMSNotification() |
Enable SMS received notifications |
enableCALL() |
Enable incoming call detection |
disableSleepMode() |
Keep module awake |
gsmECHOoff() |
Disable AT command echo |
- Arduino Core (any board)
<SoftwareSerial.h>(for UNO/Nano)- Hardware Serial (recommended for ESP32 / STM32)
Pull requests are welcome! To contribute:
- Fork the repo
- Create your feature branch
- Commit changes and open a PR
| Issue | Possible Fix |
|---|---|
| No network detected | Check SIM card, antenna, or power supply |
| HTTP POST fails | Verify APN and HTTP URL (must be HTTP, not HTTPS) |
| SMS not sent | Ensure SIM has balance and signal |
| “OK” not received | Try lowering baudrate to 9600 |
This library is released under the MIT License — you’re free to use, modify, and distribute it.
Author: KRISHNA MALI Email: kbm.krishnamali1992@gmail.com GitHub: https://github.com/kbmkrishnamali1992-hub