Skip to content

An Overview of ESP32 SIM800L in the Electronics Industry

Let’s suppose you are creating a remote Internet of Thing data monitoring device, but the first thing you face is creating an adequate internet connection for the device. Whether you need an alert notification when someone barges into your room or you want to turn on the Air conditioning before entering the house from far away, the internet always gets in the way. For such situations, SIM800L GSM or GPS module is a very helpful device. SIM800L has a compact size and flexibility, which makes it ideal to be integrated into the devices or projects of IoT. This module works the same as any cell phone can. Texting, receiving or making calls, connecting to the internet using GPS. Moreover, it supports GSM or GPS, which ensures that it can operate anywhere at any time perfectly fine.

ESP32 SIM800L Module Point

The SIM800L GPRS/GSM module contains 12 pins. These pins include NET, RST, VCC, RXD, GND, TXD, SPK+, SPK-, MIC+, MIC-, RING, and DTR. 

  1. NET is a type of pin specified to solder the antenna. The helical antenna comes with the SIM800L module.
  2. RST is used as a reset pin. It is used to reset the SIM800L. Pulling the pin low up to 100ms helps in resolving communication problems.
  3. VCC is a pin for the power supply for the module. It needs power in the range of 3.4 voltage to 4.4 voltage. If this module is connected to a power supply of 5 volts, it will destroy the whole module. If it is connected to a 3.3 voltage, then it might not work. Therefore, an external battery with a 2-ampere current is most likely recommended. 
  4. RXD is a pin of RX that is utilized in serial communication.
  5. GND is a type of ground pin that is connected to ESP32, another ground pin.
  6. TXD is a type of TX pin that is also utilized for serial communication.
  7. RING is a type of ring indicator. Generally, this pin is active at high. It can also go low up to 120 ms to identify incoming calls. It can also calculate the pulse whenever a text is received.
  8. DTR is a sleep pin especially used to put the SIM800L module to sleep. When the pin is pulled high, then the module goes into sleep mode and disengages the serial. It will wake up again when the pin is pulled low. 
  9. SPK+ and SPK- pins are used for connecting an external speaker or amplifier with the module.
  10. MIC+ and MIC- are used for connecting the external microphone with the module.

Overview Of The ESP32 SIM800L Module:

The SIM800L GPRS/GSM module is placed right in the middle of the breakout circuit board, which is created by SimCom. The operating power supply limit of this module ranges between 3.4 voltage and 4.4 voltage. This shows that it can easily be powered by using an external polymer lithium battery. All the pins break out to a pin pitch of 0.1”, which makes it more board friendly. It contains an automatic baud rate detection which makes it easy to use. Moreover, this module requires an outer antenna for the connection with the network. Therefore, two options for the antenna are available on this board. A helical antenna also comes with this module which can easily solder on the module through a NET pin. There is also an option for linking the outer antenna with the UFL connector presented on the board to keep the antenna away from the board. Furthermore, a 2G sim card works well for this module.

· LED Status Indicator:

An LED indicator is present on the very top of the SIM800L module. It blinks at different levels to show the condition of the network.

· Blink on each second:

If the LED located on the SIM800L module blinks every second, this means that the device is running fine, but it cannot connect with the cellular network currently.

· Blinks every two seconds:

When the LED located on the SIM800L module blinks after every two seconds, then this means that the data connection of the GPS you requested is currently active and prepared to take requests as demanded.

· Blink Every three seconds:

When the LED located on the SIM800L module blinks after three seconds, then this means that it is connected to the cellular network and ready to receive and send voice and texts.

Code For Interfacing SIM800L With ESP32

FULL PCB MANUFACTURING Quote

The code for communicating with the SIM800L GPRS/GSM module is really simple. The code simply uses the ESP32 connector’s UART2 to create communication with the module while the URAT is utilized for debugging.

The code is quite simple. That is why external libraries of code are not needed. Start the code with the setup function. In this step, Serial. begin(), and Serial2.begin() type methods are used to enable the UART2 and UART0 of the ESP32 connector. Then wait for at least 3 seconds so that the SIM module powers up. Then call the custom function test_sim800_module(). Then call the send_SMS () function, which is used to send a text via the module to check whether it’s working properly or not.

Then comes the loop function loop(). In this only call function, update serial () to evaluate the custom command via using the serial monitor. 

Then comes the test_sim800_module(). This function is used to evaluate the output from commanding AT commands to see the functionality of the module.

Some of those commands are as follows.

  1. AT is one of the common commands. If the output comes with OK, then this means the serial communication of the module is completely wrong.
  2. AT+CSQ is a signal strength checking command. It checks the value of strength in dB. For this module, the strength of the signal should be higher than 5. The signal strength gets better with every rising number.
  3. AT+CCID checks the number of the sim card, which is usually written on the other side of the card. After sending the command, check whether the number is correct or not manually. This also helps in evaluating the connection between the sim card and the module.
  4. AT+CREG? Tells whether the sim is registered properly over the network or not. The output must be either 1 or 5. However, one means that you are connected to a home network, while five shows that you are connected to the roaring network. Other than these two integers means that the sim isn’t registered to any network yet.
  5. ATI helps in getting the number and the name of the module.
  6. AT+COPS? Checks whether the sim is connected to the desired network or not.
  7. AT+CBC gives the percentage of the battery in the output. The second number on display shows the percentage of the battery.

Then comes the sen_SMS () function. This function configures the text mode of the SIM800L module. Then call the function of update serial, which helps in checking the output display on the serial monitor. Then set the number to which you need to send the text. Then write the message and 26 with the function of Serial2.write(26). This commands the serial to send the message. 

 

 

 

                Get Fast Quote Now