Components · 13 min read

SIM7600 ESP32 Guide: 4G LTE SMS, HTTP and GPS with TinyGSM

SIM7600 ESP32 tutorial: replace the SIM800L with a SIM7600 or A7670 4G module, send SMS, HTTP and GPS via TinyGSM, plus 2 A power, antennas, 2G sunsets.

A SIM7600 on an ESP32 is one of the most reliable ways today to send SMS, push data to the internet and get a GPS position from anywhere Wi-Fi can't reach. For years the cheap SIM800L was the go-to module for this, but it only speaks 2G (GSM/GPRS), and 2G has already been switched off in many countries or is about to be. Its successors, 4G LTE modules such as the SIM7600 and the A7670, work the same way with AT commands, register on the LTE network with an ordinary SIM card and connect to the ESP32 with just two data wires (UART).

In this guide you'll first see where 2G and 3G stand country by country, how LTE Cat-1, Cat-4, Cat-M and NB-IoT differ, and how to choose the right module variant for your region. Then we'll tackle the two things that cause the most trouble with 4G modules: a power supply that handles 2 A peaks, and the antenna. Finally you'll test the module with AT commands, send an SMS from the ESP32 with the TinyGSM library, make an HTTP request over LTE, read the position from the SIM7600's built-in GPS and drive the same module from a Raspberry Pi Pico in MicroPython.

SIM800L 2G GSM module
SIM800L: an older-generation GSM module that only uses the 2G network. Where 2G is shut down, 4G LTE modules such as the SIM7600 and A7670 take over.

2G is going away: 2G and 3G status by country

Carriers are switching off old networks one by one so they can reuse the spectrum for more efficient 4G and 5G. In most countries 3G went first, because 2G still carries millions of machine connections such as old alarm panels, elevator phones and meters. That's only a reprieve, though: where there's no 2G, a SIM800L can't register no matter how well it's powered. The table below summarises the situation as of late 2026. The dates come from carrier announcements; carriers in the same country often switch off at different times, and plans can change.

Country2G (GSM)3G (UMTS)Advice for new projects
GermanyOn; Telekom has announced shutdown for 2028Switched off in 2021LTE Cat-1 or Cat-4; 2G fallback still useful for a few years
AustriaOnSwitched off or being switched offLTE with 2G fallback
SwitzerlandSwitched off (2021–2022)Switched off or being switched offLTE only; don't rely on 2G
United KingdomOn; off by 2033 at the latestSwitched off (2023–2025)LTE with 2G fallback
FranceShutting down by the end of 2026Shutting down 2028–2029LTE Cat-1 or Cat-M
ItalyOnLargely switched offLTE with 2G fallback
SpainOn, shutdown plannedSwitched off or being switched offLTE
USAEffectively switched offSwitched offLTE or LTE-M only, region-specific variant
AustraliaSwitched offSwitched off in 2024LTE only (SA variants)
JapanNever usedSwitched offLTE only (JC variants)
TurkeyOnOnSIM800L still works; use 4G for long-lived projects
The easiest way to check whether 2G is still available where you are: in your phone's mobile network settings, set the preferred network type to 2G only and try to make a call. If the phone can't find a network, neither can a SIM800L. If you're designing a new device that has to run for years, choosing an LTE module is the safest bet even if 2G still works today.

What are the SIM7600 and A7670? Comparison with the SIM800L

The SIM7600 and A7670 are LTE modem modules made by SIMCom. Both are controlled with AT commands and handle SMS, voice calls and data over TCP/HTTP. The SIM7600 is the bigger, more capable one: its Cat-4 variants reach up to 150 Mbit/s download, fall back to 3G and 2G when there's no LTE, and most versions include a GNSS receiver that uses GPS, GLONASS, BeiDou and Galileo together. The A7670, on the other hand, is designed as a direct successor to the SIM800L: a smaller and noticeably cheaper LTE Cat-1 module with 10 Mbit/s download and 5 Mbit/s upload. The European variant can only fall back to 2G, and not every variant has GNSS. For sensor data, SMS and small JSON requests, Cat-1 is more than fast enough.

FeatureSIM800LA7670ESIM7600E-H / G-H
Network2G only (GSM/GPRS)4G LTE Cat-1, 2G fallback4G LTE Cat-4, 3G and 2G fallback
Max. speed (down / up)85.6 kbit/s10 / 5 Mbit/s150 / 50 Mbit/s
GNSS (GPS)NoOnly on some variantsOn most variants
Module supply3.4–4.4 V3.4–4.2 V (typ. 3.8 V)3.4–4.2 V (typ. 3.8 V)
Peak current2 AUp to 2 A (when transmitting on 2G)Up to 2 A (when transmitting on 2G)
UART baud rateAuto (usually 9600)115200 baud115200 baud
TinyGSM defineTINY_GSM_MODEM_SIM800TINY_GSM_MODEM_A7672XTINY_GSM_MODEM_SIM7600
When to choose itOnly where 2G is definitely on, legacy projectsCheap SMS and HTTP, SIM800L replacementGPS, high speed, 3G fallback, global variant

LTE Cat-1, Cat-4, Cat-M and NB-IoT explained

The "Cat" (category) you see in module listings tells you how fast and how power-efficient a module is on the LTE network. Cat-1 and Cat-4 run on the regular LTE network that phones use; they work with any normal SIM card and any LTE cell tower. Cat-M (LTE-M) and NB-IoT are narrowband flavours designed for the Internet of Things: the channel width drops to 1.4 MHz and 200 kHz respectively, speed goes down, but they reach deeper into buildings and basements, and thanks to the PSM and eDRX sleep modes they can run a device on a battery for years. The catch: your carrier has to offer the service, and you often need a dedicated IoT SIM card.

CategoryMax. speed (down / up)Channel widthVoice and SMSSleep and batteryExample module
LTE Cat-4150 / 50 Mbit/sUp to 20 MHzVoLTE, SMSPoor; high currentSIM7600E-H, SIM7600G-H
LTE Cat-110 / 5 Mbit/sUp to 20 MHzVoLTE, SMSModerateA7670E, SIM7600E
LTE Cat-M1 (LTE-M)About 1 Mbit/s1.4 MHzVoLTE (carrier-dependent), SMSVery good (PSM, eDRX)SIM7080G, SIM7000G
NB-IoTTens to a few hundred kbit/s200 kHzNo voice, limited SMSBest; for stationary devicesSIM7080G
Quick rule of thumb: if you want 4G to do what the SIM800L used to do (SMS and the occasional HTTP request), pick the A7670E. If you also need location or the device will travel across countries, pick the SIM7600G-H. If the device will run on batteries for months or years and your carrier offers LTE-M or NB-IoT, go for the SIM7080G.

Choosing the right variant: what do E, G, SA and JC mean?

The letters at the end of SIM7600 and A7670 tell you which LTE frequency bands the module supports. Buy the wrong regional variant and the module will power up and answer AT commands, but it won't find a network. In Europe the key bands are B1 (2100 MHz), B3 (1800 MHz), B7 (2600 MHz), B8 (900 MHz) and B20 (800 MHz), which matters a lot in rural areas and indoors; in North America bands such as B2, B4, B12 and B66 are common. Before you buy, check the full model name in the listing (e.g. SIM7600E-H or A7670E) and its band list; cheap boards are surprisingly often shipped as the wrong variant.

RegionSIM7600A7670
Europe, Turkey, Middle East, AfricaSIM7600E, SIM7600E-HA7670E
North AmericaSIM7600A-H or SIM7600G-H-
Latin America, Australia, New ZealandSIM7600SA-HA7670SA
JapanSIM7600JC-H-
Several continentsSIM7600G-H (global)-

Power supply: 3.8 V and 2 A peak current

Most problems with 4G modules come down to the power supply. While registering and sending data, the module draws very short current spikes; especially when it falls back to 2G, the 577-microsecond transmit bursts reach up to 2 A. If the supply can't deliver that spike, the voltage briefly dips below 3.4 V, the module shuts itself down, and you experience it as "sometimes it works, sometimes it just reboots". The ESP32's 3V3 pin, the Arduino's 5V pin and a computer's USB port can't supply that current. The bare module needs 3.4–4.2 V (typically 3.8 V); most breakout boards on the market, however, have a 5 V input (some 5–12 V) with their own regulator.

Operating stateApprox. currentNote
Off (AT+CPOF)Microamp rangeExcluding the board's regulator and LEDs
Sleep (AT+CSCLK=1, DTR HIGH)A few mAWakes up on incoming SMS or call
Idle, registered15–30 mARises with weak signal
LTE data transfer200–700 mACat-1 towards the low end, Cat-4 towards the high end
Registration, 2G transmitPeaks up to 2 ABursts lasting microseconds
  • Board with 5 V input: use a 5 V 2 A USB charger or power bank. If you feed the board from the ESP32's 5V (VIN) pin, power the ESP32 from that charger too rather than from your computer's USB port.
  • Bare module or VBAT input: an LM2596 buck converter set to 3.8–4.0 V, or a single-cell 18650 Li-ion battery (3.0–4.2 V) connected directly, both work; once the battery drops below 3.4 V the module shuts down.
  • Bulk capacitor: place a 1000–2200 µF low-ESR electrolytic capacitor as close as possible to the module's supply input, with a 100 nF ceramic capacitor next to it.
  • Short, thick wires: thin breadboard jumpers cause a noticeable voltage drop during a 2 A burst; keep the power wiring short and thick.
If you power the ESP32 and the 4G module from the same weak supply, the module's current spikes drag the ESP32's voltage down too and the board resets with "Brownout detector was triggered". The fix is in the power wiring, not the code; see ESP32 Brownout and Guru Meditation for details. When you use an external supply, always connect the ESP32 and module grounds together.
LM2596 adjustable buck converter module
LM2596 buck converter: turns a 5–12 V input into the 3.8–4.0 V a 4G module needs and copes with 2 A current spikes.

Antenna table: LTE, diversity and GNSS

Run a 4G module without an antenna, or with the wrong one, and it will either find no network at all or keep transmitting at full power and draw more current. The tiny IPEX (U.FL) connectors on the module are fragile; plug the antenna in once and make sure the cable isn't under strain. Low bands such as 700 and 800 MHz carry a lot of rural and indoor coverage, so choose an LTE antenna that covers 700–2700 MHz and performs well at the low end; the tiny PCB antennas on some boards aren't enough in a basement or inside a metal enclosure.

AntennaConnectorFrequencyWhen do you need it?
LTE main (MAIN)IPEX (U.FL) or SMA700–960 MHz and 1700–2700 MHzAlways; never run the module without it
LTE diversity (DIV, AUX)IPEX (U.FL)Same bands as MAINOn the Cat-4 SIM7600 for full speed and weak signal; most Cat-1 boards don't have one
GNSS (GPS)IPEX (U.FL) or SMA1575.42 MHz (GPS L1), 1602 MHz (GLONASS)If you want location; an active antenna needs a view of the sky

ESP32 wiring: pinout table

The 4G board connects to the ESP32 over a UART serial link: the module's TXD goes to the ESP32's RX and its RXD to TX. Of the ESP32's three hardware UARTs, we map UART2 to GPIO 16 and 17 so the Serial Monitor over USB remains available. The PWRKEY input turns the module on and off: on a bare module, pulling this pin to GND briefly (about 0.5–1 second) starts it up. Most boards drive PWRKEY through an NPN transistor, so setting the ESP32 pin HIGH for 1 second turns the module on. Some boards power up on their own as soon as they get power; in that case you don't need the PWRKEY connection at all.

4G board pinESP32Raspberry Pi PicoArduino Mega
5V / VIN (board input)External 5 V 2 AExternal 5 V 2 AExternal 5 V 2 A
GNDGND (common)GND (common)GND (common)
TXD (module output)GPIO 16 (RX2)GP1 (UART0 RX)19 (RX1)
RXD (module input)GPIO 17 (TX2)GP0 (UART0 TX)18 (TX1), with a divider if needed
PWRKEY (PWR, PWK)GPIO 4GP2D4
NETLIGHT / STATUSOptionalOptionalOptional
The UART pins of bare SIM7600 and A7670 modules use 1.8 V logic; even the ESP32's 3.3 V is too much for them. So instead of a bare module, buy a board with a level shifter and make sure it runs on 3.3 V logic. On boards built around the ESP32-WROVER, GPIO 16 and 17 are reserved for PSRAM; on those, map UART2 to GPIO 26 and 27, for example.

First test with AT commands

Before moving to a library, talking to the module directly is the fastest way to find problems. The sketch below turns the ESP32 into a bridge: every command you type in the Serial Monitor is forwarded to the module and the reply is shown back. Set the Serial Monitor to 115200 baud and "Both NL & CR". After power-up you should first see RDY, then +CPIN: READY once the SIM is read, and finally PB DONE; this can take 10–20 seconds.

C++ (Arduino IDE)
1// ESP32 <-> 4G modül AT köprüsü / AT bridge between ESP32 and the 4G module
2#define MODEM_RX      16   // modülün TXD ucu buraya / module TXD goes here
3#define MODEM_TX      17   // modülün RXD ucu buraya / module RXD goes here
4#define MODEM_PWRKEY   4   // kartın PWRKEY (PWR, PWK) girişi / board PWRKEY input
5
6HardwareSerial modem(2);   // ESP32'nin UART2'si / ESP32 UART2
7
8void setup() {
9  Serial.begin(115200);
10  pinMode(MODEM_PWRKEY, OUTPUT);
11  digitalWrite(MODEM_PWRKEY, HIGH);   // 1 sn açma darbesi (transistörlü kart) / 1 s power-on pulse (transistor board)
12  delay(1000);
13  digitalWrite(MODEM_PWRKEY, LOW);
14  modem.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
15  Serial.println("Module booting, wait for RDY and PB DONE...");
16}
17
18void loop() {
19  while (Serial.available()) modem.write(Serial.read());   // bilgisayar -> modül / PC -> module
20  while (modem.available()) Serial.write(modem.read());    // modül -> bilgisayar / module -> PC
21}
CommandWhat it doesExpected reply
ATConnection testOK
ATIManufacturer, model and firmwareModel name, e.g. SIM7600E-H
AT+CPIN?SIM card status+CPIN: READY
AT+CSQSignal strength (0–31, 99 = unknown)+CSQ: 18,99
AT+CEREG?LTE network registration+CEREG: 0,1 (home) or 0,5 (roaming)
AT+COPS?Current carrier and technologyLast value 7 = LTE, 0 = 2G
AT+CPSI?Network type, band and signal detailsLTE,Online,... and the band, e.g. EUTRAN-BAND20
AT+CNMP=38Use LTE only (2 = automatic)OK
AT+CMGF=1SMS text modeOK
AT+CGDCONT=1,"IP","internet"Set the APN (depends on the carrier)OK
AT+CGPS=1Turns on the GNSS receiver on the SIM7600OK
AT+CPOFShuts the module down cleanlyOK

The first number in the AT+CSQ reply converts to dBm like this: dBm = −113 + 2 × value. Below 10 (weaker than −93 dBm) is problematic, 15–19 is good, and 20 or more is very good. On LTE this value is only a rough guide; for a more accurate picture, look at the RSRP value in the AT+CPSI? reply: better than −80 dBm is excellent, around −100 dBm is usable, and below −110 dBm means you should move the antenna or the device. If AT+CEREG? shows 0,2, the module is still searching; 0,3 means registration was denied, which usually points to an inactive SIM card or a line with data service disabled.

Sending SMS from the ESP32 with TinyGSM

  1. In the Arduino IDE, open the Library Manager and install TinyGSM (Volodymyr Shymanskyy) and, for the HTTP example, ArduinoHttpClient.
  2. Select your module on the first line of the sketch: TINY_GSM_MODEM_SIM7600 for the SIM7600, TINY_GSM_MODEM_A7672X for the A7670. This line must come before the #include.
  3. Test the SIM card in a phone first: disable the PIN or enter it in SIM_PIN, and make sure the plan can send SMS.
  4. Put the recipient's number in PHONE with the country code (+1 for the US and Canada, +44 for the UK).
  5. Upload the sketch, open the Serial Monitor at 115200 baud and wait for the module to register; the first registration can take 30 seconds.
C++ (Arduino IDE)
1#define TINY_GSM_MODEM_SIM7600      // A7670 için / for A7670: TINY_GSM_MODEM_A7672X
2#define TINY_GSM_RX_BUFFER 1024
3#include <TinyGsmClient.h>
4
5#define MODEM_RX      16
6#define MODEM_TX      17
7#define MODEM_PWRKEY   4
8
9const char SIM_PIN[] = "";               // SIM kartın PIN'i, yoksa boş / SIM PIN, empty if none
10const char PHONE[]   = "+491701234567";  // alıcı, ülke koduyla / recipient with country code
11
12HardwareSerial SerialAT(2);
13TinyGsm modem(SerialAT);
14
15void modemPowerOn() {
16  pinMode(MODEM_PWRKEY, OUTPUT);
17  digitalWrite(MODEM_PWRKEY, HIGH);      // kartın transistörü PWRKEY'i GND'ye çeker / the board transistor pulls PWRKEY to GND
18  delay(1000);
19  digitalWrite(MODEM_PWRKEY, LOW);
20}
21
22void setup() {
23  Serial.begin(115200);
24  modemPowerOn();
25  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
26
27  Serial.println("Waiting for modem...");
28  if (!modem.testAT(20000L) || !modem.init(SIM_PIN)) {   // 20 sn içinde "OK" bekle / wait 20 s for "OK"
29    Serial.println("Modem not responding: check power, TX/RX and PWRKEY");
30    return;
31  }
32  Serial.println(modem.getModemInfo());
33
34  Serial.print("Waiting for network...");
35  if (!modem.waitForNetwork(60000L)) {
36    Serial.println(" failed");
37    return;
38  }
39  Serial.println(" ok");
40  Serial.print("Operator: ");
41  Serial.println(modem.getOperator());
42  Serial.print("Signal (CSQ 0-31): ");
43  Serial.println(modem.getSignalQuality());
44
45  bool ok = modem.sendSMS(PHONE, "ESP32 + 4G: SMS test OK");
46  Serial.println(ok ? "SMS sent" : "SMS failed");
47}
48
49void loop() {
50}

The sketch first uses testAT() to wait up to 20 seconds for the module to answer "OK", then prepares it with init() and enters the SIM PIN if needed. waitForNetwork() waits until registration is complete; getOperator() and getSignalQuality() show the carrier you're on and the signal strength. sendSMS() returns true if the message was sent. If you're using an A7670, just change the first line; SMS, network and data functions behave the same on both modules. Accented characters are a common cause of garbled texts, because the sketch sends UTF-8 while the modem expects the GSM alphabet; stick to plain ASCII or use TinyGSM's sendSMS_UTF16().

HTTP over 4G: fetching data from the internet

Beyond SMS, the real strength of a 4G module is internet access. TinyGSM turns the module's built-in TCP stack into a regular Arduino Client object, so libraries you already use over Wi-Fi, such as ArduinoHttpClient and PubSubClient (MQTT), also work over LTE. The example below fetches the current temperature in Berlin every 10 minutes from Open-Meteo, a service that doesn't need an API key. Change APN to your carrier's access point name; you'll find it on the carrier's website or in your phone's mobile network settings, and IoT SIM providers print it in their setup instructions.

C++ (Arduino IDE)
1#define TINY_GSM_MODEM_SIM7600      // A7670 için / for A7670: TINY_GSM_MODEM_A7672X
2#define TINY_GSM_RX_BUFFER 1024
3#include <TinyGsmClient.h>
4#include <ArduinoHttpClient.h>
5
6#define MODEM_RX      16
7#define MODEM_TX      17
8#define MODEM_PWRKEY   4
9
10const char APN[]       = "internet";   // operatörünün APN'i / your carrier's APN
11const char GPRS_USER[] = "";
12const char GPRS_PASS[] = "";
13const char SERVER[]    = "api.open-meteo.com";
14const int  PORT        = 80;
15const char PATH[]      = "/v1/forecast?latitude=52.52&longitude=13.41&current=temperature_2m";  // Berlin
16
17HardwareSerial SerialAT(2);
18TinyGsm modem(SerialAT);
19TinyGsmClient client(modem);
20HttpClient http(client, SERVER, PORT);
21
22void modemPowerOn() {
23  pinMode(MODEM_PWRKEY, OUTPUT);
24  digitalWrite(MODEM_PWRKEY, HIGH);
25  delay(1000);
26  digitalWrite(MODEM_PWRKEY, LOW);
27}
28
29// Şebeke ve veri bağlantısını hazırla / make sure network and data are up
30bool connectData() {
31  if (!modem.isNetworkConnected() && !modem.waitForNetwork(60000L)) return false;
32  if (modem.isGprsConnected()) return true;
33  return modem.gprsConnect(APN, GPRS_USER, GPRS_PASS);
34}
35
36void setup() {
37  Serial.begin(115200);
38  modemPowerOn();
39  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
40  if (!modem.testAT(20000L)) Serial.println("Modem not responding");
41  modem.init();
42}
43
44void loop() {
45  if (!connectData()) {
46    Serial.println("No data connection, retrying in 30 s");
47    delay(30000);
48    return;
49  }
50  Serial.print("IP: ");
51  Serial.println(modem.getLocalIP());
52
53  int err = http.get(PATH);
54  if (err == 0) {
55    int status = http.responseStatusCode();
56    String body = http.responseBody();
57    Serial.print("HTTP ");
58    Serial.println(status);
59    // "current" nesnesindeki sıcaklığı bul / find the temperature inside "current"
60    int i = body.indexOf("\"temperature_2m\":", body.indexOf("\"current\""));
61    if (i > 0) {
62      float temp = body.substring(i + 17).toFloat();
63      Serial.print("Berlin: ");
64      Serial.print(temp, 1);
65      Serial.println(" C");
66    }
67  } else {
68    Serial.print("Request error: ");
69    Serial.println(err);
70  }
71  http.stop();
72  delay(600000UL);                     // 10 dakikada bir / every 10 minutes
73}
Data usage is easy to estimate: a small HTTP request like this one takes about 1–3 KB including the TCP connection and headers. One request every 10 minutes is 144 a day and about 4,300 a month, which works out to 4–13 MB. Even the smallest data plan is enough. If you batch your readings and send them less often, you save both data and power.

Getting a GPS position with the SIM7600

SIM7600 variants with GNSS make a separate GPS module unnecessary: AT+CGPS=1 turns the receiver on and AT+CGNSSINFO reads the position. TinyGSM wraps this in the enableGPS() and getGPS() functions. Outdoors, the first fix (cold start) usually arrives within 30 seconds to a few minutes; indoors it often never comes. The sketch below prints the position to the Serial Monitor every 10 seconds and sends the first valid fix by SMS once. TinyGSM's A7670 driver has no GPS functions; on an A7670 with GNSS you can turn the receiver on with AT+CGNSSPWR=1 and read the position yourself with AT+CGNSSINFO, or add a separate NEO-6M GPS module.

C++ (Arduino IDE)
1#define TINY_GSM_MODEM_SIM7600      // GPS: yalnız GNSS'li SIM7600 / GNSS-equipped SIM7600 only
2#include <TinyGsmClient.h>
3
4#define MODEM_RX      16
5#define MODEM_TX      17
6#define MODEM_PWRKEY   4
7
8const char PHONE[] = "+491701234567";
9
10HardwareSerial SerialAT(2);
11TinyGsm modem(SerialAT);
12bool smsSent = false;
13
14void modemPowerOn() {
15  pinMode(MODEM_PWRKEY, OUTPUT);
16  digitalWrite(MODEM_PWRKEY, HIGH);
17  delay(1000);
18  digitalWrite(MODEM_PWRKEY, LOW);
19}
20
21void setup() {
22  Serial.begin(115200);
23  modemPowerOn();
24  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
25  modem.testAT(20000L);
26  modem.init();
27  modem.enableGPS();                    // AT+CGPS=1
28  Serial.println("GNSS on, waiting for satellites...");
29}
30
31void loop() {
32  float lat, lon, speed, alt, accuracy;
33  int vsat, usat;
34  if (modem.getGPS(&lat, &lon, &speed, &alt, &vsat, &usat, &accuracy)) {
35    Serial.printf("Position: %.6f, %.6f  speed: %.1f km/h  altitude: %.0f m\n",
36                  lat, lon, speed * 1.852, alt);   // hız knot cinsinden gelir / speed arrives in knots
37    if (!smsSent && modem.waitForNetwork(30000L)) {
38      String msg = "Position: " + String(lat, 6) + "," + String(lon, 6);
39      smsSent = modem.sendSMS(PHONE, msg);         // ilk konumu bir kez SMS'le / text the first fix once
40    }
41  } else {
42    Serial.println("No fix yet");
43  }
44  delay(10000);
45}

4G module with a Raspberry Pi Pico and MicroPython

There's no TinyGSM for the Pico, but AT commands are the same in every language. The MicroPython code below opens UART0 on GP0 (TX) and GP1 (RX), sends a power-on pulse to PWRKEY from GP2, waits for LTE registration with AT+CEREG? and sends an SMS. The trick when sending SMS is to wait for the module's ">" prompt after AT+CMGS and to end the text with a Ctrl+Z character (0x1A). With a Pico W you can use the same pattern to make LTE a backup for Wi-Fi.

MicroPython
1from machine import UART, Pin
2import time
3
4uart = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1), rxbuf=1024)   # GP0 -> RXD, GP1 <- TXD
5pwrkey = Pin(2, Pin.OUT, value=0)
6PHONE = "+491701234567"
7
8def wait_for(expect, timeout_ms):
9    start = time.ticks_ms()
10    buf = b""
11    while time.ticks_diff(time.ticks_ms(), start) < timeout_ms:
12        if uart.any():
13            buf += uart.read()
14            if expect in buf:
15                break
16    return buf
17
18def at(cmd, expect=b"OK", timeout_ms=3000):
19    uart.write(cmd + "\r\n")
20    buf = wait_for(expect, timeout_ms)
21    print(cmd, "->", buf)
22    return buf
23
24def registered():
25    r = at("AT+CEREG?")                # LTE kaydı / LTE registration
26    return b",1" in r or b",5" in r    # 1 = ev şebekesi, 5 = dolaşım / 1 = home, 5 = roaming
27
28def send_sms(number, text):
29    at("AT+CMGF=1")                                    # metin modu / text mode
30    if b">" not in at('AT+CMGS="{}"'.format(number), expect=b">"):
31        return False
32    uart.write(text + "\x1a")                          # Ctrl+Z mesajı yollar / Ctrl+Z sends it
33    return b"+CMGS" in wait_for(b"+CMGS", 20000)
34
35pwrkey.value(1)                        # açma darbesi / power-on pulse
36time.sleep(1)
37pwrkey.value(0)
38time.sleep(15)                         # modülün açılmasını bekle / let the module boot
39
40at("AT")
41at("AT+CPIN?", b"READY")
42for _ in range(30):                    # en fazla 60 sn / up to 60 s
43    if registered():
44        break
45    time.sleep(2)
46at("AT+CSQ")
47print("SMS:", send_sms(PHONE, "Pico + 4G: SMS test OK"))

Project ideas with a 4G module

  • Cabin and greenhouse alarm: a monitoring box that needs no Wi-Fi and sends an SMS when the door opens or the temperature drops; add a DS18B20 sensor for frost alerts.
  • Car and camper tracker: send the SIM7600's GNSS position to a server every few minutes and protect the battery with sleep mode while the ignition is off.
  • Remote water tank or well: measure the level with a distance sensor and log it to a cloud spreadsheet over HTTP a few times a day.
  • SMS relay control: switch a pump or heater according to commands in incoming SMS and only accept commands from stored numbers. For the relay wiring, see What Is a Relay Module?.
  • Motion alarm with a fallback: a security system that sends a Telegram message when the PIR sensor triggers and switches to SMS if Wi-Fi drops.
  • LoRa to 4G gateway: a single ESP32 with 4G collects data from many LoRa sensors around the garden or farm and sends it to the internet; we compare wireless options in Wireless Communication Modules.

Common problems and fixes

SymptomLikely causeFix
Module reboots every few seconds, ESP32 reports brownoutWeak supply, thin wires5 V 2 A supply, 1000 µF capacitor, common ground
No reply to AT at allTX and RX not crossed, module not powered on, wrong baud rateCross TX to RX, check the PWRKEY pulse, try 115200 baud
+CSQ: 99,99No antenna or band mismatchConnect the LTE antenna, use the right regional variant
+CEREG: 0,2 never changes, or 0,3 appearsSIM not active, data disabled, no coverageTest the SIM in a phone, check the band with AT+CPSI?
SMS works but HTTP doesn'tWrong APN or no data planEnter your carrier's APN, check your data allowance
GPS never gets a fixAntenna indoors or no GNSS on the moduleTake the active antenna outside, check the variant supports GNSS
Voice calls failNo 2G or 3G, VoLTE not supportedUse firmware and a plan with VoLTE support

A 4G module frees your ESP32 projects from your home Wi-Fi and takes them anywhere there's mobile coverage: with the right regional variant, a supply that can handle 2 A and a decent antenna, it runs far more reliably than a SIM800L. If you'd like to build the sensor and notification side first, the BlueGrays app walks you through the ESP32 motion alarm, gas detector and weather projects step by step with circuit diagrams and code; adding LTE in place of Wi-Fi is the last step.

Frequently asked questions

Does the SIM800L work on 4G?

No. The SIM800L only uses the 2G (GSM/GPRS) network. A 4G SIM card will work in it, but only where a 2G network is still on air; in places where 2G has been switched off, such as the US, Australia and Switzerland, you need an LTE module like the A7670 or SIM7600.

What is the difference between SIM7600 and A7670?

The SIM7600 is a larger module whose Cat-4 variants reach 150 Mbit/s, fall back to 3G and 2G and usually include GNSS. The A7670 is a cheaper, smaller Cat-1 module with 10 Mbit/s; its European variant only falls back to 2G and not every variant has GNSS. Both work with TinyGSM and very similar AT commands.

Which 4G module is best for ESP32?

For SMS and small HTTP requests, the A7670E offers the best value. If you need GPS, more speed, 3G fallback or use in several countries, the SIM7600G-H is the better choice. For battery-powered devices that must run for a long time, the SIM7080G with LTE-M and NB-IoT is ideal, provided your carrier supports those services.

How much current does the SIM7600 draw?

Idle and registered it draws only around 15–30 mA, during LTE data transfers roughly 200–700 mA, and short peaks can reach 2 A, especially when it falls back to 2G. That's why it needs a supply rated for at least 2 A and a 1000 µF capacitor close to the module, and it must never be powered from the ESP32's 3.3 V pin.

What is the difference between LTE Cat-1 and Cat-M?

Cat-1 runs on the regular LTE network at up to 10 Mbit/s and works with any normal SIM card. Cat-M (LTE-M) uses a narrow 1.4 MHz channel and drops to about 1 Mbit/s, but uses far less power thanks to PSM and eDRX and reaches further indoors. Cat-M needs a carrier that offers it and often an IoT SIM card.

Can the SIM7600 work in the USA?

Yes, but pick the right variant: the SIM7600A-H or the global SIM7600G-H support the North American LTE bands. 2G and 3G are gone in the US, so the module has to work on LTE alone. Check that your carrier accepts the module on its network before you rely on it.

See all projects
ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)
ES-41Advanced
Premium

ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)

A smart security alarm: when the PIR sensor detects motion, it sounds the buzzer, lights the LED and sends the owner an instant Telegram notification. A 30-second cooldown limits how often the alarm repeats; it does not filter out the PIR sensor's false detections. Use it at home, in a garage, a storeroom or a study.

4.0(1)
9
ESP32 MQ-2 Gas/Smoke Detector Alarm
ES-20Intermediate

ESP32 MQ-2 Gas/Smoke Detector Alarm

In this project, combustible gas (LPG, methane, propane) and smoke detection is performed using an MQ-2 gas sensor module, and a siren-like alarm is played through a passive buzzer upon detection. The sensor's digital threshold output (DO) is connected to GPIO 4 on the ESP32; when gas or smoke exceeds the threshold, DO goes LOW and the alarm is triggered. Sensitivity is adjusted via the module's potentiometer. The passive buzzer is driven using tone() to produce a two-frequency siren effect.

4.7(29)
47
ESP32 HTTPClient + Weather API (with LCD Screen)
ES-31Advanced
Premium

ESP32 HTTPClient + Weather API (with LCD Screen)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. The JSON response is parsed with ArduinoJson v7, and the city, temperature, humidity, weather and wind are shown on an I2C LCD. wttr.in needs no API key; just type the name of any city.

4.7(13)
20
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
ES-32Advanced
Premium

ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

4.3(10)
22
ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
ES-40Advanced
Premium

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)

Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

4.7(7)
12
ESP32 Wi-Fi STA Connection (with LCD Screen)
ES-25Advanced

ESP32 Wi-Fi STA Connection (with LCD Screen)

In this project, we connect the ESP32 to the home Wi-Fi network in Station (STA) mode in a secure, fault-tolerant manner. We store the SSID and password in a separate secrets.h file to prevent leaking to Git, set up an auto-reconnect mechanism, and display the RSSI signal level and IP address on an I2C LCD screen. The internal LED works as a status indicator. It is a production-grade connection manager.

4.4(21)
40