ESP32

Sim7600G-H 4G LTE, 3G, and 2G, Send and Receive Messages

SIM7600G-H 4G LTE:

Sim7600G-H 4G LTE, 3G, and 2G, Getting started Tutorial- Today, we’re exploring the LILYGO® SIM7600G-H, a groundbreaking development board that combines the power of ESP32 with the versatility of a 4G LTE CAT4 GPS module. This is also backward compatible with 3G and 2G networks and it can be used throughout the world. The supported regions are

  1. Asia
  2. Asia-Pacific
  3. Europe
  4. America
  5. Africa and
  6. Australia

In this journey, we’ll discover how this board is not just a piece of technology but a gateway to infinite possibilities.




Amazon Links:

LILYGO® SIM7600G-H Official product page

SIM7600G-H on Amazon

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

The Download and Upload speeds of the SIM7600G-H model is ten times faster than the SIM7600E series, making it an ideal choice for applications requiring high-speed data transmission. The SIM7600G-H LTE Download Link (Mbps) is optimized from 10(DL) to 150(DL) and the Upload Link is optimized from 5(UL) to 50(UL).

SIM7600G-H

The board integrates an 18650 battery holder with + and – markings, adding a layer of convenience and mobility. Next to it, you can see the TF Card or the MicroSD card.



SIM7600G-H

Over here you can see connections details, the SD Card CS, CLK, MOSI, and MISO are connected to the ESP32 GPIOs 13, 14, 15, and 2 respectively.

SIM7600G-H

On the SIM7600G-H module you can see a port of the Solar Charging Interface. The ordinary charging IC has been replaced with a Solar charging IC.  Next to it is the Power Switch.

A slot for the Nano SIM Card.

It includes two type-C interfaces – one for uploading programs to the main control chip, and the other serving as a USB dongle interface for the SIM7600G-H industrial network card. This versatility allows the board to be easily connected to a computer and configured as a wireless network card.

A connector for the GPS Antenna.

In an era where energy efficiency is paramount, the SIM7600G-H stands out with its GPS power control feature. This functionality significantly reduces power consumption, reaching as low as 300uA in sleep mode.

A connector for the Full Band LTE Antenna.

The Reset Button and the SIM Module Power Button.



The applications of the SIM7600G-H are as diverse as the imagination of its users. From smart home systems to advanced IoT projects, from remote monitoring to real-time data transmission, the possibilities are limitless. Its fast data transmission capability, coupled with GPS functionality and solar charging, makes it an ideal choice for outdoor applications, environmental monitoring, and mobile solutions where power availability is a challenge.

SIM7600G-H

These are some of the specifications and you can also see a comparison between the SIM7600G-H and SIM7600E-H. Both the modules are exactly the same except the Form Factor and REGION.

SIM7600G-H

And this is the Pin Diagram, you can see all the pins are clearly labeled. And since this module is based on the ESP32 WiFi + Bluetooth module so I am sure many of you might already be familiar with its pin configuration and if not then you can watch my getting started video on the ESP32 WiFi + Bluetooth module.



Anyway, you can see the pins to which the SIM7600G-H module is connected. So, make sure you don’t connect any kind of a sensor or output device to any of these pins “32, 34, 25, 27, 26, and 4.

If you want to use an Arduino, ESP8266, or any other controller board instead of the ESP32, then I recommend you purchase this dedicated SIM7600G module.

SIM7600G-H

I have already published a getting started tutorial on it. I have used this module to control some loads, and whenever I would turn a load ON or OFF, I would receive a feedback message. Along with this, I also monitored a temperature sensor. Today, I will run the same program on the SIM7600G-H module because they are exactly the same, only their connections are different.

I believe I have covered pretty much everything and now it’s time to solder the male headers so that I can connect the input and output devices.

SIM7600G-H

You can see the male headers have been soldered. I have also connected the GPS Antenna and the Full Band LTE Antenna.  Everything looks good and now let’s power up this beast and see what it’s truly capable of.

SIM7600G-H

This time, I have connected LEDs and a Potentiometer instead of relays and a temperature sensor. We will control these LEDs and monitor this Potentiometer. For the connections, you can follow this circuit diagram.




SIM7600G-H, Circuit Diagram:

SIM7600G-H

SIM7600G-H ESP32 Programming:

#define TINY_GSM_MODEM_SIM7600
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
#include "Adafruit_FONA.h"
#include <HardwareSerial.h>
#include <TinyGsmClient.h>

// LilyGO T-SIM7000G Pinout
#define UART_BAUD   115200
#define PIN_DTR     25
#define PIN_TX      27
#define PIN_RX      26
#define PWR_PIN     4


// Set serial for debug console (to Serial Monitor, default speed 115200)
#define SerialMon Serial
// Set serial for AT commands
#define SerialAT  Serial1

TinyGsm modem(SerialAT);
const int FONA_RST = 34;
const int RELAY_PIN = 13;
char replybuffer[255];
uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);
String smsString = "";
char fonaNotificationBuffer[64];          //for notifications from the FONA
char smsBuffer[250];

HardwareSerial *fonaSerial = &SerialAT;

Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);

unsigned long timeout;
char charArray[20];
unsigned char data_buffer[4] = {0};

String textForSMS;
char buff[10];
#define SMS_TARGET  "+923348912230"
int Relay1 = 12;
int Relay2 = 13;
int Relay3 = 14;
int Relay4 = 15;
int pot=39;
void setup(){
  SerialMon.begin(115200);  
 pinMode(Relay1,OUTPUT);
  pinMode(Relay2,OUTPUT);
 pinMode(Relay3,OUTPUT);
 pinMode(Relay4,OUTPUT);
  pinMode(pot,INPUT);
  // Set LED OFF


  //Turn on the modem
  pinMode(PWR_PIN, OUTPUT);
  digitalWrite(PWR_PIN, HIGH);
  delay(300);
  digitalWrite(PWR_PIN, LOW);

  delay(1000);
  
  // Set module baud rate and UART pins
  SerialAT.begin(UART_BAUD, SERIAL_8N1, PIN_RX, PIN_TX);
 fonaSerial->begin(UART_BAUD,SERIAL_8N1,PIN_RX, PIN_TX, false);
  // Restart takes quite some time
  // To skip it, call init() instead of restart()
  SerialMon.println("Initializing modem...");
  if (!modem.restart()) {
    Serial.println("Failed to restart modem, attempting to continue without restarting");
  }
  
  // Print modem info
  String modemName = modem.getModemName();
  delay(500);
  SerialMon.println("Modem Name: " + modemName);

  String modemInfo = modem.getModemInfo();
  delay(500);
  SerialMon.println("Modem Info: " + modemInfo);


  
   if (! fona.begin(*fonaSerial))
  {
    Serial.println(F("Couldn't find FONA"));
    while(1);
  }
  Serial.println(F("FONA is OK"));
  
  fonaSerial->print("AT+CNMI=2,1\r\n");  //set up the FONA to send a +CMTI notification when an SMS is received
  Serial.println("FONA Ready");
 
}

void loop(){

  int potvalue=analogRead(pot);

  
char* bufPtr = fonaNotificationBuffer;    //handy buffer pointer
  
  if (fona.available())      //any data available from the FONA?
  {
    int slot = 0;            //this will be the slot number of the SMS
    int charCount = 0;
    //Read the notification into fonaInBuffer
    do
    {
      *bufPtr = fona.read();
      Serial.write(*bufPtr);
      delay(1);
    } while ((*bufPtr++ != '\n') && (fona.available()) && (++charCount < (sizeof(fonaNotificationBuffer)-1)));

    //Add a terminal NULL to the notification string
    *bufPtr = 0;

    //Scan the notification string for an SMS received notification.
    //  If it's an SMS message, we'll get the slot number in 'slot'
    if (1 == sscanf(fonaNotificationBuffer, "+CMTI: " FONA_PREF_SMS_STORAGE ",%d", &slot)) 
    {
      Serial.print("slot: "); Serial.println(slot);

      char callerIDbuffer[32];  //we'll store the SMS sender number in here

      // Retrieve SMS sender address/phone number.
      if (! fona.getSMSSender(slot, callerIDbuffer, 31)) 
      {
        Serial.println("Didn't find SMS message in slot!");
      }
      Serial.print(F("FROM: ")); Serial.println(callerIDbuffer);

      // Retrieve SMS value.
      uint16_t smslen;
      if (fona.readSMS(slot, smsBuffer, 250, &smslen)) // pass in buffer and max len!
      { 
        smsString = String(smsBuffer);
        Serial.println(smsString);
      }

      if (smsString == "load1 on")  
      {
       digitalWrite(Relay1, HIGH);
        textForSMS ="load1 is on";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
         if (smsString == "load1 off")  
      {
       digitalWrite(Relay1, LOW);
        textForSMS ="load1 is off";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }

       if (smsString == "load2 on")  
      {
       digitalWrite(Relay2, HIGH);
        textForSMS ="load2 is on";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
         if (smsString == "load2 off")  
      {
       digitalWrite(Relay1, LOW);
        textForSMS ="load2 is off";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }

       if (smsString == "load3 on")  
      {
       digitalWrite(Relay3, HIGH);
        textForSMS ="load3 is on";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
         if (smsString == "load3 off")  
      {
       digitalWrite(Relay3, LOW);
        textForSMS ="load3 is off";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }

       if (smsString == "load4 on")  
      {
       digitalWrite(Relay4, HIGH);
        textForSMS ="load4 is on";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
         if (smsString == "load4 off")  
      {
       digitalWrite(Relay4, LOW);
        textForSMS ="load4 is off";
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
        if(smsString == "req") 
      {
       textForSMS =potvalue;
modem.sendSMS(SMS_TARGET, textForSMS);
textForSMS="";
      }
      
        if (fona.deleteSMS(slot)) {
        Serial.println(F("OK!"));
      } else {
        Serial.print(F("Couldn't delete SMS in slot ")); 
        Serial.println(slot);
        fona.print(F("AT+CMGD=?\r\n"));
      }
    }  
  } 
}



ESP32 SIM7600G-H Code Explanation:

This is the same exact program that I used with the SIM7600G and it also works with the SIM7600G-H. You can see, I am using the same libraries. The only difference is that this time I am using different pins and this is because, on the SIM7600G-H the connections are defined.

If you are using the ESP32 WiFi + Bluetooth module for the first time, then you will also need to install the ESP32 board in the Arduino IDE. For this you can read my getting started article on the ESP32 WiFi + Bluetooth module.

To upload the program, make sure you select the ESP32 Dev Module and don’t forget to select the correct communication port your ESP32 SIM7600G-H module is connected to and then finally click on the upload button.

SIM7600G-H

You can see the program has been successfully uploaded. Now, let’s go ahead and watch this in action.

To turn the LEDs ON, we will use these commands.

load1 on, load2 on, load3 on, load4 on.

To turn the LEDs OFF, we will use these commands.

load1 off, load2 off, load3 off, load4 off.

And to request the value of the Potentiometer, we will use this command.

req



SIM7600G-H

I am currently using a 4G SIM, and as you can clearly see, it is connected to the network. An amazing feature of this module is that it’s also compatible with 3G and 2G networks. While the SIM900A and SIM800L GSM/GPRS Modules only support 2G SIMs and 2G networks, this makes the 2G supported GSM/GPRS Modules almost obsolete now. Anyway, let’s start the demonstration. “Watch video tutorial given at the end of this article”.

SIM7600G-H

So as you saw, whenever I turn the LEDs ON or OFF, I also receive feedback messages. I explained this same feedback functionality in my previous video.

Let’s now request the value of the potentiometer.

SIM7600G-H

Let me rotate the knob of the potentiometer and let’s see if it’s going to send me a different value.

SIM7600G-H

This is working exceptionally well.

In the upcoming tutorial, we will make a GPS tracking system. So, consider subscribing if you don’t want to miss that article. So, that’s all for now.



Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button