A7 Gprs GSM Gps Shield
A7 Gprs GSM Gps Shield
A7 Gprs GSM Gps Shield
Contents
[hide]
1 Introduction
2 Features
3 Cautions
4 Usage
5 Resource
Introduction
This is a A7 GPRS/GSM/GPS Shield, which is use the newest A7 GSM/GPRS/GPS module, A7 module is a
GSM/GPRS/GPS function module. It supports GSM/GPRS Quad-Band(850/900/1800/1900) network. Also,
it supports voice calls, SMS messages, GPRS data service and GPS function. We can use it make a simple
phone.
The module is controlled by AT command via UART and supports 3.3V and 4.2V logical level.
Model: ACS33042S
Features
Sensitivity <-105;
Support GPRS data traffic, the maximum data rate, download 85.6Kbps, upload 42.8Kbps;
Support digital audio and analog audio support for HR, FR, EFR, AMR speech coding;
SMT 42PIN
Cautions
Make sure your SIM card is unlocked.
The product is provided as is without an insulating enclosure. Please observe ESD
precautions specially in dry (low humidity) weather.
It just supports baud rate 115200bps.
Usage
Hardware installation
1.Insert an Micro SIM card to SIM Card Holder
6 Pin Holder for SIM Cards. Both 1.8 volts and 3.0 volts SIM Cards are supported by A6 GPRS/GSM Shield,
the SIM card voltage type is automatically detected.
3.Plug to Arduino/Crowduino
The A6 GPRS/GSM Shield, like any other well designed shield, is stackable as shown in the photo below.And
connect Arduino to PC by using a USB cable.
Of course not just these functions, you can send some other command to achieve different functions
AT Command Description
AT + CGACT = 1 Activate the network, then you can use the tcp/ip command
AT + CIPSTART = "TCP"
TCPIP server connection
"121.41.97.28", 60000
1. With the A7 GPRS/GSM/GPS Shield removed, download this sketch into your Arduino.
3. Set the Serial Port jumpers on the A7 GPRS/GSM/GPS Shield in SWserial position, to use the Soft
Serial port of Arduino.
4. Connect the antenna to the A7 GPRS/GSM/GPRS Shield and insert the SIM Card.
6. Connect the Arduino to the computer by USB, and fire up your favorite serial terminal software on
computer, choose the COM port for Arduino, set it to operate at 115200.
1. Type command in the terminal to execute different function, threr are 4 functions in the demo:
1. If you input 't', the demo will send a SMS message to another cellphone which you set(you
need set the number in the code);
2. If you input 'd', the program will dial a call to the other cellphone that you set(it is also need
you set in the code );
3. If you input 'h', it will submit a http request to a web that you want to access(it need you set
the web adress in the code), it will return a string from the website if it goes correctly;
4. If you input 's', it will upload the datas to the pachube(for detail you can refer to the
explanation in the code). I strongly recommend you input 'h' before input 's', because
uploading datas to the pachube need do some setting, after execute the function of submit a
http request, the setting will be set.
2. If the program returns error in the terminal after you typed the command, don't worry, just try input the
command again.
#include <String.h>
unsigned char SigQ[50];
unsigned char SigQ1[5]={'a','a','a','a','a'};
int SIGQ=0;
void setup()
{
Serial1.begin(115200); // the GPRS baud rate
Serial.begin(115200); // the GPRS baud rate
delay(500);
// mySerial.println("AT+CPIN?"); //get the signal Quality
// delay(100);
// pinMode(9, OUTPUT);
// digitalWrite(9,LOW);
// delay(1000);
// digitalWrite(9,HIGH);
// delay(1500);
// digitalWrite(9,LOW);
//*******************************************************
//GetSignalQuality();
//*******************************************************
for(int x=0;x<20;x++)
{
GetSignalQuality();
delay(800);
for(int i=0;i<26;i++)
{
if(SigQ[i]==58)
{
int j=0;
int k=0;
i++;i++;
while((SigQ[i+j])!=44)
{
if((SigQ[i+j]>='0'&&SigQ[i+j]<='9')) //>=48 <=57
{
SigQ1[j]=SigQ[i+j];
}
j++; //j=1
}
SIGQ=SigQ1[0]-'0';
if(j==2)
{
SIGQ=SIGQ*10+SigQ1[1]-'0';
}
Serial.println("");
Serial.print("SIGQ:");
Serial.println(SIGQ);
}
}
if ( Serial1.available())
Serial.write( Serial1.read());
if (SIGQ>=10)
{
break;
}
if(x==20)
{
Serial.print("The Signal Quality is poor!");
}
}
delay(2000);
DialVoiceCall();
if ( Serial1.available())
Serial.write( Serial1.read());
}
void loop()
{
//after start up the program, you can using terminal to connect the serial
of gprs shield,
//if you input 't' in the terminal, the program will execute
SendTextMessage(), it will show how to send a sms message,
//if input 'd' in the terminal, it will execute DialVoiceCall(), etc.
// GetSignalQuality();
delay(500);
if (Serial.available())
switch(Serial.read())
{
case 't':
SendTextMessage();
break;
case 'd':
DialVoiceCall();
break;
case 'h':
SubmitHttpRequest();
break;
case 's':
Send2Pachube();
break;
case 'q':
GetSignalQuality();
break;
}
if ( Serial1.available())
Serial.write( Serial1.read());
}
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
Serial1.print("AT+CMGF=1\r"); //Because we want to send the SMS in text
mode
delay(100);
Serial1.println("AT + CMGS = \"+8613016490443\"");//send sms message, be
careful need to add a country code before the cellphone number
delay(100);
Serial1.println("GSM test message!");//the content of the message
delay(100);
Serial1.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
Serial1.println();
}
///DialVoiceCall
///this function is to dial a voice call
void DialVoiceCall()
{
Serial1.println("AT+SNFS=0");
delay(100);
Serial1.println("ATDxxxxxxxxxx;");//dial the number
//mySerial.println("ATD + +8613826558615;");//dial the number
delay(100);
Serial1.println();
}
///SubmitHttpRequest()
///this function is submit a http request
///attention:the time of delay is very important, it must be set enough
void SubmitHttpRequest()
{
Serial1.println("AT+CSQ");
delay(100);
Serial1.println("AT+CGATT?");
delay(100);
ShowSerialData();
ShowSerialData();
ShowSerialData();
Serial1.println("AT+SAPBR=1,1");//setting the SAPBR, for detail you can
refer to the AT command mamual
delay(2000);
ShowSerialData();
delay(2000);
ShowSerialData();
Serial1.println("AT+HTTPPARA=\"URL\",\"www.google.com.hk\"");// setting
the httppara, the second parameter is the website you want to access
delay(1000);
ShowSerialData();
ShowSerialData();
ShowSerialData();
Serial1.println("");
delay(100);
}
///send2Pachube()///
///this function is to send the sensor data to the pachube, you can see the
new value in the pachube after execute this function///
void Send2Pachube()
{
Serial1.println("AT+CGATT?");
delay(100);
ShowSerialData();
ShowSerialData();
ShowSerialData();
ShowSerialData();
Serial1.println("AT+CIPSPRT=0");
delay(3000);
ShowSerialData();
Serial1.println("AT+CIPSTART=\"tcp\",\"api.cosm.com\",\"8081\"");//start
up the connection
delay(2000);
ShowSerialData();
delay(500);
ShowSerialData();
Serial1.println((char)26);//sending
delay(5000);//waitting for reply, important! the time is base on the
condition of internet
Serial1.println();
ShowSerialData();
void GetSignalQuality()
{
void ShowSerialData()
{
while( Serial1.available()!=0)
Serial.write( Serial1.read());
}