Electronics

GSM SIM7000G 9102 16MB LILYGO TTGO T

AED 229.00

1

Description

The LILYGO T-SIM7000G ESP32 is a compact development board that combines an ESP32 microcontroller with the SIM7000G module, which provides support for LTE, GPRS, and GPS communication. This board is designed to allow for the easy development of IoT applications that require reliable and fast cellular data connectivity, as well as precise location tracking through GPS. The board features a variety of input and output interfaces, including UART, SPI, I2C, and GPIO pins, as well as a built-in antenna and SIM card slot. The LILYGO T-SIM7000G ESP32 is a versatile and affordable solution for IoT projects that require cellular connectivity and location tracking.

 

Package Includes:

  • 1 x LILYGO T-SIM7000G ESP32 Board 

 

Features:

  1. ESP32-WROVER-B module with a 240MHz dual-core processor
  2. 4MB of flash memory and 8MB of PSRAM for program and data storage
  3. Built-in Wi-Fi and Bluetooth connectivity for wireless communication
  4. USB to serial converter (CP2104) for programming and communication
  5. SIM7000G module for LTE Cat-M1, NB-IoT, GPRS, and SMS communication
  6. Nano SIM card slot and SIM antenna slot for cellular connectivity
  7. GPS antenna slot for location tracking
  8. Li-ion/Li-Po battery charging circuit with a DW01A battery protection IC and a CN3065 solar energy charging interface for 4.4-6.8V solar panels
  9. 18650 battery holder and solar panel connector with a 2p JST-PH interface for power supply
  10. Micro SD card slot for data storage
  11. On/off switch for convenience

 

Description:

The LILYGO T-SIM7000G ESP32 is a versatile development board designed for IoT applications. It is powered by a 240MHz dual-core ESP32 chip and has 4MB of flash memory, 8MB of PSRAM, and 520KB of SRAM. The board supports 3.3V DC or 5V DC supply voltage and features built-in Wi-Fi and Bluetooth connectivity. The board also includes a USB-to-serial converter for easy programming and communication with other devices. It has a built-in SIM7000G module that supports LTE, GPRS, and GPS communication, as well as a nano SIM card slot and a SIM antenna slot. The board also has a built-in GPS antenna slot for accurate location tracking. The LILYGO T-SIM7000G ESP32 has a built-in Li-ion/Li-Po battery charging circuit, with a DW01A battery protection IC and a CN3065 solar energy charging interface for 4.4-6.8V solar panels. It also has a built-in 18650 battery holder and a solar panel connector with a 2p JST-PH interface. The board includes a Micro SD card slot and an on/off switch for convenience.

 

Principle of Work:

  1. The ESP32 microcontroller on the board runs your application code and provides the processing power and interfaces to interact with other devices or sensors.
  2. The SIM7000G module on the board provides cellular connectivity, allowing the board to connect to the internet via a cellular network.
  3. The board also includes a CP2104 USB-to-UART bridge controller, which allows the ESP32 to communicate with a computer via a USB connection.
  4. To use the board, you first need to program your application code onto the ESP32 using the Arduino IDE or another programming environment.
  5. Once your code is programmed onto the board, you can connect it to a power source and a cellular network to enable cellular communication.
  6. You can then use the board to send and receive data over the cellular network, such as sending SMS messages or making HTTP requests.
  7. The board also includes a variety of other features, such as an OLED display, GPS module, and battery charging circuitry, that can be used in your application as needed.

 

Pinout of the Module:

 

 

 

Applications:

  1. Internet of Things (IoT) devices: With cellular connectivity, the board can be used to connect various IoT devices to the internet, allowing for remote monitoring and control of devices.
  2. Asset tracking: The board's GPS functionality can be used to track the location of assets, such as vehicles or equipment.
  3. Remote sensing and monitoring: The board can be used to collect sensor data from remote locations, such as weather stations, air quality monitors, or water quality sensors.
  4. Smart agriculture: The board can be used in agricultural applications to collect data from sensors that monitor soil moisture, temperature, and other environmental factors, which can be used to optimize crop yields and reduce water usage.
  5. Home automation: The board can be used to connect home automation devices to the internet, allowing for remote control of lights, temperature, and other home appliances.

 

Circuit:

 no circuit is needed for the code used.

 

Library: 

here's a step-by-step guide on how to set up the LILYGO T-SIM7000G ESP32 v1.1 board on the Arduino IDE and how to install the TinyGSM library to work with it:

  1. Download and install the latest version of the Arduino IDE from the official website: https://www.arduino.cc/en/software.
  2. Open the Arduino IDE and go to the "File" menu. Select "Preferences" from the drop-down menu.
  3. In the "Preferences" window, go to the "Additional Boards Manager URLs" field and enter the following URL: https://dl.espressif.com/dl/package_esp32_index.json.
  4. Click "OK" to close the "Preferences" window.
  5. Go to the "Tools" menu and select "Board: ".
  6. Select "Boards Manager" from the drop-down menu.
  7. In the "Boards Manager" window, search for "esp32" and select the "esp32 by Espressif Systems" option.
  8. Click "Install" to install the ESP32 board support package.
  9. Go back to the "Tools" menu and select "Board: ".
  10. Select "ESP32 Dev Module" from the drop-down menu.
  11. Connect the LILYGO T-SIM7000G ESP32 v1.1 board to your computer using a USB cable.
  12. Go to the "Tools" menu and select "Port". Select the port that the board is connected to.
  13. Download the TinyGSM library from the official repository on GitHub: https://github.com/vshymanskyy/TinyGSM
  14. Open the Arduino IDE and go to the "Sketch" menu. Select "Include Library" > "Add .ZIP Library".
  15. Select the downloaded TinyGSM library ZIP file and click "Open".

 and there are some examples built exactly for this board you can download and add to your Arduino from here: https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G

 

Code:

This code is an Arduino sketch that configures an ESP32 module to work with a SIM7000 modem, which allows it to communicate with a cellular network. The sketch initializes the modem and sets up a number of parameters such as the APN, GPRS credentials, and the preferred network mode. It also turns off the modem's GPS power and sets it to automatically connect to the network. The sketch then waits for incoming messages, splits them up into 24 pieces, and stores them in an array. Once all 24 pieces have been received, they are concatenated and written to an SD card. The ESP32 is then put to sleep for 60 seconds and the process is repeated.
#define TINY_GSM_MODEM_SIM7000
#define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb
#define SerialAT Serial1

// See all AT commands, if wanted
#define DUMP_AT_COMMANDS

/*
   Tests enabled
*/
#define TINY_GSM_TEST_GPRS    true
#define TINY_GSM_TEST_GPS     true
#define TINY_GSM_POWERDOWN    true

// set GSM PIN, if any
#define GSM_PIN ""

// Your GPRS credentials, if any
const char apn[]  = "YOUR-APN";     //SET TO YOUR APN
const char gprsUser[] = "";
const char gprsPass[] = "";

#include "TinyGsmClient.h"
#include "SPI.h"
#include "SD.h"
#include "Ticker.h"

#ifdef DUMP_AT_COMMANDS  // if enabled it requires the streamDebugger lib
#include "StreamDebugger.h"
StreamDebugger debugger(SerialAT, Serial);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif

#define uS_TO_S_FACTOR 1000000ULL  // Conversion factor for micro seconds to seconds
#define TIME_TO_SLEEP  60          // Time ESP32 will go to sleep (in seconds)

#define UART_BAUD   115200
#define PIN_DTR     25
#define PIN_TX      27
#define PIN_RX      26
#define PWR_PIN     4

#define SD_MISO     2
#define SD_MOSI     15
#define SD_SCLK     14
#define SD_CS       13
#define LED_PIN     12


int counter, lastIndex, numberOfPieces = 24;
String pieces[24], input;


void setup()
{
    // Set console baud rate
    Serial.begin(115200);
    delay(10);

    // Set LED OFF
    pinMode(LED_PIN, OUTPUT);
    digitalWrite(LED_PIN, HIGH);

    pinMode(PWR_PIN, OUTPUT);
    digitalWrite(PWR_PIN, HIGH);
    delay(300);
    digitalWrite(PWR_PIN, LOW);

    SPI.begin(SD_SCLK, SD_MISO, SD_MOSI, SD_CS);
    if (!SD.begin(SD_CS)) {
        Serial.println("SDCard MOUNT FAIL");
    } else {
        uint32_t cardSize = SD.cardSize() / (1024 * 1024);
        String str = "SDCard Size: " + String(cardSize) + "MB";
        Serial.println(str);
    }

    Serial.println("\nWait...");

    delay(1000);

    SerialAT.begin(UART_BAUD, SERIAL_8N1, PIN_RX, PIN_TX);

    // Restart takes quite some time
    // To skip it, call init() instead of restart()
    Serial.println("Initializing modem...");
    if (!modem.restart()) {
        Serial.println("Failed to restart modem, attempting to continue without restarting");
    }





}

void loop()
{

    // Restart takes quite some time
    // To skip it, call init() instead of restart()
    Serial.println("Initializing modem...");
    if (!modem.init()) {
        Serial.println("Failed to restart modem, attempting to continue without restarting");
    }

    String name = modem.getModemName();
    delay(500);
    Serial.println("Modem Name: " + name);

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

    // Set Modem GPS Power Control Pin to LOW ,turn off GPS power
    // Only in version 20200415 is there a function to control GPS power
    modem.sendAT("+CGPIO=0,48,1,0");
    if (modem.waitResponse(10000L) != 1) {
        DBG("Set GPS Power LOW Failed");
    }

#if TINY_GSM_TEST_GPRS
    // Unlock your SIM card with a PIN if needed
    if ( GSM_PIN && modem.getSimStatus() != 3 ) {
        modem.simUnlock(GSM_PIN);
    }
#endif

    modem.sendAT("+CFUN=0 ");
    if (modem.waitResponse(10000L) != 1) {
        DBG(" +CFUN=0  false ");
    }
    delay(200);

    /*
      2 Automatic
      13 GSM only
      38 LTE only
      51 GSM and LTE only
    * * * */
    String res;
    res = modem.setNetworkMode(2);
    if (res != "1") {
        DBG("setNetworkMode  false ");
        return ;
    }
    delay(200);

    /*
      1 CAT-M
      2 NB-Iot
      3 CAT-M and NB-IoT
    * * */
    res = modem.setPreferredMode(3);
    if (res != "1") {

        DBG("setPreferredMode  false ");
        return ;
    }
    delay(200);

    /*AT+CBANDCFG=,[,…]
     *  "CAT-M"   "NB-IOT"
     *   The value of  must is in the band list of getting from  AT+CBANDCFG=?
     * For example, my SIM card carrier "NB-iot" supports B8.  I will configure +CBANDCFG= "Nb-iot ",8
     */
    /* modem.sendAT("+CBANDCFG=\"NB-IOT\",8 ");
     if (modem.waitResponse(10000L) != 1) {
         DBG(" +CBANDCFG=\"NB-IOT\" ");
     }
     delay(200);*/

    modem.sendAT("+CFUN=1 ");
    if (modem.waitResponse(10000L) != 1) {
        DBG(" +CFUN=1  false ");
    }
    delay(200);

#if TINY_GSM_TEST_GPRS

    SerialAT.println("AT+CGDCONT?");
    delay(500);
    if (SerialAT.available()) {
        input = SerialAT.readString();
        for (int i = 0; i < input.length(); i++) {
            if (input.substring(i, i + 1) == "\n") {
                pieces[counter] = input.substring(lastIndex, i);
                lastIndex = i + 1;
                counter++;
            }
            if (i == input.length() - 1) {
                pieces[counter] = input.substring(lastIndex, i);
            }
        }
        // Reset for reuse
        input = "";
        counter = 0;
        lastIndex = 0;

        for ( int y = 0; y < numberOfPieces; y++) {
            for ( int x = 0; x < pieces[y].length(); x++) {
                char c = pieces[y][x];  //gets one byte from buffer
                if (c == ',') {
                    if (input.indexOf(": ") >= 0) {
                        String data = input.substring((input.indexOf(": ") + 1));
                        if ( data.toInt() > 0 && data.toInt() < 25) {
                            modem.sendAT("+CGDCONT=" + String(data.toInt()) + ",\"IP\",\"" + String(apn) + "\",\"0.0.0.0\",0,0,0,0");
                        }
                        input = "";
                        break;
                    }
                    // Reset for reuse
                    input = "";
                } else {
                    input += c;
                }
            }
        }
    } else {
        Serial.println("Failed to get PDP!");
    }


    Serial.println("\n\n\nWaiting for network...");
    if (!modem.waitForNetwork()) {
        delay(10000);
        return;
    }

    if (modem.isNetworkConnected()) {
        Serial.println("Network connected");
    }

    Serial.println("\n---Starting GPRS TEST---\n");
    Serial.println("Connecting to: " + String(apn));
    if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
        delay(10000);
        return;
    }

    Serial.print("GPRS status: ");
    if (modem.isGprsConnected()) {
        Serial.println("connected");
    } else {
        Serial.println("not connected");
    }

    String ccid = modem.getSimCCID();
    Serial.println("CCID: " + ccid);

    String imei = modem.getIMEI();
    Serial.println("IMEI: " + imei);

    String cop = modem.getOperator();
    Serial.println("Operator: " + cop);

    IPAddress local = modem.localIP();
    Serial.println("Local IP: " + String(local));

    int csq = modem.getSignalQuality();
    Serial.println("Signal quality: " + String(csq));

    SerialAT.println("AT+CPSI?");     //Get connection type and band
    delay(500);
    if (SerialAT.available()) {
        String r = SerialAT.readString();
        Serial.println(r);
    }

    Serial.println("\n---End of GPRS TEST---\n");
#endif

#if TINY_GSM_TEST_GPRS
    modem.gprsDisconnect();
    if (!modem.isGprsConnected()) {
        Serial.println("GPRS disconnected");
    } else {
        Serial.println("GPRS disconnect: Failed.");
    }
#endif

#if TINY_GSM_TEST_GPS
    Serial.println("\n---Starting GPS TEST---\n");
    // Set Modem GPS Power Control Pin to HIGH ,turn on GPS power
    // Only in version 20200415 is there a function to control GPS power
    modem.sendAT("+CGPIO=0,48,1,1");
    if (modem.waitResponse(10000L) != 1) {
        DBG("Set GPS Power HIGH Failed");
    }

    modem.enableGPS();

    float lat,  lon;
    while (1) {
        if (modem.getGPS(&lat, &lon)) {
            Serial.printf("lat:%f lon:%f\n", lat, lon);
            break;
        } else {
            Serial.print("getGPS ");
            Serial.println(millis());
        }
        delay(2000);
    }
    modem.disableGPS();

    // Set Modem GPS Power Control Pin to LOW ,turn off GPS power
    // Only in version 20200415 is there a function to control GPS power
    modem.sendAT("+CGPIO=0,48,1,0");
    if (modem.waitResponse(10000L) != 1) {
        DBG("Set GPS Power LOW Failed");
    }

    Serial.println("\n---End of GPRS TEST---\n");
#endif


#if TINY_GSM_POWERDOWN
    // Try to power-off (modem may decide to restart automatically)
    // To turn off modem completely, please use Reset/Enable pins
    modem.sendAT("+CPOWD=1");
    if (modem.waitResponse(10000L) != 1) {
        DBG("+CPOWD=1");
    }
    modem.poweroff();
    Serial.println("Poweroff.");
#endif

    esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
    delay(200);
    esp_deep_sleep_start();

    // Do nothing forevermore
    while (true) {
        modem.maintain();
    }
}

  • it defines the specific module being used and sets some configuration parameters such as the buffer size, serial port, and GPRS credentials. It also includes the necessary libraries for the project and defines some pins used for hardware communication.
  • In the setup function, initializes the serial and hardware pins, sets up the SD card module, and initializes the GSM modem. It then turns off GPS power and sets the network and preferred modes of the module. If any of these initialization steps fail, the program prints an error message and stops.
  • In the loop function, it first initializes the GSM modem and prints some information about the modem, including its name and firmware version. It then turns off GPS power and sets the network and preferred modes of the module. It also sets the band configuration of the module based on the SIM card being used.
  • it enters a loop where it reads data from the GPS module, saves it to the SD card, and goes to sleep for a specified amount of time before waking up and repeating the process.

 

Technical Details: 

  • Supply voltage: 3.3V DC or 5V DC
  • ESP32 chip (WROVER-B Module) (240MHz dual-core processor)
  • Flash memory: 4MB
  • PSRAM: 8MB
  • SRAM: 520KB
  • Built-in Wi-Fi
  • Built-in Bluetooth
  • USB to serial converter: CP2104 or CH9102 (drivers)
  • Built-in SIM7000G module
  • Built-in nano SIM card slot
  • Built-in SIM antenna slot
  • Built-in GPS antenna slot
  • Built-in Li-ion/Li-Po battery charging circuit:
    • DW01A battery protection IC
    • CN3065 solar energy charging interface for 4.4-6.8V solar panel
    • Built-in 1x 18650 battery holder
    • Built-in solar panel connector 2p JST-PH
  • Built-in Micro SD card slot
  • Built-in on/off switch

 

Resources:

 

Comparisons:

The LILYGO T-SIM7000G ESP32 v1.1 board is a development board that integrates an ESP32 module and a SIM7000G module for cellular connectivity. In comparison to a standalone ESP32 and SIM7000G, using the LILYGO board provides the following benefits:

  1. Integration: With the LILYGO board, both the ESP32 and SIM7000G are integrated onto a single board, making it easier to interface with the SIM7000G module and reducing the complexity of the design.
  2. Reduced footprint: The LILYGO board is smaller than the combined footprint of a standalone ESP32 and SIM7000G module, making it ideal for applications where space is at a premium.
  3. Power management: The LILYGO board has an integrated power management system that regulates the voltage levels required by both the ESP32 and SIM7000G, simplifying the power supply design.
  4. Additional features: The LILYGO board also includes additional features such as a microSD card slot, a power switch, and a battery connector, making it more convenient for prototyping and testing cellular-connected applications.

However, there are also some drawbacks to using the LILYGO board, including:

  1. Cost: The LILYGO board is more expensive than a standalone ESP32 or SIM7000G module.
  2. Limited flexibility: The integration of the ESP32 and SIM7000G on a single board limits the ability to customize the hardware configuration to specific needs.

The decision to use the LILYGO T-SIM7000G ESP32 v1.1 board versus a standalone ESP32 and SIM7000G module will depend on the specific requirements of the application. The LILYGO board may be a more convenient and efficient solution for some applications, while standalone modules may offer greater flexibility and cost savings for others.