Basics: Project 085a
Project name: Ai Thinker A6 GSM GPRS module review
Tags: Arduino, A6 GSM GPRS module, GSM GPRS module, A6, Ai Thinker
Attachments: A6_AT_Commands sketch, A6smssend sketch, A6smsread sketch, A6makeCall sketch, A6receive call sketch
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
1. Ai Thinker A6 GSM GPRS module 1 pc

2. Arduino IDE ( you can download it from here )
3. USB to TTL/Serial adaptor/converter 1 pc

4. Jumper cables F-F, F-M

5. Micro USB cable 1 pc

6. Micro SIM card 1 pc (unlocked)

7. GSM GPRS antenna 1 pc
8. 5 VDC 2A power wall adapter 1pc
9. Arduino Uno 1 pc

General
We will learn in this project about the Ai Thinker A6 GSM GPRS module.
Understanding the USB to TTL converter
You can read more about them here.
Understanding the A6 GSM GPRS module
With the blooming development of IoT (Internet of Things), more and more people are dedicated to pursue their own IoT dreams. However traditional IoT technologies are mainly evolved on the basis of Wi-Fi features, which leads to a barrier of development related to Geo-limitations that IoT projects cannot be implemented in to outdoors. In light of the popularity of bike-shared system in recent months, GSM Data Communication has been reconsidered as the best choice for outdoor IoT solution.
A6 GSM/GPRS module is a miniature GSM modem, which can be integrated into a great number of IoT projects. You can use this module to accomplish almost anything a normal cell phone can; SMS text messages, Make or receive phone calls, connecting to internet through GPRS, TCP/IP, and more! To top it off, the module supports quad-band GSM/GPRS network, meaning it works pretty much anywhere in the world.
A6 GSM/GPRS module supports dual-band GSM/GPRS network, available for GPRS and SMS message data remote transmission.
The board features compact size and low current consumption. With power saving technique, the current consumption is as low as 3mA in sleep mode.
It communicates with microcontroller via UART port, supports command including GSM 07.07, GSM 07.05 and Ai-Thinker enhanced AT Commands.
At the heart of the module is A6 GSM cellular chip from Ai-Thinker (Manufacturer of ESP8266 WiFi modules). It communicates with a microcontroller over UART and supports baud rate from 1200bps to 115200bps with Auto-Baud detection. All the necessary data pins of A6 GSM chip are broken out to a 0.1″ pitch headers.The module needs an external antenna for any kind of voice or data communications as well as some SIM commands. So, it usually comes with a small duck antenna having 2 dBi gain and 50Ω impedance which provides great coverage even if your project is indoors. Though the module can work on 5V, the operating voltage of the chip is from 3.3V to 4.2V. To keep supply voltage safe at 4.1V, the module comes with a high frequency step-down switching regulator MP1584 from Monolithic Power Systems – capable of handling load currents up to 3A. The module can also be powered through a micro USB connector. You can just grab your cell phone’s wall charger (rated 5V 2A) and power up the module. Any activated, 2G micro SIM card would work perfectly.
Features:
- A6 size : 22.8×16.8×2.5mm
- Working frequency: quad-band network, 850 / 900 / 1800 / 1900MHz
- Working voltage: 4.8-9VDC(On-board voltage regulator circuit supply power for A6 module)
- Working Current: maximum of 2A
- Sleep Current: 5mA
- Supports GPRS data services, the maximum data rate, download 85.6Kbps, upload 42.8Kbps
- Support standard GSM07.07,07.05 AT commend and Ai Thinker extended commands
- Supports 2 serial ports:download a serial port and AT command port;
- AT commands support the standard AT, and TCP/IP command interface
- Support for digital audio and analog audio, support HR,FR,EFR,AMR speech coding
- Communication Interface: TTL serial port / RS232 serial port
- Baud rate: 115200 bps and it can also be set by AT command.
- Interface logic voltage: 3.3V
- Make and answer phone calls using a headset and electret microphone.
- Send and receive SMS messages.
- Send and receive GPRS data (TCP/IP, HTTP, etc.) .
- Pin pitch: 2.54mm
- Onboard antenna interface: SMA and IPX
About the Antenna:
- Suitable for SIM800L GSM modules / Arduino SIM900 GPRS Shield
- Frequency: 780MHz ~ 960MHz 、1710MHz ~ 2170MHz
- Antenna gain: +2.0 ± 0.7 dBi @ 880 MHz, +2.0 ± 0.7 dBi @ 1800 MHz
- S.W.R <= 2.0 @ 2100 MHz ~ 2500 MHz
- Output Impedance: 50 Ohm
- Antenna interface: SMA
Specifications:
- Frequency: Quad Band 850 / 900 / 1800 / 1900 MHz
- Operating Voltage: 4.8 ~ 9V DC
You can find A6 datasheet, manuals, AT commands, schematics here.
Signals and connections of the A6 GSM GPRS module
A6 GPS/GPRS IC pinout:


EN – module power control enable pin (can control power switch, default high level enable)
VCC_IN – External power supply (3.4V-4.2V ) maximum power supply current 2A
PWR – used for turning module ON/OFF programmatically. For doing this you must pull it HIGH for a moment (less than 500 ms or around).
INT – used to control the module to enter low-power mode, high exit low level access, in this mode the standby current <1mA ( in this mode the serial port cannot be used)
GND – ground pin. this module has 2 ground pins
U_RXD – serial port for AT commands (receive pin)
U_TXD – serial port for AT commands (transmit pin)
H_TXD – firmware update pin (transmit pin), pin power level 2.8V
H_RXD – firmware update pin (receive pin), pin power level 2.8V
R232_TX – RS232 level control (transmit pin)
R232_RX – RS232 level control (receive pin)
MIC- – microphone –
MIC+ – microphone+
REC- – loudspeaker –
REC+ – loudspeaker +
Wiring
1. Using Arduino board
Connect U_TXD and U_RXD pin on module to digital pin#3 and #2 on Arduino Uno as we’ll be using software serial to talk to the module. Connect VCC_in pin on module to external power supply rated 5V 2A. Do not be tempted to connect this pin to 5V supply on Arduino, as the module will not work due to the lack of supply current. Now connect all the ground in the circuit.

Connect U_TXD and U_RXD pin on module to digital pin#3 and #2 on Arduino Uno as we’ll be using software serial to talk to the module. You can power up the A6 GSM GPRS module through 5V 2A wall adapter but make sure that GND pin on the Arduino Uno is connected to GND pin on module.

2. Using USB to TTL converter

You should be very careful to not to disconnect the GND before the VCC and always connect GND before VCC. Otherwise the module can use the low voltage serial pins as ground and can get destroyed instantly.
Step by Step instruction
1. Configuring the A6 GSM GPRS module with Arduino board.
- Do wiring.
- Attach GSM GPRS antenna to A6 GSM GPRS module.
- Insert a active unlocked SIM card to SIM card slot of A6 GSM GPRS module.The workings of the SIM card socket can take some getting used to. To unlock the latch, push the top part of the assembly towards micro USB connector, and then lift it up. Place the SIM card into the bottom part of the socket with the SIM’s notch pointing away from the micro USB connector. Then fold the arm back into the body of the socket, and gently push it forward towards the “LOCK” position.
- You can power up A6 GSM GPRS module with external power supply 5VDC 2A through micro USB port, connect VCC_in and GND pin on module to external power supply rated 5VDC 2A. We used the 5V DC 2A power adapter.
- Open Arduino IDE.
- Plug your Adruino Uno board into your PC and select the correct board and com port
- By default this module respond on 9600 bps.
- Verify and upload sketch to your Adruino Uno.
- Open up Arduino IDE Serial monitor and set your baud to 9600 baud and select Both NL&CR.
- First you need to check if AT commands are working – enter “AT” and press Send button.This would print “OK” which signifies of working connection and operation of the module.
- Check the ‘signal strength’ – the first # is dB strength, it should be higher than around 5. Higher is better. Of course it depends on your antenna and location! Enter “AT+CSQ” and press Send button. Returns “+CSQ: 31,99 OK” .
- Get the SIM card number – this tests that the SIM card is found OK and you can verify the number is written on the card. Enter “AT+CCID” and press Send button. Returns “+CCID: 8937002140400149875F OK” .
- Check that you’re registered on the network. The second # should be 1 or 5. 1 indicates you are registered to home network and 5 indicates roaming network. Other than these two numbers indicate you are not registered to any network. Enter “AT+CREG?” and press Send button. Returns “+CREG: 1,1 OK” .
- Requests TA serial number identification. Enter “AT+GSN” and press Send button. Returns “867567021416374 OK” . IMEI 867567021416374
- Requests TA model identification. Enter “AT+GMM” and press Send button. Returns “A6 OK”.
- Requests TA revision identification. Enter “AT+GMR” and press Send button. Returns “V03.05.20170724017H17 OK”. This is the firmware version.
- Requests TA manufacturer identification. Enter “AT+GMI” and press Send button. Returns “Ai Thinker Co.LTD OK”.
- Requests manufacturer specific information about the TA. Enter “ATI” and press Send button. Returns “Ai Thinker Co.LTD A6 V03.05.20170724017H17 OK”.
- Check which network you are connected to. Enter “AT+COPS?” and press Send button. Returns “+COPS: 0,2,”24602″ OK”.
- Return the list of operators present in the network. Enter “AT+COPS=?” and press Send button. Returns “+COPS: (2,”LTBITEGSM”,”LTBITEGSM”,”24602″),(3,”TELE2″,”TELE2″,”24603″),(3,”OMNITELLT”,”OMNI”.
- Reboots the module. Enter “AT+RST=1” and press Send button.
- Call Control Commands. If you call the cell number of Micro Sim Card then message RING will be shown. 1) Answer a call. Enter “ATA” and press Send button. Returns “+CIEV: “CALL”,1 CONNECT”; 2) Make a call. Enter number to call “ATD+37163055289” and press Send button. Returns “ATD+37163055289 OK +CIEV: “CALL”,1 +CIEV: “SOUNDER”,1 “; 3) Disconnect existing call. Enter “ATH” and press Send button. Returns “+CIEV: “CALL”,0 OK”; 4) Insert the headset into the headphone/earphone jack, enter “AT+SNFS=0” and press Send button to enable them. Returns “OK” (“AT+SNFS=1” used for loudspeaker selection).
- SMS Commands. If you send SMS, for example, with Test word to A6 GSM GPRS module you will get this info “+CIEV: “MESSAGE”,1 +CMT: “+3712345678″,,”2020/03/24,15:33:08+02″,145,17,0,0,”+37068499190″,145,4 Test”. AT+CMGF=1 – Selects SMS message format as text. Default format is Protocol Data Unit (PDU), AT+CMGS=+ZZZxxxxxxxxxx – Sends SMS to the phone number specified. The text message entered followed by a ‘Ctrl+z’ character is treated as SMS. ‘Ctrl+z’ is actually a 26th non-printing character described as ‘substitute’ in ASCII table. So, we need to send 26DEC (1AHEX) once we send a message. AT+CNMI=1,2,0,0,0 – specifies how newly arrived SMS messages should be handled. This way you can tell the A6 module either to forward newly arrived SMS messages directly to the PC, or to save them in message storage and then notify the PC about their locations in message storage.
- Check the list of all AT commands here.







2. Configuring the A6 GSM GPRS module with USB to TTL converter
For using this USB to UART Converter you need a software tool. Most of the development tools like MikroC Pro, Arduino has a UART Tool along with it. You can use different software tools: Terminal, USR-TCP232-Test V1.4, AiThinker_Serial_Tool_V1.2.3, coolterm, sscom3.2 , KiTTY, putty,tera term, Access port and so on. We recommend you to use AiThinker_Serial_Tool_V1.2.3 or sscom3.2, as you can save your AT commands and it’s very easy to use.
- Do wiring.
- Plug your USB to TTL converter into your PC USB port.
- Attach GSM GPRS antenna to A6 GSM GPRS module.
- Insert a valid unlocked SIM card to SIM card slot of A6 GSM GPRS module.
- Set the baud rate 9600, data bits 8, parity bits none,stop bits one.
- First you need to check if AT commands are working – enter “AT” and press Send button.This would print “OK” which signifies of working connection and operation of the module.


Expanding Arduino SoftwareSerial Buffer Size
If your message is long and you receive it with some missing characters. This is not because of a faulty code. Your SoftwareSerial receive buffer is getting filled up and discarding characters. You are not reading fast enough from the buffer. The simplest solution to this is to increase the size of the SoftwareSerial buffer from its default size of 64 bytes to 512 bytes (or smaller, depending on what works for you).
On a Windows PC, go to C:\Program Files (x86) -> Arduino -> hardware -> Arduino -> avr -> libraries -> SoftwareSerial (-> src for newer version of Arduino IDE) Open SoftwareSerial.h and change the line:
// RX buffer size
define _SS_MAX_RX_BUFF 64
to
// RX buffer size
define _SS_MAX_RX_BUFF 512
Save the file and try your sketch again.

Summary
We have learnt about the Ai Thinker A6 GSM GPRS module.
Thank you for reading and supporting us.
Libraries:
- SoftwareSerial library included in Arduino IDE. The library has the following known limitations:If using multiple software serial ports, only one can receive data at a time.Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).On Arduino or Genuino 101 the current maximum RX speed is 57600bpsOn Arduino or Genuino 101 RX doesn’t work on Pin 13 The library has the following known limitations: If using multiple software serial ports, only one can receive data at a time;Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69);Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI);On Arduino or Genuino 101 the current maximum RX speed is 57600bps; On Arduino or Genuino 101 RX doesn’t work on Pin 13. You can read about it here.
Project resources:
- See attachments on the beginning of this project description
Check for more DIY projects on Acoptex.lt and Acoptex.com!
If you are looking for high quality PCBs PCBWay is the best choice:

RELATED POSTS
Guide to LILYGO T-SIM7000G ESP32 development board -How to update a firmware
Guide to LILYGO T-SIM7000G ESP32 development board- AT communication
Arduino guide for microphone sound sensor