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

Miniature GSM/GPRS cellular communication module based on the SIM800L component developed by SIMCom Wireless Solutions. Russian-language version of the SIMCom website. Standard interface control component SIM800L provides access to services of GSM/GPRS networks 850/900/1800/1900 MHz for sending calls, SMS messages and exchanging digital GPRS data. Comes with a built-in antenna, you can also connect 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
Maximum voltage high level UART 2.8 V interface
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
Unstructured data support additional services USSD
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 connection LED blinks mobile operator. Turn on the terminal program on your PC. Data should be entered 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 USB-UART converter, then you can use Arduino UNO. Connect the RX pin of the SIM800L module to pin 11 of the Arduino UNO digital signal 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 to implement 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.

On Russian-language and foreign websites there are texts of 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 controlled contacts, and on the website save the received data in the form of a log.

It’s easy to connect a GSM/GPRS module based on SIM800L yourself. Follow a few steps and use the modern compact element for your purposes.

SimCom Corporation offers users a compact GSM/GPRS module based on SIM800L. The built-in connector allows you to improve the signal. You can also use the antenna that comes with this modular system.

GSM/GPRS module SIM800L - description

Detailed description:

  • The module is powered using external sources or through DC-DC converter systems
  • The range for power supply should be between 3.7V - 4.2V. It is worth noting that 5V from Arduino is dangerous for the operation of the module, as it will lead to its breakdown, and 3.3V will help respond to user commands, but there will be no connection to the network
  • Control occurs via UART, but a voltage divider is used for Rx and Tx so that there is no load on the board
  • The low power consumption of the SIM800L module allows it to be successfully used for battery-powered equipment
  • When power is applied, the module immediately begins searching for a network. When it is found, the LED begins to signal, blinking slowly. The absence of a network is indicated by the same LED, but with the help of a quick blinking light bulb
  • The module supports micro SIM cards 1.8V and 3V

GSM/GPRS module SIM800L - connection

To connect, in addition to the module itself, the converter and the Arduino UNO R3 controller, you will need USB cable, 12V battery and connecting wires. Follow these steps:

  1. First, supply power to the system from the battery via DC-DC: from “minus” the voltage should go to the Arduino at “GND”, from “GND” to the converter element to “minus” at the input
  2. The connection must be made after you configure the module, setting the output voltage in the acceptable range (3.7V - 4.2V)
  3. Connect all contacts that come from the converter to SIM800L, observing the polarity
  4. Connect the TX and RX pins on the module to the 2nd and 3rd digital pins, respectively, on the Arduino

Important: If you need to connect two or three modules to the Arduino, then use other codes, writing them in the sketch via SoftwareSerial.

The following video clearly shows how to connect the SIM800L module to Arduino.

Video: Connecting the SIM800L GSM module to Arduino


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 most items on and off household appliances in the house, such as llama, fan and so on.

Characteristics of the SIM800L V.2 GSM/GPRS module

Below are all 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)

Necessary materials

Hi all! It's been a while since we talked about GSM. So, let's begin. Dear Chinese, they have launched a new budget module called SIM800L. Yes, yes, this module is produced by their own company SIMCOM. At first I was afraid to test it, they say it doesn’t exist in the vastness of Russia and there is no guarantee that this module will work with our networks. I didn’t want to deal with flashing from another module, but I was just wonderfully lucky to kill two cockroaches with one slipper. I completely forgot about the wonderful ChipResistor store, which happily provided me with this module to be torn to pieces.
This is what this miracle looks like.

Not a lot, the board contains the module itself, a holder for a microSIM, tantalum, a couple of ceramics, a resistor and an LED. Oddly enough, the Chinese are positioning this module as a shield for Arduino. The Arduino seems to be powered by 5 volts and most often from USB, and if my memory doesn’t let me down, then the SIMcom modules consume from 3.6V to 4.2V and at the same time they want 2A at the peak. Well, okay, I connect it to the debug board and... Chinese!!! Anything to make it cheaper. This module does not work at 5 volts. My memory did not let me down. In short, you can talk for a long time about how to power it, but I will show you one wonderful device that can easily solve this problem. You can buy it in the same place as SIM800L, namely in ChipResistor. The module is a step-down pulse generator up to 3A.

Next, take this module and solder the input and output wires. We connect the loan to the toaster and set it to 4 volts.

Here is the diagram, top view.

My chaos looks like this.

We check for short, insert the SIM card, connect USB-RS232 and power. If nothing smokes and the LED on the module blinks, then everything is in order. Next, launch some terminal, I have PuTTYn and issue the first command AT. In response if received OK it means everything is working.

Bingo! Next we throw AT+COPS? and if you receive your operator in response, then to secure it, call yourself by typing the command ATD89161234567;. Semicolon is required! If the module gets through, it means it works with our networks. I tested it on a beeline. If I now say that this is all, then they will throw eggs and tomatoes at me, but I don’t want that))) So let’s put something useful out of this. For example, an alarm. Let's screw the module to the MK and monitor the condition of a couple of legs. As soon as changes appear on the leg, we will immediately send an SMS notifying you of this change. ATmegs32a will act as the MK. We will screw the buttons onto the legs of PB2 and PB3. The buttons have a common GND, and for pull-up we use built-in resistors. To work with the module, we will write a couple of functions, namely initialization and SMS transmission. Well, let's go.

First, let's configure the project using the axlib code generator. To do this, select the ATmega32 MK, external quartz at 7372800 (such quartz is needed to reduce errors during transmission via UART). Let's configure the UART at a speed of 9600. Next, having generated the project, open it in AtmelStudio 6. First of all, let's create a file sim800l.h in the root of the project and connect it. #include #include "main_init.h" #include "axlib/usart.h" #include "sim800l.h" Now we go to our created file and enter the definitions we need there. // First command, response OK#define SIM800L_AT_AT "AT" // Command to enter a subscriber's number to send him an SMS message#define SIM800L_AT_SMS "AT+CMGS=\"" // Setting up the packet format#define SIM800L_AT_SMS_SET "AT+CMGF=1" Ok, we wrote down the definitions to simplify things, now we are writing a complex initialization function. void sim800l_init(void) ( usart_str_rn(SIM800L_AT_AT); ) The whole complexity of this function lies in the fact that we simply transmit the command to the AT module. The module should start working with this command. The next function is a little more complicated. BYTE sim800l_send_sms(BYTE *num, BYTE *text, BYTE lenght) ( // Array for receiving responses from the module BYTE str = (0); _delay_ms(1000); // Setting the transfer mode usart_str_rn(SIM800L_AT_SMS_SET); // Submitting the subscriber's phone number usart_str_out(SIM800L_AT_SMS, 9); usart_str_out(num, 12); usart_str_rn("\""); // Wait for text input to begin _delay_ms(3000); // Send text usart_str_out(text, length); str = 0x1A; str = 0; usart_str_rn(str); // Wait for OK usart_str_in(str, 18); if(!((str == 0x4F) & (str == 0x4B))) return 0x34; return 0x30; ) This is where I realized the essence of how cheap this module is. This thing completely refused to consistently return answers. As much as I could not pervert, I set gigantic timeouts for the arrival of data, and created delays. In short, I spat on those answers that floated in time and encountered delays. This doesn't interfere much with work. We pay for cheapness. Let's go to the function. First of all, we click on the packet transmission setting. This is necessary for the module to send data after receiving a phone number, and then wait for the text to be accepted. Then we transfer the phone number of the subscriber to whom we send the SMS. We take it from the argument of this function. There is one thing! The phone number must have the following format: +79161234567. +7 is required, this module, unlike the 900s, does not understand 8. After transmitting the subscriber’s number, we simply pause for 3 seconds. All this time, the module slowly chews the number and, who the hell knows what algorithm, I was blown up by these delays, gives us an invitation to enter text with an icon > 3 seconds are enough to chew and spit out the invitation. After 3 seconds we send the message text. We also take it from the argument of this function and from there the text length for UART functions. After all, we don’t know how many letters you are going to send. If you look closely, you can see the byte 0x1A at the end of the message text. This is the team Ctrl+Z needed to complete text transmission. When the module receives this command, it will drop everything and send an SMS. That's it, we're done with this file, let's go to the main program file. #define BUTTON_1 "Nazhata knopka 1" #define BUTTON_2 "Nazhata knopka 2" // Initialize the GSM module sim800l_init(); // Configuring I/O ports for reading DDRB = 0x00; // Turn on the pull-up with an internal resistor PORTB |= (1 // If you pressed button 1 if(!(PINB & (1 // Wait until the button is released while(!(PINB & (1 // If you pressed button 2 if(!(PINB & (1 // We wait until the button is released while(!(PINB & (1 What do we see here? Two definitions with pre-prepared text. Then we initialize the module. Then we configure pins 2 and 3 of port B to the input and pull up the internal resistor to the power positive. Then, in an endless loop, we check for button presses. As soon as any of the buttons is pressed, we immediately fall into an endless loop and wait until the button is released. After the button is released, we call the function of sending SMS with pre-defined text. That's all.))) I won't post the project because it can be generated by the axlib generator and the text can be copied and pasted from here. Oh yes, that's what I received on my phone.))


Fyva 09.10.16 23:29

According to mt-system, the 800 series is the successor to the 900 series, which is supposedly being phased out by the end of 2016. Therefore, it is quite strange to read about such annoying jambs as clenched answers.
Maybe there's something new in the Danish? Or did you throw commands purely by analogy with 900, without really lighting up?

Alexey 09.10.16 23:39

These pauses alerted me even when I was communicating with her through the terminal. I thought the port was slow, but the same song was playing on the laptop.

Yuri 03/05/17 20:36

Tell me how to make the module, upon USSD request, send the balance, read and set the Avrki level on the legs. In general, I want to make a “Smart Home” Thank you

Alexey 03/06/17 12:36
Oleg 03/28/17 02:43


\n is transmitted, is this necessary to work with the simmodule or just in case?
What does the /" symbol do here?

#define SIM800L_AT_SMS "AT+CMGS=\""

usart_str_out(SIM800L_AT_SMS, 9);
usart_str_out(num, 12);
usart_str_rn("\"");
here too /" /r /n
why can’t usart_str_rn (AT+CMGS="+7xxxxxxxxxx") be done at once, like in the terminal?
AND

usart_str_out(text, length);
str = 0x1A; I see
str = 0; why zero?
usart_str_rn(str); and also /r /n?

Alexey 03/28/17 12:33

-->What does the /" symbol do here
The \ character is placed before service characters in order to turn these characters into simple ones. The fact is that the double quote is a service character. It is used to pass a string into an array. And in order for the compiler to read it exactly as a symbol, a backslash is placed before the service symbols.
Example:


BYTE data = "Some text \"Text in quotes\"";

Now the inner quotes will be written to the array as characters.

--> why can’t usart_str_rn (AT+CMGS="+7xxxxxxxxxx") be done at once, like in the terminal?

Because the function takes as an argument a pointer to the first element of the array with the subscriber number. If you write immediately, then SMS will be sent forever only to this subscriber. And you can only change it by rewriting the code.

--> Please explain. Why in the function usart_str_rn
is transmitted\n

Because the documentation for the SIMCOM module requires entering the line end and carriage return code at the end of the command.

Oleg 03.28.17 14:05

Thank you, Alexey realized this, I have a problem with the transmission of 1A, there is no combination with \... in the table of service symbols.

Alexey 03/28/17 15:04

What should the Ctrl+z symbol look like? Or for example space, tab. Therefore, it is transmitted precisely by code. For example, \r\n can be written as two bytes 0x0D, 0x0A. It is the same.

Oleg 03.28.17 16:59

I understood this, the command went like this


str = 0x4D;
str = 0x4B;
str = 0x4D;// three letters text for the test.
str = 0x1A;
str = 0;
usart_str_rn(str);
, I can probably use the text as a string, but 1A is obtained only through an array, is it somehow impossible?

Alexey 03/28/17 17:14

void usart_char_out(BYTE data)

It simply sends one byte to the port.

Evgeniy 05/07/17 17:47

BYTE sim800l_send_sms(BYTE *num, BYTE *text, BYTE lenght)
{
// Array for receiving responses from the module
BYTE str = (0);
further source
// Wait for OK
usart_str_in(str, 18);
if(!((str == 0x4F) & (str == 0x4B))) return 0x34;
Where did the 14th and 15th index in the array come from if it is declared explicitly by str ?

Alexey 05/07/17 20:05

But I’m such a felt boot. The array is not 10 cells, but 20)))

Evgeniy 05/08/17 20:13

It happens)) So I realized that it was a typo. I started writing my code, took it as a basis and just immediately saw

Alexey 05/08/17 21:34

I advise you to use SIM800C instead of L. Same money but C has a bluetooth in the module.

Evgeniy 05/12/17 06:43

Yes, I just have 800C modules. Alexey, after reading, str is empty, what could be the problem? Commands to the module are sent and the module responds (checked by a log analyzer), but str is empty
// Wait for OK
usart_str_in(str, 18);
if(!((str ==

Evgeniy 05/12/17 18:57

Alexei. I figured out what the problem was, the usart_str_in function accepted 18 bytes, and the module responded with only 9 bytes, so the function perceived this response as a timeout. (BYTE usart_str_in(BYTE *str, BYTE count)
{
BYTE out = 0;
BYTE data = 0;
BYTE timeout = 0;

While(count > data) // here for now 18>9 - timeout
{
data = GetData();

// If no data has arrived within 250 ms
// then exit the function and return 0
if(timeout >= 250)
{
ClearBuffer();
return out;
}

Timeout++;
_delay_ms(1);
}

Out = OutBufferStr(str, count);
return out;
}
But what if you don’t know how long the answer will be?

Alexey 05/12/17 20:03

Poll the buffer to receive more than one byte, and then, after waiting, subtract the entire packet from the buffer.

Evgeniy 05/12/17 20:21

Alexey, I didn’t quite understand the idea, please explain

Alexey 05/12/17 20:58


main()
{

// Number of bytes received into the buffer
BYTE len_pocket = 0;

// Array for data
BYTE data = (0);

while (1)
{
// See what's in the buffer
len_pocket = usart_data();

// Check if anything has arrived in the buffer
if (len_pocket > 0)
{
// If it arrives, wait
// pause calculation (1000/(bitrate/10)) * max byte.
// Example bitrate 19200, max byte 40. (1000/1920) * 40 = 20.8ms

// Pause to ensure all bytes are received
_delay_ms(22);

// Get the number of bytes received
len_pocket = usart_data();

// Write data to the array
usart_str_in(data, len_pocket);

// Now the data array contains all the received bytes.
}
}
}

Evgeniy 05/12/17 21:25

Alexey, thank you, I clearly understood the idea, I’ll try it. I also wanted to ask about the two slaves and the master, regarding the loss of connection when the line is pulled off, have you tried prototyping?

Alexey 05/12/17 22:18

Not yet. A lot of work. I actually started visiting the site because of her.

Oleg 07/08/17 23:28

Alexey, tell me how to coordinate the levels if the microcontroller is powered by 5V and the module is 3.3V? I found a KIS-3R33S power module on Ali, it has output control, does it make sense to reboot the SIM module by removing the power, or will a reset and the module enable pin be enough?

Alexey 07/09/17 12:28

Firstly, to match with the module you need not 3.3V, but 3V. To do this, it is enough to install a resistive divider, where the RXD MK will be at the input of the upper arm resistor, and the lower arm resistor is connected to the common signal.
Secondly. You can attempt a reboot by jerking the power supply if the module is frozen. If the module is working, then this is absolutely forbidden, as this can lead to killing the firmware in the module. The restart must be done by jerking the leg with the PWR or AT command.

Oleg 07/09/17 12:44

Thank you, the first one is clear.
According to the second, such a hard reset is planned if the module does not respond and tugging rst and pwr does not produce results, by the way, there are PCB modules without pwr or without rst, the question is what about the firmware when turning off the power of the entire device, are there any recommendations?

Alexey 07/09/17 14:48

This is a Chinese bug. Solder to the contacts. The Chinese don’t worry too much, they don’t even always manage food correctly. If only it were cheap.

Oleg 07/09/17 15:05

And when the module hangs, should you first pull pwr or rst, and if pwr and resetting does not help, how can you change the power supply correctly?

Alexey 07/09/17 19:29

If it freezes tightly, then simply remove the power for three seconds. And then submit and initialize according to the rules.

Igor 09.12.19 19:21

Tell me how to transfer the number without quotes to the MC52i modem
// Submitting the subscriber's phone number
usart_str_out(SIM800L_AT_SMS, 9);
usart_str_out(num, 12);
usart_str_rn(""");

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 different types of modules, the most commonly used are SIM900, SIM800L, A6, A7.

Description of the SIM900 module

The 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 an 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

As usual, before you start, here are some 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 questions GSM connections– modules for 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 special teams for a 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 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. Answer +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. For different modules commands may vary slightly. 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 AT+CSCS="GSM" command. 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. Next step will 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\” – choice 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.

Our review of neural network text generators: https://traff.ink/services/geeneratori-texta/