You are on page 1of 28

GPS/GPRS/GSM Module V2.

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

GPS/GPRS/GSM Module V2.0 (SKU:TEL0051)

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.

Hardware Connection photo:

TEL0051 Hardware connection

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

// # // # Editor // # Date : Lauren from DFRobot : 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 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

wiki link- http://www.dfrobot.com/wiki/index.php?title=GPS/GPRS/GSM_Modu

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

//Output GSM Timing digitalWrite(5,HIGH); delay(1500); digitalWrite(5,LOW);

45 void loop(){ 46 47 } 48 49
delay(100);

How to drive the GSM Mode via USB port


1. If your module works, the indicator LEDs beside the switch S2 will light up, this means that the module is running correctly. The LED marked "NET" is used to drive a network status indication LED. The working state of this LED is listed below. 2. Send the AT commands to the module by using Coolterm(or use the Arduino serial monitor). Note: If you want to program the Arduino, please disconnect the coolterm to release the communication port.

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

GSM module signal strength test


Signal strength test with on-chip antenna: Sending AT command for signal quantity report AT+CSQ through serial port terminal application, will receive signal strength as below.

GSM module signal strength test with on-chip antenna

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

not know or not detectable

The later value 0 means channel bit error rate. Signal strength test with external antenna:

GSM module signal strength test with external antenna

Types of AT commands and responses


1. AT+<x>=? : Test command The mobile equipment returns the list of parameters and value ranges set with the corresponding Write command or by internal processes. 2. AT+<x>? : Read command This command returns the currently set value of the parameter or parameters 3. AT+<x>=<..> : Write command This command sets the user-definable parameter values. 4. AT+<x> : Execution command This execution command reads non-variable parameters affected by internal processes in the GSM engine

Commonly used AT commands


1. AT : Test the serial communication.if it works,get "ok" as the picture show. 2. ATD<num>; : Dial a number 3. ATA : Answer an incoming call 4. ATH : Disconnect existing connection 5. AT+UART : Configure dual serial port mode 6. AT+CSQ : Signal quality report 7. AT+CMGF : Select sms messages format 8. AT+CMGS : Send sms message 1. After you input the sms, press 'ctrl-z'[HEX:0x1A]to send the message. 2. Press 'ESC' to quit without sending. 9. AT+CNMI : New sms message indications 10. AT+CLVL : Loud speaker volume level 11. AT+CRSL : Ringer sound level 12. AT+CMIC : Change the microphone gain level For more detail AT commands, please check the document here!

Prepare for Driving the GPS mode


The hardware requirements: 1. Arduino Uno 2. GPS/GPRS/GSM Module V2.0 3. External power supply via the power jack We recommend you to supply 7~12v power via the power jack. When using the GPS mode, the module requires an external power. But the power consumption is not high, just 200mW@3.3V 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, Hardware Connection photo:

How to drive the GPS Mode via USB port


1. After turn switch s3 on (the right side), the GPSPWR led will be lit. 2. In this mode, switch s2 is on left side. The GPS module communicates directly with PC. The serial port terminal application will show the data sent out by GPS module. The Sketch for GPS USB mode: Following the steps included in sketch below first! ?

1 2 3

// # // # Editor // # Date : Lauren from DFRobot : 23.05.2012

// # E-Mail : Lauren.pan@dfrobot.com

4 5
// # Product name: GPS/GPRS/GSM Module V2.0

6 7 8 9

// # Product SKU : TEL0051 // # Version : 0.1

// # 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

Wiki link - http://www.dfrobot.com/wiki/index.php?title=GPS/GPRS/GSM_Mod

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:

Serial monitor in GPS mode via USB port

For location of the data received, please refer to Location Mapping (GPRMC)

How to drive the GPS Mode via Arduino board


1. After turn switch s3 on (the right side), the GPSPWR led will be lit. 2. In this mode, switch s2 is on right side. The GPS module communicates with Arduino board, and Arduino board communicates with PC. The serial port terminal application will show preliminary processed data from Arduino board, which gets the data from GPS module. The Sketch for GPS mode via Arduino board: Following the steps included in sketch below first! ?

1 2

// # // # Editor : Lauren from DFRobot

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.~.

// #

wiki link - http://www.dfrobot.com/wiki/index.php?title=GPS/GPRS/GSM_Mo

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

{ InitGpsMode();//Init the module to the GPS mode

Serial.begin(4800);//Init the serial baudrate Serial.println("$GPGGA statement information: "); }

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
}

} digitalWrite(3,HIGH);//Disable the GSM mode digitalWrite(4,LOW);//Enable the GPS mode

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
} } //

Serial.print("Alt:"); altitude(); Serial.println(' '); Serial.println(' ');

double Datatransfer(char *data_buf,char num)//convert the data to the float type

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

unsigned char i,j;

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
}

i=0; while(data_buf[i]!='.') temp=temp*10+(data_buf[i++]-0x30); for(j=0;j<num;j++) temp=temp*10+(data_buf[++i]-0x30); for(j=0;j<num;j++) temp=temp/10 ;

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

115 116 117 118 119 120


} } else }

i=0; return 1;//break out after get the command

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
}

140 141 142


void UTC()//get the UTC data -- the time {

143 144 145 146 147 148 149 150

char i; char time[9]={ '0','0','0','0','0','0','0','0','0' }; double t=0.0;

if(ID())//check ID { comma(1);//remove 1 ','

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
}

167 168 169


}

void latitude()//get latitude

170 {

171 172 173 174 175 176 177 178

char i; char lat[10]={ '0','0','0','0','0','0','0','0','0','0' };

if( ID()) { comma(2); while(1)

179
{

180 181 182 183 184 185 186 187 188 189 190 191 192
} } }

if(Serial.available()) { lat[i] = Serial.read(); i++; } if(i==10) { i=0; Serial.println(Datatransfer(lat,5),5);//print latitude return; }

193
void lat_dir()//get dimensions

194
{

195 196 197 198

char i=0,val;

if( ID()) {

199 200 201 202 203 204 205

comma(3); while(1) { if(Serial.available()) { val = Serial.read(); //Serial.println(val,BYTE);//print dimensions Serial.println(val);//print dimensions

206
i++;

207 208 209 210 211 212 213 214 215 }


} }

} if(i==1) { i=0; return; }

216 void longitude()//get longitude 217 218 219 220


}; { char i; char lon[11]={ '0','0','0','0','0','0','0','0','0','0','0'

221 222
if(ID())

223 224 225 226

{ comma(4); while(1) {

227 228 229 230 231 232 233

if(Serial.available()) { lon[i] = Serial.read(); i++; } if(i==11) { i=0;

234
Serial.println(Datatransfer(lon,5),5);//print longitude

235 236 237 238 239 } 240


} } }

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();

252 253 254

//Serial.println(val,BYTE); Serial.println(val); i++;

255 256 257 258 259 260


}

} if(i==1) { i=0; return; }

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;

280 281 282


}

else i++;

283 284 285 286 287 288


}

if(flag) { i=0; Serial.println(Datatransfer(alt,1),1);//print altitude data return; }

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

Serial monitor in GPS mode via Arduino board

Tips for Coolterm usage


Recommended settings
Settings below is recommended

Recommended Coolterm settings

How to send out text message in GSM mode via Coolterm


After the network indication LED showing GSM module has found the network, we can use it to send out message. Setp 1: Set the system to text mode(as opposed to PDU mode) with command AT+CMGF=1(type "AT+CMGF=1" in the input line, then press <ENTER> KEY), you will get response as below.

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

Ways to send Ctrl +Z in Coolterm


1. After typing the message text, press enter key, it will show:

'Enter' after text finished

Then, in the input area, pressing Ctrl+Z will send out the single ctrl character successfully as below:

After press Ctrl+Z

2. Ctrl characters can also be sent out in their hexadecimal format, in which form 1A is the value of Ctrl+Z:

Sending Ctrl+Z with in hexadecimal format

FQA about coolterm usage in GSM/GPRS/GPS module V2.0


1.Serial connection errs. When connecting to PC, serial port terminal application occasionally warns A Serial Port Err Occur 103: No Stop Bit Received or A Serial Port Err Occur 104: stop bit received too early A: set Coolterm in options-receive-ignore receiving signal err to ignore connection err and it will reconnect automatically. 2.Serial port terminal application warns Normal power down when reconnect after disconnect, and Network indication LEDs both turn off. A: Choose disconnect, and connect again The Arduino board will reset at every connection to PC. During resetting, the Arduino board will emit a low pulse to pin PWRKEY of GPS module. So if GPS module is already on before connection, the low pulse will switch it off, if not, the pulse will switched it on.

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.

You might also like