Sim7600G-H 4G LTE, 3G, and 2G, Send and Receive Messages
Table of Contents
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
- Asia
- Asia-Pacific
- Europe
- America
- Africa and
- 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
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
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).
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.
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.
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.
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.
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.
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.
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.
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 ESP32 Programming:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
#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.
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
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”.
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.
Let me rotate the knob of the potentiometer and let’s see if it’s going to send me a different value.
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.