GSM GPRS AT Commands

Z2M Part: EMC-00006-A

Send AT commands to a GSM/GPRS module via SoftwareSerial for testing and configuration.

Circuit Diagram
Circuit diagram for GSM GPRS AT Commands
Wire Connections & Pin Configuration

Wire Color Connections:

Green → Pin 2 (RX) to SIM800L TX
Blue → Pin 3 (TX) to SIM800L RX
Red → 5V to SIM800L VCC
Black → GND to SIM800L GND

Pin Configuration:

Arduino Digital Pin 2 (RX) → SIM800L TX
Arduino Digital Pin 3 (TX) → SIM800L RX
Arduino 5V (or VIN, external 2A) → SIM800L VCC
Arduino GND → SIM800L GND
Arduino Code
Edit
#include <SoftwareSerial.h>

/*
  Project: GPRS GSM Module Basic AT Command Test
  Description:
    - Communicates with GSM module via SoftwareSerial
    - Sends basic AT commands for connection testing
*/

SoftwareSerial mySerial(3, 2); // Tx -> Arduino #3, Rx -> #2

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);

  mySerial.println(\"AT\");           // Handshake test (Expect \"OK\")
  updateSerial();

  mySerial.println(\"AT+CSQ\");       // Signal quality test (0–31)
  updateSerial();

  mySerial.println(\"AT+CCID\");      // Check SIM presence
  updateSerial();

  mySerial.println(\"AT+CREG?\");     // Check network registration
  updateSerial();
}

void loop() {
  updateSerial();
}

void updateSerial() {
  while (Serial.available()) {
    mySerial.write(Serial.read());   // Forward Serial data to GSM module
  }
  while (mySerial.available()) {
    Serial.write(mySerial.read());   // Forward GSM data to Serial Monitor
  }
}

Instruction Details

Wiring: Connect SIM800L TX to Arduino RX (Pin 2), RX to Arduino TX (Pin 3). Connect VCC to 5V (use external 2A supply for module). Connect GND to GND. Insert SIM card.
Library: Not required (SoftwareSerial built-in).
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: Open Serial Monitor (Tools → Serial Monitor) at 9600 baud. Type AT commands and press Enter to test. Use for SMS, calls, or GPRS.

How to Use

  1. Connect the required components as per the Pin Configuration above
  2. Open Arduino IDE and create a new sketch
  3. Copy and paste the code above
  4. Select your Arduino board and COM port from Tools menu
  5. Click the Upload button to upload the code to your Arduino
  6. Open Serial Monitor (if applicable) to see the output

Components Required

  • Arduino Uno
  • SIM800L GSM/GPRS Module
  • SIM Card
  • External 5V 2A Power Supply
  • Breadboard
  • Jumper Wires

Category: Communication