Sim800l gprs gsm module description. Test launch of GSM module SIM800L. Connection using GSM-GPRS shield

The GSM and GPRS module in Arduino projects allows you to connect to remote autonomous devices via regular cellular communications. We can send commands to the device and receive information from it using SMS commands or through an Internet connection opened via GPRS. In this article we will look at the most popular modules for Arduino, understand the connection and look at programming examples.

GSM GPRS modules

The GSM module is used to expand the capabilities of regular Arduino boards - sending SMS, making calls, exchanging data via GPRS. There are various types modules, the most commonly used are SIM900, SIM800L, A6, A7.

Description of the SIM900 module

SIM900 module is used in various automated systems. Using the UART interface, data is exchanged with other devices. The module provides the ability to make calls and exchange text messages. The module is implemented on the SIM900 component, created by SIMCom Wireless Solution.

Specifications:

  • Voltage range 4.8-5.2V;
  • In normal mode, the current reaches 450 mA, the maximum current in pulse mode is 2 A;
  • 2G support;
  • Transmission power: 1 W 1800 and 1900 MHz, 2 W 850 and 900 MHz;
  • There are built-in TCP and UDP protocols;
  • GPRS multi-slot class 10/8;
  • Operating temperature from -30C to 75C.

Using the device, you can track the route of a vehicle together with GLONASS or GPS device. The ability to send SMS messages is used in wireless alarms and various security systems.

Description of the SIM800L module

The module is based on the SIM800L component and is used for sending SMS, making calls and exchanging data via GPRS. A micro SIM card is installed in the module. The device has a built-in antenna and a connector to which you can connect external antenna. Power to the module is supplied from an external source or through a DC-DC converter. Control is carried out using a computer via UART, Arduino, Raspberry Pi or similar devices.

Specifications:

  • Voltage range 3.7V – 4.2V;
  • Support for 4-band network 900/1800/1900 MHz;
  • GPRS class 12 (85.6 kB/s);
  • Maximum current 500 mA;
  • 2G support;
  • Automatic search in four frequency ranges;
  • Operating temperature from –30C to 75C.

Description of module A6

The A6 module was developed by AI-THINKER in 2016. The device is used for exchanging SMS messages and exchanging data via GPRS. The board is characterized by low power consumption and small size. The device is fully compatible with Russian mobile operators.

Specifications:

  • Voltage range 4.5 – 5.5V;
  • Power supply 5V;
  • Operating temperature range from -30C to 80C;
  • Maximum current consumption 900mA;
  • GPRS Class 10;
  • Supports PPP, TCP, UDP, MUX protocols.

The module supports microsim cards.

Description of module A7

A7 is the latest module from AI-THINKER. Compared to its predecessor, the A6 has built-in GPS, allowing for a simplified design of the device.

Specifications:

  • Operating voltage range 3.3V-4.6V;
  • Supply voltage 5V;
  • Frequencies 850/900/1800/1900 MHz;
  • GPRS Class 10: Max. 85.6 kbit;
  • Echo and noise suppression.

The device supports microSIM cards. The module supports exchanging calls, exchanging SMS messages, transmitting data via GPRS, receiving signals via GPS.

Where to buy GSM modules for Arduino

Traditionally, before you start, a few tips and useful links to Aliexpress sellers.

Very high quality KEYES SIM900 GSM GPRS module SIM800C module for Arduino from a trusted supplier
Shield for development, compatible with Arduino, based on the SIM900 GPRS/GSM module Inexpensive mini A6 GPRS GSM module

Connecting GSM GPRS shield to Arduino

In this section we will look at the issues of connecting GSM modules to the Aduino board. Almost all examples are based on the Arduino Uno, but most examples will also be used for Mega, Nano, etc. boards.

Connecting the SIM800 module

To connect, you need an Arduino board, a SIM800L module, a step-down voltage converter, connection wires and a 12V battery. The SIM800L module requires a non-standard Arduino voltage of 3.7V; this requires a step-down voltage converter.

The pinout of the SIM800 module is shown in the figure.

The Arduino board must be connected to the computer via a USB cable. Connect a 12V battery through a converter: -12V to Arduino ground, from ground to negative converter, +12V to positive converter. The outputs from the TX and RX module must be connected to pins 2 and 3 on the Arduino. Multiple modules can be connected to any digital pins.

Connecting module A6

The A6 module is cheaper than SIM900 and is very easy to connect to Arduino. The module is powered by a voltage of 5V, so the connection does not require additional voltage-reducing elements.

To connect, you will need an Arduino board (in this case, Arduino UNO is considered), an A6 GSM module, and connecting wires. The connection diagram is shown in the figure.

The RX pin from the GSM module must be connected to TX on the Arduino board, the TX pin must be connected to the RX pin on the Arduino. The ground from the module is connected to the ground on the microcontroller. The Vcc pin on the GSM module must be connected to PWR_KEY.

Connection using GSM-GPRS shield

Before connecting, it is important to pay attention to the shield's supply voltage. The current at the time of a call or sending data can reach values ​​of 15-2 A, so you should not power the shield directly from the Arduino.

Before connecting to Arduino, you need to install a SIM card on the GSM-GPRS shield. You also need to install the TX and RX jumpers, as shown in the figure.

The connection is made as follows - the first contact (yellow wire in the figure) from the shield must be connected to TX on the Arduino. The second pin (green wire) connects to RX on the Arduino. The land from the shield is connected to the land from the aruino. Power is supplied to the microcontroller via a USB cable.

The layout of the connection between the shield and the Arduino board is shown in the figure.

To work, you will need to install the GPRS_Shield_Arduino library.

To check the correctness of the assembled circuit, you need to do the following: connect RESET and GND on the Arduino (this will lead to data being transferred directly from the shield to the computer), insert the SIM card into the shield and turn on the power of the shield. The Arduino board needs to be connected to the computer and the power button pressed. If everything is connected correctly, the red LED will light up and the green LED will blink.

Brief description of interaction via AT commands

AT commands are a set of special commands for the modem, consisting of short text strings. In order for the modem to recognize the command given to it, the lines must begin with the letters at. The string will be accepted when the modem is in command mode. AT commands can be sent using either a communication software, and manually from the keyboard. Almost all commands can be divided into 3 modes - test, in which the module answers whether it supports the command; read – output current command parameters; write – new values ​​will be written.

List of the most used AT commands:

  • AT – to check whether the module is connected correctly. If everything is OK, OK is returned.
  • A/ – repeat the previous command.
  • AT+IPR? – obtaining information about the port speed. The answer will be +IPR: 0 OK (0 in this case is automatic).
  • AT+ICF? – transmission setting. The response will be +ICF: bit, parity.
  • AT+IFC? – transmission control. The answer will be +IFC: terminal from module, module from terminal (0 – no control, 1 – software control, 2 – hardware control).
  • AT+GCAP – shows the capabilities of the module. An example answer is +GCAP:+FCLASS,+CGSM.
  • AT+GSN – obtaining module IMEI. Example answer 01322600XXXXXXXX.
  • AT+COPS? – shows available operators.
  • AT+CPAS – module status. Response +CPAS: 0. 0 – ready for work, 3 – incoming call, 4 – voice connection, 2 – unknown.
  • AT+CCLK? – information about the current time and date.
  • AT+CLIP=1 – enable/disable Caller ID. 1 – enabled, 0 – disabled.
  • AT+CSCB=0 – receiving special SMS messages. 0 – allowed, 1 – disabled.
  • AT+CSCS= “GSM” – SMS message encoding. You can select one of the following encodings: IRA, GSM, UCS2, HEX, PCCP, PCDN, 8859-1.
  • AT+CMEE=0 – receiving error information.
  • AT+CPIN=XXXX – enter the SIM card PIN code.
  • AT&F – reset to factory settings.
  • AT+CPOWD=1 – urgent (0) or normal (1) module shutdown.
  • ATD+790XXXXXXXX – call to number +790XXXXXXXX.
  • ATA – answer to the call.
  • AT+CMGS=”+790XXXXXXXX”>Test sms – sending an SMS message to the number +790XXXXXXXX.

In this case, the basic commands for the SIM900 module are considered. Commands may vary slightly for different modules. Data for the module will be supplied via special program"terminal" that needs to be installed on your computer. You can also send commands to the module through the port monitor in the Arduino IDE.

Sketches for working with the GSM module

Sending SMS using SIM900 as an example

Before sending a message, you need to configure the module. First of all, you need to convert the transmitted message into text format. There is a command AT+CMGF=1 for this. You need to convert the encoding to GSM using the command AT+CSCS="GSM". This encoding is the most convenient, since the characters are represented in ASCII code, which is easily understood by the compiler.

Then you need to dial an SMS message. To do this, a command is sent with the subscriber number AT+CMGS=»+79XXXXXXXXXX» r, in response you are asked to type an SMS text. You need to send a message. Upon completion, you need to send the combination code Ctrl+Z, the module will allow sending text to the recipient. When the message is sent, OK will be returned.

Interaction with the module is based on indices that are assigned to each new message. Using this index, you can specify which message to delete or read.

Receiving SMS. To read an SMS message, use the command AT + CNMI = 2,2,0,0,0. When will the module arrive? text message, it will send +CMTI: “SM”,2 to the serial port (in this case, 2 is the message sequence number). To read it, you need to send the command AT+CMGR=2.

Receiving a voice call. First of all, to have a conversation, you need to connect a speaker and microphone to the module. When a call is received, the number from which it was made will be shown. To work, you need to enable the GSM library:

#include

If the SIM card is blocked, you need to enter its PIN code. If a PIN code is not required, this field should be left blank.

#define PINNUMBER “”

In setup(), data transfer to the computer must be initialized. The next step is to create a local variable to track the network connection status. The sketch will not run until the SIM card is connected to the network.

boolean notConnected = true;

The gsmAccess.begin() function is used to connect to the network. When the connection is established, the value GSM_READY will be returned.

vcs.hangCall(); – a function indicating that the modem is ready to receive calls.

getvoiceCallStatus() – determines the status of the sketch. If someone calls, it returns RECEIVINGCALL. To record a number, you need to use the retrieveCallingNumber() function. When the call is answered, TALKING will return. The sketch will then wait for the character new line to interrupt the conversation.

Establish a GPRS connection and send data to a remote server

First you need to install the SoftwareSerial library, which allows you to provide serial information transfer and connect the GSM module and the Arduino microcontroller.

To send data to the server, you need to send the following commands:

AT+SAPBR=1,1 – opening Carrier.

The next three commands are related to setting network connection settings.

AT+SAPBR=3,1,\”APN\”,\”internet.mts.ru\” – select mts operator, access point name.

AT+SAPBR=3,1,\”USER\”,\” mts \” – select the mts user.

AT+SAPBR=3,1,\”PWD\”,\” mts\”

AT+SAPBR=1,1 – connection establishment.

AT+HTTPINIT – http initialization.

AT+HTTPPARA=”URL”, – URL address.

AT+HTTPREAD – waiting for a response.

AT+HTTPTERM – stop http.

If everything is done correctly, lines with AT commands will appear in the port monitor. If there is no connection with the modem, it will show one line at a time. When the GPRS connection is successfully established, the LED on the module will start blinking.

GSM GPRS module SIM800L(SIM800L) MicroSIM with antenna
SIM800L GPRS GSM Module MicroSIM Card Core BOard Quad-band TTL Serial Port

Miniature GSM/GPRS module cellular communication based on the SIM800L component developed by SIMCom Wireless Solutions. Russian-language version of the SIMCom website. The standard control interface of the SIM800L component provides access to GSM/GPRS 850/900/1800/1900 MHz network services for sending calls, SMS messages and exchanging GPRS digital data. Comes with built-in antenna, can also be connected additional antennas to improve signal quality.
The module can be controlled using personal computer via a USB-UART interface converter or directly via UART with a self-developed microcontroller module or Arduino, Raspberry Pi and similar.
The SIM800L component has an implemented TCP/IP protocol stack. Contains MediaTek's MT6260SA chip and RFMD RF7176 transceiver chip.
Thanks to the function of sending SMS messages, the GSM GPRS SIM800 MicroSIM module with antenna is most often used in dispatching, wireless alarms and security systems. At the same time, as a result of various events, messages of the form are sent: “Emergency stop of elevator 3 of building No. 17”, “Garage is open”, “Basement door is open”, “220 turned off due to overload”, “Heating system leakage”, “Heating boiler is turned off” , “The temperature in the greenhouse is below normal.”
A speaker and microphone are connected to the GSM GPRS SIM800 MicroSIM module. You can make and receive calls from the module.

Characteristics

Nutrition
voltage, V
nominal 4
range 3.4-4.4
current
standby 0.7 mA
limit 500 mA
UART Interface High Level Maximum Voltage 2.8V
UART speed 1200-115200 baud
Four bands EGSM900, DCS1800, GSM850, PCS1900
Transmission power in different bands
DCS1800, PCS1900 1 W
GSM850, EGSM900 2 W
Automatically searches in four frequency bands
Supports 2G network
Connected speaker impedance 8 ohms
Electret microphone
Controlled by AT commands via UART (3GPP TS 27.007, 27.005 SIMCOM enhanced AT Commands)
Automatic determination of the transmission speed of AT control commands
Sending and receiving GPRS data (TCP/IP, HTTP, etc.)
Max GPRS data transfer rate 85.6 Kbaud
Encoding CS-1, CS-2, CS-3 and CS-4
Supports GSM 07.10 protocol
Supports CSD Burst Broadcast Control Channel (PBCCH) at 2.4, 4.8, 9.6 and 14.4 kbaud rates
Support for unstructured data of additional USSD services
Supports PAP (Password Authentication Protocol)
RTC real time clock support
Supports SIM cards with 3 and 1.8 V power supply
Temperature, ℃
air during operation -30...75
storage -45...90
Dimensions 25 x 25 mm

Indication

When the GSM GPRS module is turned on, the LED on the board flashes quickly. When establishing a connection with a mobile operator, the blinking frequency decreases. If the connection with the mobile operator is lost, the LED will blink quickly again.


Fast blinking of the LED indicates that the signal from a mobile communication station is being searched on the air.

Connection

Names of some contacts and functions of signals and lines.

An antenna is connected to improve signal quality. Exceeding the input voltage of the UART interface will damage the SIM800 module. There is no USB-UART interface converter with an output voltage of 2.8 V. Existing converters have a higher voltage at the UART output. Therefore, a resistor voltage divider is installed between the output of the converter and the input of the GSM GPRS SIM800 module.

Depending on the output voltage U_usbttl of the interface converter you have, the resistor values ​​in the divider are calculated using the formula shown in the figure. When making calculations, you should strive for resistance values ​​of the order of several kilo-ohms.

First steps

To check the functionality of the device, it is enough to have a PC and a SIM card with a small cash account. The functionality can be checked using two methods of connecting the module to a PC: via a USB-UART interface converter or using Arduino UNO. Let's consider a verification method without Arduino. Install the SIM card into the GSM GPRS module, observing the location of the contacts. Connect the PC via a USB-UART interface converter to the device according to the diagram above. Connect power supply with rated voltage. Wait while the LED to connect to your mobile operator is blinking. Turn on the terminal program on your PC. The data should be entered into it in capital letters. Using a terminal program, send the following commands to the GSM GPRS SIM800 module via the connection port.

AT
Module response OK

AT+CSQ
Module response +CSQ: 18.0 OK

This command gives information about the signal strength. The first number is the signal level, a value of 18 means -78 dbm. The second number is the number of erroneously received bits; the value “0” indicates an error rate of less than 0.2%, which indicates a good connection.


Try sending an ATI command to the module.

If you don't have a USB-UART converter, you can use an Arduino UNO. Connect the RX pin of the SIM800L module to pin 11 digital signal Arduino UNO using a resistor voltage divider. The resistance values ​​of the resistors need to be recalculated taking into account the supply voltage of the Arduino UNO. Connect the TX pin of the SIM800L module to the digital signal pin 10 of the Arduino UNO. Load the program into the Arduino, the text of which is given below. The SoftwareSerial library is used here, which allows you to implement a serial interface on any digital pins of Arduino using software, duplicating the functionality of UART.

#include
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
{
while(Serial.available())
{
mySerial.write(Serial.read());
}
mySerial.println();
}
}

Program text and more useful information. You can now send AT commands through the Arduino serial monitor.

Texts are posted on Russian-language and foreign websites Arduino programs with which you can send SMS, monitor the state of the sensor contacts and send to the website the time of change in the state of the monitored contacts, and on the website save the received data in the form of a log.


SIM800L V2.0 GSM/GPRS is a quad-band GSM/GPRS module compatible with Arduino. The module is used to implement GSM (calls and SMS) and GPRS functions. The advantage of this module is the TTL interface, which has a voltage of 5V, which allows you to directly connect it to Arduino or any other system with a 5V supply voltage. Most GSM/GPRS modules on the market require regulator connections or level conversion, while in SIM800L V.2 GSM/GPRS does not require additional interface level conversion circuits.

Let's give an example of a project using SIM800L V.2 GSM/GPRS. The point of the project is to control switches using an SMS controller. You can easily turn on and off most household appliances in the house, such as a llama, a fan, and so on.

Characteristics of the SIM800L V.2 GSM/GPRS module

Below are all technical specifications SIM800L V.2 GSM/GPRS module:
  • TTL serial interface compatible with 3.3V and 5V Arduino compatible microcontrollers.
  • The SIM800L module has a TTL serial interface.
  • Antenna connection plug.
  • Network support: four bands 850/900/1800/1900 MHz, capable of making calls, SMS and data transfers with significantly reduced battery consumption.
  • VDD TTL UART interface, so you can directly connect MCU such as 51MCU, ARM or MSP430. The VDD plug is used to match the TTL voltage.
  • Model: SIMCOM SIM800L
  • Operating voltage: from 3.7V to 5V;
  • dimensions: 40mm x 28mm x 3mm
  • GPRS multislot class 12/10
  • GPRS packet service class B
  • Complies with GSM phase 2/2+
  • Class 4 (2 Watt @ 850/900 MHz)
  • Class 1 (1Watt @ 1800/1900MHz)

Required materials

ESP8266 became real news last year for everyone who creates devices on Arduino. A cheap microcontroller, with capabilities exceeding its expensive counterpart, and at the same time compatible with AT+.

Arduino was not left behind, and now this module has been officially added to the lists of those supported by the board, and accordingly, more and more users will join the Chinese MK for wi-fi connections. But it happens that it is necessary to track the location of the module in the system, for which one esp8266 board will not be enough. This is where the esp8266 sim800l comes in handy.

Smart homes and many DIY products require receiving notification of the board's location, whether it's a remote door or a regular tracker. That's just short list crafts that can be created by combining esp8266 sim800:

  1. Smart home. Almost any smart home technology can be configured to respond to certain patterns when an object approaches. But why install motion sensors if you can simply attach a sim800 to a wi-fi board, sew a microcontroller with a battery into some piece of clothing (fortunately, it doesn’t require a lot of energy) and automatically turn on the light or open the door when the user approaches.
  2. Various tracking devices. We are not talking about illegal bugs and other devices that violate your right to privacy. However, the MK can work separately from the Arduino, and if you attach a sim800 to it, the overall dimensions of the device will not exceed a matchbox. Just wrap it all in metal case and attach to your keys as a keychain. From now on, finding your smartphone, keys, and even your car in the parking lot will be much easier.
  3. Robotics and related areas. Here we can talk for a long time about the development of modern virtual intelligence and neural networks, but often, in order to create a map of the area and navigate it, the hardware does not have enough sensors. And if you are doing something similar, then the GPS module will come in handy. It is especially convenient when paired with drones.

Once you have decided on the ultimate goal of the project, you should understand the nuances of the issue. Connecting devices to the above microcontroller is the same as for standard Arduino boards, the only difference is in the number of available pins. GPS tracker requires 3.7 to 4.2 volts for operation, in contrast to the standard 5 supplied by the microcontroller. This should be taken into account when constructing the board circuit and selecting auxiliary power supplies accordingly. Or install transformers and resistors, depending on what else you will connect to the final system.

When registering in the network, the module will require approximately 2A, but this is its peak consumption and in the future the required current will drop to 1-1.2 A.

As soon as you connect the tracker to the system, you will need to start it and send the first commands; AT and AT+ are best suited. Only after these steps will the module finally begin to send data and respond to your requests, so do not worry if you have connected it, the diode is blinking, but there are no reactions to the scripts. You simply need to activate the Sim800i the first time you use it so it can register online.

Also, you should not consider the Sim800i as an alternative to the ESP8266, which is what many users on the forums do. If you have come across such statements, you can safely say that the author has never worked with Arduino in his life. First of all, comparing an auxiliary board and a microcontroller is pointless. Not to mention that one of the devices is designed to coordinate, send and receive requests via wireless internet, and the second is a GSM GPRS module. Accordingly, they are a good complement to each other, but not an alternative.

Connection diagram for sim800l to esp8266

The pinout is more than standard. Connect the power pin to a source capable of producing a voltage within 3.7-4.2 Volts, or to a transformer. TX goes to the RX pin and vice versa. As soon as you complete the soldering and decide to test the operation of the module by connecting the power source, the diodes will indicate that the connection is correct. Next, all that remains is to activate the module using the method described above, and you will be able to use AT commands for control. If you want to load an auxiliary library or some significant media, you should familiarize yourself with connecting the memory card to the Arduino system.

First, let's test the port speed and module information, for this we will use “AT+IPR?” and "AT+CPAS" respectively. If everything is in order and the information is displayed without errors, then you can continue checking and test the signal level, as well as the operators that the module can see.

The most important thing is that Sim800i allows you to call specified numbers and receive calls, moreover, using basic libraries.

This also opens up scope for the use of systems with its participation. If you want to write a specific script that runs something incoming call, then keep in mind that the module responds to it with the phrase “RING” on the command line.

This functionality allows you to create hundreds autonomous systems control, to the point that instead of fingerprints or key cards, you can open the door by calling a specific number. But, of course, for a good level of protection, it is worth registering a white list of numbers.

An example of the implementation of connecting the gsm module sim800l to the esp8266 microcontroller

After connecting and soldering using the pins described above, the module should start blinking. As soon as authentication occurs on the network, the diodes will blink less frequently.

If the frequency of light signals does not decrease, then you should use AT commands to make sure whether the sim800I has received your network at all. mobile operator and is there any error? Also check the correct pinout and how the SIM card and antenna are installed, there may be an error in them too.

And, of course, bring the system closer to the window, if you are in a multi-story building, it is quite possible that it simply cannot pick up the signal.

Operation