A6 GSM is introduced by the makers of ESP8266 , AI-THINKER.
The module is much cheaper than SIM900 & connections are quite simple.In this post we shall see how to connect with Arduino to make a call & send SMS.
A mobile adapter is enough to power up the A6 GSM module.The Vcc pin of GSM must be looped with PWR_KEY pin.This acts as a chip enable.You can leave this connected or remove after a moment.The module just requires a HIGH trigger at PWR_KEY pin while started.
A valid SIM is used at the back side of the module.The SIM slot provided is for a Micro SIM.If you ‘ve a Nano SIM you need to use a converter to fit the slot.
The RxD pin of A6 GSM is connected to Tx of Arduino
The TxD pin of A6 goes to Rx of Arduino.
GND pin of A6 to GND of Arduino.
Initial TESTING
Power up the module & then after a moment make a call to the SIM number used in the GSM module from another phone.If you get the RING Back tone , it means the module is ready.As there is no LED indication provided , this initial step is required to confirm working.
Making a CALL
Connect the USB cable of PC to Arduino & upload this code for making a call.Remember to disconnect connections at Rx/Tx before uploading the code.
The mobile number to be called is stored in an Array of char variable.
In the void setup() code we begin Serial communication at 9600 baud.Though the default baud rate of A6 GSM is 115200 , it is effective to use 9600 baud .
ATD command followed by the number to be called is used to make a call.
A semicolon at the end is not a must as in SIM900.The call will be made even if you do not use a semicolon.
After a delay of 8 secs ATH command is sent to terminate the call.
You can open the Serial monitor of Arduino & watch the AT commands landing.You should set the baud rate as 9600 in the Serial monitor as well.
The void loop() function is left empty.In case you try the code inside loop , the call will be repeatedly
made for ever.
Sending SMS
Now let us see the method to send SMS.
Following screenshot shows the code for sending SMS.
DOWNLOAD Arduino code HERE
AT+CMGF=1
which will allow you to read and write SMS messages as strings instead of hexadecimal characters.
Serial.println is used to send the AT command with a New line (Enter).
After a delay of 2 seconds next command
AT+CMGS=”phone_no.”
is sent.The target phone number is to be given within double quotes. Note the usage of
Serial.write(0x22) which is the ASCII equivalent for double quotes.
0D followed by 0A are the ASCII equivalents for CARRIAGE RETURN & LINE FEED.
The delay of 2 seconds is a must after setting the GSM to text mode AT+CMGF=1
Try this code without the delay , you won’t get response.
After the 0D , 0A a delay of 2 seconds is provided & then the message to be sent is given.
CTRL+Z is finally given to send the message.
This is provided by the ASCII equivalent 1A or char(26)
Watch this video :
Hi Saravanan,
New firmware avaialble to Module A6 !
http://wiki.ai-thinker.com/gprs/firmware
http://wiki.ai-thinker.com/gprs_download
http://wiki.ai-thinker.com/gprs/examples
http://wiki.ai-thinker.com/gprs
Click to access a6_product_specification_v1.0.pdf
Thanks a lot for the timely information
Hello! I am really looking foward to make this proyect, I already have the A6 module and a sim card put in it, but when I call the sim number to make sure its working properly it does not ring.
The thing I noticed its that my A6 module its diferent than yours. Does it make any difference?
Thank you for the awesome proyects!
This is the A6 module I have:
http://www.diyelectronics.co.za/store/gsm-gprs/1610-a6-gsmgprs-dev-board-module-with-antenna.html
The A6 module you’ve is functionally same as that I used. A6 GSM needs a hard reset on start up.The RST pin to be momentarily given GND for startup. A6 has very recently published new firmware which confirms flawless operation & includes HTTP AT commands.I’m working on this.Will post on blog soon.
for reset it, i need to disconnect the gnd??
Thanks for sharing your knowledge
Hi Saravana, i have a doubt about how to receive and read a sms. i want to read and sms and reply it with some information. do you have an idea of how do this?
Sir I am very thankful to you , sir I need your help sir can we call at three mobile numbers (instead of one as in your code ) one after other on restting Arduino . Please reply
What is the process for receiving sms?
hello..
I did exactly as u published but its not working…is there any library dat I need to install before it can work?..tanx
I tried the same thing as you didn’t it just sending me back stuff that not English or readable
I even went back and buy the second module it gave me same problem
which command use to print Ctrl z in Serial monitor