Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] GPS location using SIM908

Status
Not open for further replies.

v57ali

Newbie level 5
Joined
May 10, 2011
Messages
10
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,283
Activity points
1,369
hi dear
I have a sim908. I need to read GPS location from it but i can't.
Is there any one to help me?
I wrote at+cgpspwr=1 and at+cgpsrst=0 to power on GPS but there is only these commands in GPS/debug PORT (serial port):
Code:
$GPGGA,010142.000,,,,,0,0,,,M,,M,,*4E
$GPGLL,,,,,010142.000,V,N*7C
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,16,,,41,23,,,41*7D
$GPRMC,010142.000,V,,,,,,,101010,,,N*4A
$GPVTG,,T,,M,,N,,K,N*2C

There is no information about gps location, i connected GPS-VANT-IN to GPS-VANT-IN and i connected the gps antenna by the connector on left top part of the module.
Is there anything wrong?
Thank you in advance
 

Did you solve your problem ?
The usual problem in this modules are power source stability, just use a good power source (celphone battery for example).
Maybe that's why the GPS doesnt connect to the satellite.
The other thing is the antenna and the visibility.
If you have a small GPS antenna, then you need to try the connection in the open (not inside your home or working place).
Hope it helps
Rod
 

Yes i solved my problem.
My antenna needs 5v power supply and i had connected to 2.8V of GPS-VANT-OUT.
Thank you very much for your attention and help
vahideh
 

Oh Great...
Congratulations.
If it's no too much to ask, could youshare your schematic with me ?
So i can compare and maybe find my problem ?
Thank you veeery much
Rod
 
The schematic is very simple and i do not have time to put it here.
If you have a question about your problem, ask your question. If i can, i will answer.
Vahideh
 

Hi
This is my schematic.It can be useful for all.
sim908_schematic.JPG
 
dear v57ali ,

Could you please post a much clearer picture?
I am also a newbie to this sim world and I have to use SIM908.
also if you have any meterial such as pdf, any good links that would teach me how to use this module pls share here.
if you cannot attach anything to this post pls email me
amalinda.gamage at gmail dot com
thank you so much
 

Can anyone please tell me how to give power to an Active antenna in SIM908 ? in i provide 3.6V to GPS VANT IN then does that power go to GPS Antenna connected to UFL connector by default?
 

Can anyone please tell me how to give power to an Active antenna in SIM908 ? in i provide 3.6V to GPS VANT IN then does that power go to GPS Antenna connected to UFL connector by default?

yes if your active antenna's voltage is between 3 ~ 5 v, you can use 3.6V power to GPS-VANT-IN in sim908 and that is enough. you can see the strings received from GPS satellite in GPS_TXD (GPS NMEA information output) by computer in hyper terminal (by a RS232 convertor)

But first of all, you must connect your computer or microcontroller to RXD and TXD (serial port) of sim908 and then if there is a connection between them, write these AT commands to power on GPS : AT+CGPSPWR=1 and AT+CGPSRST=0, after a few minutes (about 30 minutes for first time initializing) you can receive the right strings
 
Last edited:
may I know what is then the GPS VANT OUT? Do I have to manually connect that pin to the antenna? and if yes, where? thank you.

edited : what i meant is , Suppose I directly connect GPS VANT IN to the VBAT terminal then does that mean my GPS Antenna connected to the UFL connector gets that power? Or do I have to manually apply that voltage to the Antenna? (does the UFL connector receive GSM signals as well as send power to the GSM Antenna too? )
 

GPS-VANT-OUT is 2.8V output for GPS active antenna. if your active antenna's voltage is less than 3v, you can use GPS-VANT-OUT. In this case, you must connect GPS-VANT-OUT to GPS-VANT-IN manually and you do not need any other voltage to power GPS active antenna only you need to connect your GPS antenna to sim908 from above the module (GPS antenna connector)
please refer to sim908_hadware datasheet.
 
thank you so much for your reply. I am currently reading the SIM908 Hardware Design manual and doing it. this is my first design. it doesnt really tell me how that DC power goes through the GPS-ANT wire to the Antenna. Is it more like constant DC shift and on top, the RF signal comes? I mean there is only one wire going to the Antenna and the GND. So how exactly does this DC voltage would be taken to the SIM908?
Please help.
 

Hi everyone,
Please help me.
I am making project about SIM908 reading location, after that send to PIC16f887 to show data on LCD. And logitude and latitude I read through GSM pin( TXD and RXD) by "AT+CGPSINF=0".
But when the data shows on LCD, it doesnt ASCII code. Although, Command to PIC send to SIM which understood.
I dont see. May be, code to SIM send back does ASCII code????
sory my english very bad
Please help me!!
Thank a lot
 

Thanks, Zia
Here, please help me, thanks a lot

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include <16f887.h>
#device  adc=8
#include <string.h>
 
#fuses   NOWDT,XT,NOPROTECT,NOCPD,MCLR,NOLVP,NOCPD,NOBROWNOUT,NODEBUG,NOWRT
#use     delay(clock=4000000)
#use     rs232(baud=9600,parity=N,xmit=pin_c6,rcv=pin_c7,bits=8)             
#use     fast_io (c)
#use     fast_io (b)
#use     fast_io (e)
 
#define  pwr         pin_d5
#define  rs          pin_d6
#define  e           pin_d7
#define  rev         pin_e0               
#define  sen         pin_e1               
#define  lcd         output_b
#define  buffer_size 95
 
void  Setup_lcd();                              
void  data_write(unsigned char data);  
void  command_write(unsigned char cmd);
void  Welcom();                        
void  Sim908();                        
void  erase_buffer();                  
void  erase_local();                  
int1  wait_ok (void);                  
void  read_local();                    
void  gps_lcd();                       
 
char           buffer[buffer_size];
char           string[20],longitude[12],latitude[11],sms_kv[24];
char           kitu=0x00;
int            xbuff=0;
 
//============================================================================//
#INT_RDA
RDA_isr()
{
   output_high(rev);
   buffer[xbuff]=getc();
   output_low(rev);
   xbuff++;
   if(xbuff>=buffer_size)   {disable_interrupts(INT_RDA);xbuff=0;}
   return 0;
}
//============================================================================//
void  Setup_lcd()
{
   output_low(e); output_low(rs);   
   command_write(0x38);
   command_write(0x0c);
   command_write(0x01);
   command_write(0x06);
   delay_ms(2);
}
//============================================================================//
void  data_write(unsigned char data)
{
   lcd(data);
   output_high(rs);  
   output_high(e);   delay_ms(2);
   output_low(e);    delay_ms(2);
}
//============================================================================//
void  command_write(unsigned char cmd)
{
   lcd(cmd);
   output_low(rs);   
   output_high(e);   delay_ms(2);
   output_low(e);    delay_ms(2);
}
//============================================================================//
void  show(unsigned char row,unsigned char colum,char s)
{
   switch(row)
   {
      case 1:  command_write(0x80+colum);
               break;
      case 2:  command_write(0xc0+colum);
               break;
      case 3:  command_write(0x94+colum);
               break;
      case 4:  command_write(0xd4+colum);
               break;
   }
   while(*s)
   {
      data_write(*s);   s++;
   }
}
//============================================================================//
void  Welcom()
{
   output_high(rev); output_high(sen);
   strcpy(string,"MY UNIVERSITY");
   show(1,0,string);
   strcpy(string,"KHOA DIEN-DIEN TU");
   show(3,2,string);
   output_low(rev);  output_low(sen);
   delay_ms(2000);
   
   output_high(rev); output_high(sen);
   command_write(0x01);     delay_ms(2);          
   strcpy(string,"PROJECT");
   show(1,2,string);
   strcpy(string,"SIM908");
   show(3,1,string);
   output_low(rev);  output_low(sen);
   delay_ms(2000);
   
   output_high(rev); output_high(sen);
   command_write(0x01);    delay_ms(2);             
   strcpy(string,"GUIDER");
   show(1,0,string);
   strcpy(string,"MR.:");
   show(2,8,string);
   strcpy(string,"CONAN");
   show(4,3,string);
   output_low(rev);  output_low(sen);
   delay_ms(2000);
   
   output_high(rev); output_high(sen);
   command_write(0x01);    delay_ms(2);            
   strcpy(string,"AUTHOR");
   show(1,1,string);
   strcpy(string,"KAITOOKID");
   show(3,0,string);
   output_low(rev);  output_low(sen);
   delay_ms(2000);
   
   output_high(rev); output_high(sen);
   command_write(0x01);    delay_ms(2);           
   strcpy(string,"PRỌECT");
   show(1,2,string);
}
//============================================================================//
void  Sim908()
{
   output_low(rev);  output_low(sen);
   strcpy(string,"WELCOM TO GPS SIM908");  show(2,0,string);
   delay_ms(3000);
   strcpy(string,"                    ");  show(3,0,string);
   strcpy(string,"CONFIG FORMATING...");   show(3,0,string);
   erase_buffer();
   
   do
   {  output_high(sen);
      printf("AT");  putc(13);               
      output_low(sen);
      delay_ms(1000);
   }while(wait_ok()==0);
   
   output_high(sen);
   printf("ATE0");  putc(13);              //Turn off Echo
   output_low(sen);
   delay_ms(1000);
   
   output_high(sen);
   printf("AT+CMGF=1");  putc(13);           //Fomat Data
   output_low(sen);
   delay_ms(1000);
   erase_buffer();
   
   output_high(sen);
   printf("AT+CGPSPWR=1");  putc(13);        //Power on GPS
   output_low(sen);
   delay_ms(1000);
   erase_buffer();
  
   output_high(sen);
   printf("AT+CGPSIPR=9600");  putc(13);     //Set baudrate
   output_low(sen);
   delay_ms(1000);
   erase_buffer();
   
   output_high(sen);
   printf("AT+CGPSRST=1");  putc(13);        //Select mode AutoReset
   output_low(sen);
   delay_ms(1000);
   erase_buffer();
   
   strcpy(string,"                    ");  show(3,0,string);
   strcpy(string,"SAVE CONFIGULATION");    show(3,1,string);
   
   output_high(sen);
   printf("AT&W");  putc(13);                //Save Config
   output_low(sen);;
   delay_ms(1000);
   erase_buffer();
   
   output_high(sen);
   printf("AT+CMGS=\"0975073549\"");   putc(13);
   output_low(sen);  
   delay_ms(1000);
   
   output_high(sen);
   printf("Sim908 ready"); putc(26);   
   output_low(sen);  
   delay_ms(7000);
   erase_buffer();
 
   strcpy(string,"                    ");  show(2,0,string);
   strcpy(string,"                    ");  show(3,0,string);
   strcpy(string,"                    ");  show(4,0,string);
   strcpy(string,"LOADING...");            show(2,0,string);
   delay_ms(2000);
   strcpy(string,"                    ");  show(2,0,string);
   strcpy(string,"W:");
   show(3,0,string);
   strcpy(string,"N:");
   show(4,0,string); 
}
//============================================================================//
void  erase_buffer()
{
   int t;
   for(t=0;t<=buffer_size;t++){buffer[t]='\0';}
   xbuff =0;
}
//============================================================================//
int1 wait_ok (void)
{
   char *ptr;
   char r1_ok[]="OK";
   ptr=strstr(buffer,r1_ok);
   if(strncmp(ptr,r1_ok,2)==0)
      {
         delay_ms(500);
         return 1;
      }
   else
      {
         return 0;
      }
   erase_buffer();
}
//============================================================================// 
void  erase_local()
{
   int   l;
   for(l=0;l<12;l++)    {longitude[l]  ='\0';}
   for(l=0;l<11;l++)    {latitude[l]   ='\0';}
   for(l=0;l<24;l++)    {sms_kv[l]     ='\0';}
}
//============================================================================//
void  read_local()
{
   int   i=0,j=0,k;
   output_high(rev);
   while(buffer[i]!=',')   {i++;}
   i++;
   while(buffer[i]!=',')   {i++;}
   i++;
   kitu=buffer[i];                  //Check data is true???
   i+=2;
   while(buffer[i]!=',')
   {
      latitude[j]=buffer[i];
      i++;j++;
   }
   i+=3;
   j=0;
   while(buffer[i]!=',')
   {
      longitude[j] =buffer[i];
      //sms_kv[k]   =buffer[i];
      i++;j++;//k++;
   }
   k=0;
   for(j=0;j<12;j++)
   {
      if(longitude[j]=='\0')     {break;}
      sms_kv[k]=longitude[j];
      k++;
   }
   sms_kv[k]=',';
   k++;
   for(j=0;j<11;j++)
   {
      if(latitude[j]=='\0')      {break;}
      sms_kv[k]=latitude[j];
      k++;
   }
   erase_buffer();
   output_low(rev);
}
//============================================================================//
void  gps_lcd()
{
   int  cd;
   //Show Longtitude
   command_write(0x99);
   for(cd=0;cd<12;cd++)               
   {
      if(longitude[cd]=='\0')    {break;}
      data_write(longitude[cd]);
   }
   //Show latitude
   command_write(0xd9);
   for(cd=0;cd<11;cd++)               
   {
      if(latitude[cd]=='\0')     {break;}
      data_write(latitude[cd]);
   }
   strcpy(string,"                    ");  show(2,0,string);
   delay_ms(2000);
}
//============================================================================//
////                         MAIN PROGRAMING                                ////
//============================================================================//
void main()
{
   int   n;
   enable_interrupts(GLOBAL);
   enable_interrupts(INT_RDA);
   set_tris_b(0x00); set_tris_c(0x80); set_tris_d(0x00); set_tris_e(0x00);
   output_high(rev); output_high(sen);
   output_high(pwr); delay_ms(850);   output_low(pwr);
   Setup_lcd();
   output_low(rev);  output_low(sen);
   Welcom();
   Sim908();
   while(1)
   {
      erase_buffer();
      erase_local();
      kitu  =0x00;
      enable_interrupts(INT_RDA);
      delay_ms(1000);
      output_high(sen);
      printf("AT+CGPSINF=32"); putc(13);   //Send comman read local       
      output_low(sen);
      delay_ms(2000);
      read_local();
      gps_lcd();
      if(kitu=='V')
      {
            strcpy(string,"LOCATION UNKNOWN");   show(2,2,string);
      }
      else if(kitu=='A')
      {
            strcpy(string,"SMS SENDING...");   show(2,0,string);
            output_high(sen);
            printf("AT+CMGS=\"0975073549\"");  putc(13);   //Send local
            output_low(sen);
            delay_ms(1000);
            for(n=0;n<24;n++)
               {
                  output_high(sen);
                  if (sms_kv[n]=='\0')     {break;}
                  printf("%c",sms_kv[n]);
                  output_low(sen);
               }
            output_high(sen); putc(26);   output_low(sen);  delay_ms(7000);
            output_high(sen); putc(13);   output_low(sen);
            strcpy(string,"                   ");  show(2,0,string);
            strcpy(string,"COORDINATES SENT...");   show(2,0,string);
      }
      delay_ms(20000);
   }

 
Last edited by a moderator:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top