Professional Documents
Culture Documents
0 (SKU:TEL0051)
Introduction
This is a GPS/GPRS/GSM shield from DFRobot. This shield with a Quad-band GSM/GPRS engine works on frequencies EGSM 900MHz/DCS 1800MHz and GSM850 MHz/PCS 1900MHz. It also supports GPS technology for satellite navigation. It's possible for your robot and control system to send messages and use the GSM network. It is controlled via AT commands(GSM07.07 ,07.05 and SIMCOM enhanced AT Commands). And the design of this shield allows you to drive the GSM & GPS function directly with the computer and the Arduino Board. It includes a high-gain SMD antenna for GPS & GSM. This GPS/GPRS/GSM shield uses an embedded SIM548C chip from SIMCom.Featuring an industrystandard interface and GPS function, the combination of both technologies allows goods, vehicles and people to be tracked seamlessly at any location and anytime with signal coverage.
Specification
Power supply: 6-12v Low power consumption (100mA@7v - GSM mode) Quad-Band 850/900/18001900MHz GPRS multi-slot class 10 Support GPS technology for satellite navigation Embeded high-gain SMD antennas for GPS & GSM Directly support 4*4 button pad USB/Arduino control switch Size: 70x55mm
Pin Out
More details about switches: Switch S1: PC upload program to Arduino board/PC communicates with GPS/GPRS/GSM Module( Arduino programming/module communication). Switch S2: GPS/GPRS/GSM Module directly connects with PC through USB port or module communicates with Arduino board, which communicates with PC(USB/Arduino serial communication). Switch S3: GPS power supply to be on/off(GPS power switch).
Tutorial
Prepare for Driving the GSM mode
The hardware requirements:
1. Arduino Uno 2. GPS/GPRS/GSM Module V2.0 3. SIM Card 4. Earphone & Microphone 5. External power supply via the power jack it is recommended you to supply 7~12v power via the power jack. When using the GSM mode, the module requires an external power. But the power consumption is not high,just 200mA@7v, when calling.
Module driver pin jumpers: Applying the Module Pin Jumpers(J10-J12) will allocate Pin 3,4,5 for driving the module. Removing the jumpers will release the above Pins, and you could connect the driver pins to the other digital pins on your board to avoid the pin conflict.
Following the steps included in the sketch below first! The Sketch for GSM mode: ?
1 2 3 4 5 6 7 8 9 10 11 12
// # E-Mail : Lauren.pan@dfrobot.com
// # Product name: GPS/GPRS/GSM Module V2.0 // # Product SKU : TEL0051 // # Version : 0.1
// # Description: // # The sketch for driving the gsm mode via the USB interface
// # Steps:
13
// # 1. Turn the S1 switch to the EN(right side) 2. Upload the sketch to the Arduino board 3. Turn the S1 switch to the communication mode(left side) 4. Turn the S2 switch to the USB side(left side) 5. send AT commands via the Arduino Serial monitor
14 15 16 17 18
// # // # // # // #
19 // # 20
21 byte gsmDriverPin[3] = { 22
3,4,5};//The default digital driver pins for the GSM and GPS mode
23 //If you want to change the digital driver pins 24 //or you have a conflict with D3~D5 on Arduino board, 25 //you can remove the J10~J12 jumpers to reconnect other driver pins for the module! 26 27 28 void setup(){
29 30 } 31
InitGsmMode();
32 void InitGsmMode(){ 33 34 35
} //Init the driver pins for GSM function for(int i = 0 ; i < 3; i++){ pinMode(gsmDriverPin[i],OUTPUT);
36 37
digitalWrite(3,LOW);//Enable the GSM mode
38
digitalWrite(4,HIGH);//Disable the GPS mode
39 40 41 42 43 } 44
45 void loop(){ 46 47 } 48 49
delay(100);
Network indication
State Off 64ms On/ 800ms Off The GSM part of SIM548C function The GSM part of the module is not running The GSM part of the module does not find the network
64ms On/ 3,000ms Off The GSM part of the module found the network 64ms On/ 300ms Off GPRS communication
Serial communication
Default baudrate: 9600 Please do some settings as #Recommended settings before connection.If have trouble sending Ctrl+Z, please refers to #Ways to send Ctrl +Z in Coolterm
Serial monitor
The returned data 15,0, the first value 15 means the signal strength is:
Value
Signal Strength
-113dBm or less
-111dBm
2~30 -109~-53dBm
31
-51dBm or greater
99
The later value 0 means channel bit error rate. Signal strength test with external antenna:
Applying the Module Pin Jumpers(J10-J12) will allocate Pin 3,4,5 for driving the module. Removing the jumpers will release the above Pins, Hardware Connection photo:
1 2 3
// # E-Mail : Lauren.pan@dfrobot.com
4 5
// # Product name: GPS/GPRS/GSM Module V2.0
6 7 8 9
// # Description:
10 // # The sketch for driving the gps mode via the USB interface 11 12 // # Steps: 13 // # 14 // # 15 // # 16 // # 17 // # 18 19 20
// # rate:4800) // # 1. Turn the S1 switch to the EN(right side) 2. Upload the sketch to the Arduino board 3. Turn the S1 switch to the communication mode(left side) 4. Turn the S2 switch to the USB side(left side) 5. Turn the S3 switch to the ON side(right side)
5. get the information from the module via the Arduino Serial monitor(ba
For more detail information, please check the product wiki page.~.
21 // # 22
23 byte gsmDriverPin[3] = { 24 25 26 27 28 29
void setup(){ 3,4,5};//The default digital driver pins for the GSM and GPS mode //If you want to change the digital driver pins //or you have a conflict with D3~D5 on Arduino board, //you can remove the J10~J12 jumpers to reconnect other driver pins for the module!
30
InitGpsMode();
31
}
32 33 34 35 36 37 38 39 40 } 41 42 void loop(){ 43 44 45 46
Serial communication Default baudrate: 4800 Coolterm(or Arduino serial monitor) is the recommended serial port terminal application. After serial } delay(1000); } digitalWrite(3,HIGH);//Disable the GSM mode digitalWrite(4,LOW);//Enable the GPS mode void InitGpsMode(){ //Init the driver pins for GSM function for(int i = 0 ; i < 3; i++){ pinMode(gsmDriverPin[i],OUTPUT);
port is successfully connected with PC in Coolterm, GPS module will send out data continuously as below:
For location of the data received, please refer to Location Mapping (GPRMC)
1 2
3 4 5 6 7 8 9 10 11 12
// # Date
: 23.05.2012
// # E-Mail : Lauren.pan@dfrobot.com
// # Product name: GPS/GPRS/GSM Module V2.0 // # Product SKU : TEL0051 // # Version : 0.1
// # Description: // # The sketch for driving the gps mode via the Arduino TTL interface
// # Steps:
13
// # 1. Turn the S1 switch to the EN(right side) 2. Upload the sketch to the Arduino board 3. Turn the S1 switch to the communication mode(left side) 4. Turn the S2 switch to the Arduino side(right side) 5. Turn the S3 switch to the ON side(right side)
14 15 16 17 18 19 20 21
// # // # // # // # // # rate:4800) // #
5. get the information from the module via the Arduino Serial monitor(b
For more detail information, please check the product wiki page.~.
// #
22 23
byte gsmDriverPin[3] = {
24 25 26 27 28 29 30
3,4,5};//The default digital driver pins for the GSM and GPS mode //If you want to change the digital driver pins //or you have a conflict with D3~D5 on Arduino board,
//you can remove the J10~J12 jumpers to reconnect other driver pins for the module!
void setup()
31 32 33 34 35 36 37 38 39
void InitGpsMode(){ //Init the driver pins for GSM function for(int i = 0 ; i < 3; i++){
40
pinMode(gsmDriverPin[i],OUTPUT);
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
}
void loop() { while(1) { Serial.print("UTC:"); UTC(); Serial.print("Lat:"); latitude(); Serial.print("Dir:"); lat_dir(); Serial.print("Lon:"); //get the GPS datas and print them to the Arduino Serial monitor
56
longitude();
57 58
Serial.print("Dir:"); lon_dir();
59 60 61 62 63 64 65 66
} } //
67
{ //*data_bufthe data array //the number of the right of a decimal
68 69
double temp=0.0;
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
if(data_buf[0]=='-')// { i=1; //process the data array while(data_buf[i]!='.') temp=temp*10+(data_buf[i++]-0x30); for(j=0;j<num;j++) temp=temp*10+(data_buf[++i]-0x30); //convert the int type to the float type for(j=0;j<num;j++) temp=temp/10; //convert to the negative number temp=0-temp; }
85
else//for the positive number
86
87 88 89 90 91 92 93
}
94
return temp;
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
char ID()//Match the ID commands { char i=0; char value[6]={ '$','G','P','G','G','A' char val[6]={ '0','0','0','0','0','0' }; };//match the gps protocol
while(1) { if(Serial.available()) { val[i] = Serial.read();//get the data from the serial interface if(val[i]==value[i]) { i++; if(i==6) { //Match the protocol
114
i=0;
121
}
122
}
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
} } if(count==num)//if the command is right, run return return; while(1) { if(Serial.available()) { val = Serial.read(); if(val==',') count++; void comma(char num)//get ',' { char val; char count=0;//count the number of ','
139
}
151
//get the datas after headers
152 153 154 155 156 157 158 159 160 161 162 163 164 165
while(1) { if(Serial.available()) { time[i] = Serial.read(); i++; } if(i==9) { i=0; t=Datatransfer(time,2);//convert data t=t+80000.00;//convert to the chinese time GMT+8 Time zone Serial.println(t);//Print data return; }
166
}
170 {
179
{
180 181 182 183 184 185 186 187 188 189 190 191 192
} } }
193
void lat_dir()//get dimensions
194
{
char i=0,val;
if( ID()) {
206
i++;
221 222
if(ID())
{ comma(4); while(1) {
234
Serial.println(Datatransfer(lon,5),5);//print longitude
return;
241 void lon_dir()// 242 { 243 244 245 246 247 248 249 250
{ if(ID()) { comma(5); while(1) { if(Serial.available()) char i=0,val;
251
val = Serial.read();
261
}
262
}
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
if(alt[i]==',') if( ID()) { comma(9); while(1) { if(Serial.available()) { alt[i] = Serial.read(); }; void altitude()//get altitude data { char i,flag=0; char alt[8]={ '0','0','0','0','0','0','0','0'
279
flag=1;
else i++;
289
}
290
}
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
Serial communication Default baudrate: 4800
Step 1
Step 2: Set message receiver number with command AT+CMGS="Number"(replace Number with your destination number),after pressing <ENTER> key, it will show as follow
Step 2
Step 3: Type in you message content, end with pressing <ENTER> key.
Step 3
Step 4: Send Ctrl character Ctrl+Z to verify your message sending (just pressing Ctrl and Z simultaneously, <ENTER> key is not need after that).If it send out successfully, it will show as below.
Step 4
Then, in the input area, pressing Ctrl+Z will send out the single ctrl character successfully as below:
2. Ctrl characters can also be sent out in their hexadecimal format, in which form 1A is the value of Ctrl+Z:
3.Serial port terminal application send out all the strings on the screen after pressing Ctrl+Z, when trying to send message in GSM USB mode. A: It is possible to send Ctrl characters when the terminal is set to Line Mode. We can choose the Line Mode in options-terminal-terminal mode, or we can send the Ctrl character though sending string box of Coolterm in hexadecimal format. Please refer to Ways to send Ctrl +Z in Coolterm. 4.Restart the serial port terminal application always works for other troubles.