Nguyen Ha
Published

ESP32 SIM7600 4G LTE with arduino

In this project, We will learn how to use SIM7600 4G GSM/GPS control by ESP32 use Arduino

BeginnerProtip5 hours22,342
ESP32 SIM7600 4G LTE with arduino

Things used in this project

Hardware components

Kit Wifi ESP32 4G SIM7600CE
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

schematic_uno_esp32_sim7600_v1_4_0qDhZNhKqk.pdf

Code

demo code ESP32 - SIM7600

C/C++
demo code ESP32 - SIM7600
#include <HardwareSerial.h>
#if defined(CONFIG_IDF_TARGET_ESP32) 
    #define mySerial Serial2
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
    #define mySerial Serial1
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
   #define mySerial Serial2
#endif

void setup() 
{
  Serial.begin(115200);
  delay(500);
  #if defined(CONFIG_IDF_TARGET_ESP32) 
    mySerial.begin(115200);
 #elif defined(CONFIG_IDF_TARGET_ESP32S2)
    mySerial.begin(115200);
 #elif defined(CONFIG_IDF_TARGET_ESP32S3)
   mySerial.begin(115200, SERIAL_8N1, 18, 17);
 #endif
  delay(500);
  mySerial.println("ATI");
  delay(100);
  update_serial();
  mySerial.println("AT+CSQ");
  delay(100);
  update_serial();
  mySerial.println("AT+CIMI");
  delay(100);
  update_serial();
  pinMode(2,OUTPUT);digitalWrite(2,HIGH);
  sent_sms();
    
}
void loop() 
{     
  if (Serial.available()){
    char c = Serial.read();
    mySerial.write(c);
  }
 update_serial();
}

void update_serial()
{
    if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
}

void sent_sms()
{
 mySerial.println("AT+CMGF=1");delay(500);
 mySerial.println("AT+CMGS=\"+84941732379\"");delay(500);
 mySerial.print("test sent sms SIM7600");delay(500);
 mySerial.write(26);delay(500);
}

Example code test ESP32 with SIM7600

Credits

Nguyen Ha

Nguyen Ha

3 projects • 6 followers
Founder of AHTLAB.COM

Comments