Arduino Project - GPS/GPRS

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
netstat
 
Posts: 16
Joined: Mon Nov 10, 2008 10:28 pm

Arduino Project - GPS/GPRS

Post by netstat »

Hello,

Im doing a little porject with the Arduino. Its a GPS/GPRS system that when a SMS its receive, it will retreive the GPS info and send it back to a predifine number via SMS.

Parts used:

GPS Shield
Libelium.com GPRS shield

IM STILL developing this...so the code its not finished...I need to figure how to verify when a SMS is receive.....Any help would be great,...


#include <AFSoftSerial.h>

/*
*GPS-GPRS Module para Arduino.
*Basado en el modulo GPS de ladyada.net y el modulo GPRS de Libelium.com
*Cuando se recibe un mensaje de texto(SMS), tomo las coordernadas del GPS y las envio via SMS.
*Hecho por Alexander Veloz, 2008, [email protected]
*/

//GPS Conf
#define GPSrxPin 3 // GPS rx Pin
#define GPStxPin 4 // GPS tx Pin
#define GPSpowerpin 5 // GPS Power Pin
#define GPSRATE 4800 // GPS Baud Rate
//GPRS Conf
#define GPRSpowerpin 2 // GPRS Power Pin
#define GPRSRATE 115200 // GPRS Baud Rate
//Opciones GPS
#define RMC_ON "$PSRF103,4,0,1,1*21\r\n" // RMC on (1 hz rate)
#define RMC_OFF "$PSRF103,4,0,0,1*20\r\n" // RMC off
#define GGA_ON "$PSRF103,0,0,1,1*25\r\n" // GGA on (1 hz rate)
#define GGA_OFF "$PSRF103,0,0,0,1*24\r\n" // GGA off
#define GSA_ON "$PSRF103,2,0,1,1*27\r\n" // GSA on (1 hz rate)
#define GSA_OFF "$PSRF103,2,0,0,1*26\r\n" // GSA off
#define GSV_ON "$PSRF103,3,0,1,1*26\r\n" // GSV on (1 hz rate)
#define GSV_OFF "$PSRF103,3,0,0,1*27\r\n" // GSV off
#define WAAS_ON "$PSRF151,1*3F\r\n" // WAAS on
#define WAAS_OFF "$PSRF151,0*3E\r\n" // WAAS off

void switchGPSModule(){
digitalWrite(GPSpowerpin,HIGH);
delay(2000);
digitalWrite(GPSpowerpin,LOW);
}
void switchGPRSModule(){
digitalWrite(GPRSpowerpin,HIGH);
delay(2000);
digitalWrite(GPRSpowerpin,LOW);
}

AFSoftSerial GPSserial = AFSoftSerial(GPSrxPin, GPStxPin); // Puerto serial virtual para el GPS

void setup()
{
if (GPSpowerpin, GPRSpowerpin) {
pinMode(GPSpowerpin, OUTPUT);
pinMode(GPRSpowerpin, OUTPUT);
}
GPSserial.begin(GPSRATE); // Inicio comunicacion para GPS
switchGPSModule(); // Enciendo modulo GPS
GPSserial.println("Configurando GPS..."); // Mensaje iniciando GPS
delay(1000);
GPSserial.println(GGA_ON); // GGA on
GPSserial.println(RMC_OFF); // RMC off
GPSserial.println(GSA_OFF); // GSA off
GPSserial.println(GSV_OFF); // GSV off
GPSserial.println(WAAS_OFF); // WAAS off
delay(1000);
Serial.begin(GPRSRATE); // Inicio comunicacion para GPRS
switchGPRSModule(); // Enciendo modulo GPRS
Serial.println("Configurando GPRS..."); // Mensaje iniciando GPRS
delay(1000);
Serial.println("AT+CMGF=1"); // SMS en modo texto
}

void loop()
{
//aqui va el codigo principal
}


adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Arduino Project - GPS/GPRS

Post by adafruit »

if you need help with Libelium's shield i suggest contacting them for support

netstat
 
Posts: 16
Joined: Mon Nov 10, 2008 10:28 pm

Re: Arduino Project - GPS/GPRS

Post by netstat »

I found something about the commands...

Code: Select all

b)      Read a text SMS

 

Like PDU mode, when the M20 Terminal receives a SMS message, the following message will appear on the PC screen.

 

   +CMTI: “SM”, 1

     where 1 is the memory location in which the message can be read from.

 

To read the SMS message use the AT+CGMR command as follow.

 

AT+CMGR=1[ENTER]

 

     The M20 Terminal should return the text message as follow.

 +CMGR: “REC READ”,“+61407809050”,“98/12/01,20:16:11+44”

  hello

           OK


 

c)      Delete a SMS message

 

The SMS message can be deleted from memory (eg. location 1) using the AT+CMGD command as follow. Note that there is no AT command to delete all the SMS messages at once.

  

AT+CMGD=1[ENTER]

 

      The M20 Terminal should return OK.

 
now I need to see how those command I can make the arduino to read the message...and answer back with the GPS information...

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Arduino Project - GPS/GPRS

Post by adafruit »

if you need help with Libelium's shield i suggest contacting them for support

netstat
 
Posts: 16
Joined: Mon Nov 10, 2008 10:28 pm

Re: Arduino Project - GPS/GPRS

Post by netstat »

I just want to share this project...this is not about getting help from Libelium...the AT commands are somehting you can found all over the internet...is not something specifig to this shield... :roll:

eil
 
Posts: 440
Joined: Sun Aug 31, 2008 11:09 pm

Re: Arduino Project - GPS/GPRS

Post by eil »

This sounds like a neat project. So you basically send the unit a text message and it responds with it's GPS coordinates?

netstat
 
Posts: 16
Joined: Mon Nov 10, 2008 10:28 pm

Re: Arduino Project - GPS/GPRS

Post by netstat »

eil wrote:This sounds like a neat project. So you basically send the unit a text message and it responds with it's GPS coordinates?
Exactly!!! Thats what I want to do.....browsing in google I found this!!!

http://www.digitaldawgpound.org/nick84/post=222

and this

http://tinkerlog.com/2007/07/13/interfa ... ile-phone/


I need to see how I do that with the Arduino...Im very basic at programming...

hsalman01
 
Posts: 3
Joined: Mon Nov 24, 2008 1:04 pm

Re: Arduino Project - GPS/GPRS

Post by hsalman01 »

I have worked in a company specialized in the gps tracking field. I am interested to share with you about this project. If you are also interested we can discuss by email.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: Arduino Project - GPS/GPRS

Post by mtbf0 »


Bandit
 
Posts: 45
Joined: Mon Dec 01, 2008 1:16 pm

Re: Arduino Project - GPS/GPRS

Post by Bandit »

Hi netstat and others,

Did you manage to get it working, Im starting a project to do the same. I'll be using a gsm/gprs modem instead of a normal phone.

Im building a gps tracker that I can activate by text message. I want to put this tracker in a secure case (maybe encapsulate it) and attach it underneath my bike seat. I also want to include a fuel cut off valve that is electronically actuated so I can stop the bike in its tracks if it was ever to be stolen.

If you have got it working, please can you pm me? Thanks.

safariblue
 
Posts: 1
Joined: Thu Oct 29, 2009 1:52 pm

Re: Arduino Project - GPS/GPRS

Post by safariblue »

I all

I´m doing a project with arduino and a telit board to do the same as talk in this post.

Can anyone help me. I try many versions but I can read the sms i send.

sergiotux
 
Posts: 1
Joined: Fri May 04, 2012 12:12 pm

Re: Arduino Project - GPS/GPRS

Post by sergiotux »

Hello, I saw your project on the link (http://forums.adafruit.com/viewtopic.php?f=25&t=7770)'m trying to do the same but without success.
Can you help me?

I have a
1 - one and a arduino decimilanova
1 - gprs - (http://www.cooking-hacks.com/index.php/ ... odule.html)
1 - gps - http://www.skylab.com.cn/SKM53.html

And nenuma idéai how to do things.
I found an internet code where does the gps and other works where sendingtorpedoes gprs. I'm trying to join the two but I think that has a conflict with thedoors with gps gprs.

It seems to me that shlds you are using are the same.

You conseguil achieve the goal?

Thank you.

Sérgio - BRA

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”