UART Communication between ESP32 and SIM800L EVB v2 module

Below is my connection

TX -> GPIO 16 (RX)
RX -> GPIO 17 (TX)
VCC -> 5V 
GND -> GND

and my code is

#include <HardwareSerial.h>

HardwareSerial sim800(1);  // UART1

#define RXD2 16  // ESP32 RX ← SIM800 TX
#define TXD2 17  // ESP32 TX → SIM800 RX

unsigned long lastCheck = 0;

void setup() {
  Serial.begin(115200);
  sim800.begin(9600, SERIAL_8N1, RXD2, TXD2);

  Serial.println("SIM800 Communication Test Started");
}

void loop() {
  // Auto send AT every 3 sec
  if (millis() - lastCheck > 3000) {
    Serial.println("Sending: AT");
    sim800.println("AT");
    lastCheck = millis();
  }

  // Read from SIM800 → Serial Monitor
  while (sim800.available()) {
    char c = sim800.read();
    Serial.write(c);
  }

  // Send from Serial Monitor → SIM800
  while (Serial.available()) {
    char c = Serial.read();
    sim800.write(c);
  }
}

but i am not getting any response from the SIM800L module. I am using a dedicated 5V 2A external power supply for it and ESP32 is powered by USB, and have common GND. Why am I not receiving anything.

16:14:27.437 -> Sending: AT

16:14:30.442 -> Sending: AT

16:14:33.446 -> Sending: AT

16:14:36.420 -> Sending: AT

16:14:39.449 -> Sending: AT

16:14:42.461 -> Sending: AT

16:14:45.424 -> Sending: AT

16:14:48.435 -> Sending: AT

16:14:51.455 -> Sending: AT

From here: GitHub - SharmaAshmit/ESP32-SIM800L: This project demonstrates how to use the ESP32 with the SIM800L GSM/GPRS module to send sensor data (temperature & humidity) to Firebase Realtime Database using AT commands via serial communication. · GitHub

This:

Important: SIM800L requires a stable 4V power supply. Do not power it directly from ESP32 5V pin.

And this:

ESP32 Pin SIM800L Pin
GPIO 26 TX
GPIO 27 RX
GND GND
4V Power VCC
1 Like

I am using this module : SIM800L V2 5V GPRS GSM Module - Quad-Band with Antenna – QuartzComponents


I couldn't find the official datasheet of this board but i found this : https://ultra-lab.net/wp-content/uploads/2022/02/Ficha-tecnica-de-SIM800L-V2.0.pdf

Note : I am powering it via external source 5V 2A.

but still not getting any response of AT commands.

Bigger is not always better. Is it 5v tolerant?

Read the PDF you posted for power requirement.

try

// // SIM800L EVB ESP32 test using Serial2 (pins 16 Rx  and 17 Tx)

// connect so
// SIM800 5V to ESP32 5V
// SIM800 GND to ESP32 GND
// SIM800 VDD to ESP32 3.3v
// SIM80 TXD to ESP32 pin 16 Rx
// SIM800 TXD to ESP32 pin 17 tx

// AT+CGMI  returns the manufacturer's name
// AT+CGMM returns the MODEM model number
// AT+CGMR returns details of the software and model revision level
// AT+CGSN returns the MODEM's serial number

#include <Arduino.h>

// ESP32 example using HardwareSerial library to access Serial port 2 (pins 16 and 17)
// from https://programming.vip/docs/esp32-use-of-hardwareserial-library.html

#define SERIAL_BAUD 115200

HardwareSerial serial2(2);//Serial port 2

int distance = 0;

void setup() {
  //Initialize serial port 0
  Serial.begin(115200);
  delay(3000);
  //Initialize serial port 2
  serial2.begin(SERIAL_BAUD, SERIAL_8N1);
  Serial.println("\nSIM800 EVB to ESP32 Serial port 2 test");
}

void loop() {
  while (serial2.available() > 0) {
    uint8_t byteFromSerial = serial2.read();
    Serial.write(byteFromSerial);
  }
  while (Serial.available() > 0) {
    uint8_t byteFromSerial1 = Serial.read();
    serial2.write(byteFromSerial1);
  }
}

serial monitor output

at
OK
at+cgmi
SIMCOM_Ltd
OK
at+cgmm
SIMCOM_SIM800L
OK
at+cgmr
Revision:1418B05SIM800L24
OK

setup

for testing AT commands I used the ESP32 5V supply
when transmitting use an external 2amp supply