Introduction: Version 2.0 Arduino Controlled Car Tracking System Based on SMS

Picture of Version 2.0 Arduino Controlled Car Tracking System Based on SMS

This system is upgraded version of previous project... 
You will be able to track your car after you build this system,
you will call the device then it will send you an sms which includes LAT, LON and Google Map link for just one touch to see where it is.

Firstly required materials :

TTL to RS232 Module
VGA socket
SkyLab SKM53 GPS Module
Arduino Pro
Wavecom GSM modem

Before you start to build them, you should connect the Wavecom to PC to adjust Serial Com. Baud Rate to 9600
then make it save this configuration via AT commands. (It is written in Wavecom AT command datasheet).





Step 1: Preparing the Wavecom for Fastening the Modules

Picture of Preparing the Wavecom for Fastening the Modules

Secondly, disassemble the wavecom GSM module and drill many holes for screws, our modules hold on these screws..

Step 2: Preparing the Datacable

Picture of Preparing the Datacable

Let's make a datacable between Wavecom and RS232 module,
you use just 3 pinouts, it's enough for communication..

Step 3: Connecting the Other Parts

Picture of Connecting the Other Parts

Now let's connect the RS232 and GPS module to our Arduino,

We use 3 pinouts of GPS module ,
These are TX, VCC , Ground (on Skylab SKM53).
connect
GPS TX pinout ----> Arduino PIN 5
RS232 Module RX---> Arduino PIN 10
RS232 Module TX---> Arduino PIN 11
also do not forget to connect Vcc and GND pinouts of RS232 module, GPS module and Arduino

Step 4: Finishing the Tracker Device

Picture of Finishing the Tracker Device

Not fix these modules on Wavecom with silicon...
You also can connect a buzzer to PIN7 , I do it because I'll put this device in a hidden place then power it on/off with wireless RF switch. So, I can hear the buzzer when I power it on..

Now .. upload program on arduino.. (next step)

Step 5: Program

it has a few Turkish lines , some of them

GPS VERISI HAZIR DEGIL ====>>> GPS DATA IS NOT READY
KoordinatBilgisiGonder =====> SendGPSData
ENLEM ======>>>  LATITUDE
BOYLAM ========>>> LONGITUDE
HIZ===========>> SPEED












==========================================  CODE===================================================



#include
#include
#include

TinyGPS gps;

SoftwareSerial gsmSerial(10,11);
//SoftwareSerial gsmSerial(3,2);
SoftwareSerial ss(5,6);

String inData = "";
boolean inputAvailable = false;
String recievedNumber = "";
String gpsMesajIcerik = "";
int callback_counter=0;
int indexofMsgStr = 0;
float flat, flon, fkmph;
unsigned long age;
char okunanKarakter = '*';
float flat_store = 0.0;
float flon_store = 0.0;
int buzzer = 7;

void setup()
{

    pinMode(buzzer, OUTPUT);
Serial.begin(9600);
ss.begin(9600);
gsmSerial.begin(9600);

Timer1.initialize(8388480); //yaklasik 8.3 saniye
Timer1.attachInterrupt(callback);

delay(2000);
gsmSerial.listen();

Serial.println("basla");
delay(1000);
gsmSerial.listen();

        fastbuzzer();
}

void loop() // run over and over
{
while(gsmSerial.available())
{
  inputAvailable = true;
  okunanKarakter = (char) gsmSerial.read();
  inData += okunanKarakter;
  if(okunanKarakter == ','){
   break;
  }
}

if(inputAvailable)
{
  inputAvailable=false;
  processData();
  inData="";
}
}

void printGPSDATA()
{
gps.f_get_position(&flat, &flon, &age);

if( flat > 0.0 )
flat_store = flat;

if( flon > 0.0 )
flon_store = flon;

fkmph = gps.f_speed_kmph(); // speed in km/hr

}

void TAKEGPSDATA(){
Serial.println("---->TAKEGPSDATA");
boolean gps_valid = false;
ss.listen();
delay(1000);


for(int i =0 ; i < 200 ; i++)
{
  if(!gps_valid)
  {
   while (ss.available())
   {
    char c = ss.read();
    if (gps.encode(c)) // Did a new valid sentence come in?
    {
     printGPSDATA();
     gps_valid = true;
                                        break;
    }
   }
   delay(5);
  }
}

gsmSerial.listen();
delay(1000);
Serial.println("<----TAKEGPSDATA");

}

void processData(){
Serial.println(inData);

if(IsRinging())
{ // telefon caliyor
  Serial.println("telefon caliyor");
  indexofMsgStr = inData.indexOf("05");
  recievedNumber = inData.substring(indexofMsgStr , indexofMsgStr+11);
  Serial.print("recieved number=");
  Serial.println(recievedNumber);

  if(IsAdminNumber())
  {
   Serial.println("admin ok!");
   TAKEGPSDATA();
   if(gpsDataOk())
   {
           KoordinatBilgisiGonder();
   }
   else
   {
    HazirDegilBilgisiGonder();
   }
  }

}
}

void KoordinatBilgisiGonder(){

gpsMesajIcerik = "AT+CMGS=\"";
gpsMesajIcerik+= "+9";
gpsMesajIcerik+=recievedNumber;
gpsMesajIcerik+= "\"";

gsmSerial.println("AT+CMGF=1");
delay(2000);
gsmSerial.println(gpsMesajIcerik);
delay(1000);

gsmSerial.print("ENLEM =");
gsmSerial.println(flat_store,6);
gsmSerial.print("BOYLAM =");
gsmSerial.println(flon_store,6);

gsmSerial.print("HIZ =");
gsmSerial.print(fkmph);
gsmSerial.println(" km/saat");

gsmSerial.println("LINK =");
gsmSerial.print("http://maps.google.com/?ie=UTF8&hq=&ll=");
gsmSerial.print(flat_store,6);
gsmSerial.print(",");
gsmSerial.print(flon_store,6);
gsmSerial.print("&z=20");
gsmSerial.write(26);
}


void HazirDegilBilgisiGonder()
{
gpsMesajIcerik = "AT+CMGS=\"";
gpsMesajIcerik+= "+9";
gpsMesajIcerik+=recievedNumber;
gpsMesajIcerik+= "\"";

gsmSerial.println("AT+CMGF=1");
delay(2000);
gsmSerial.println(gpsMesajIcerik);
delay(1000);

gsmSerial.println("GPS VERISI HAZIR DEGIL ");
gsmSerial.print(flat_store,6);
gsmSerial.print("-");
gsmSerial.println(flon_store,6);

gsmSerial.write(26);
}

int IsRinging()
{
if (inData.indexOf("CLIP:") >= 0 )
{
  return 1;
}
else
{
  return 0;
}
}
int IsAdminNumber()
{
if(recievedNumber.equals("05558237477"))
{
  return 1;
}
else
{
  if(recievedNumber.equals("05073674078"))
  {
   return 1;
  }
  else
  {
   if(recievedNumber.equals("05323375412"))
   {
    return 1;
   }
   else
   {
    if(recievedNumber.equals("05398523288"))
           {
         return 1;
             }
                                else
                                {
                                    if(recievedNumber.equals("05532766541"))
         { 
                                        return 1;
                                    }                                      
                                    else
                                    {
                                       return 0;
                                    } 
                                }
   }
  }
}
}

int gpsDataOk()
{
if(( flat > 0.0 ) && ( flon > 0.0 ) )
{
  return 1;
}
else
{
  return 0;
}
}

void callback()
{
callback_counter++;
if(callback_counter >= 80)
{
  Serial.print("callback ok!");
  callback_counter = 0;
  TAKEGPSDATA();
}
}

void fastbuzzer()
{
for(int i = 0; i< 10; i++)
{
  digitalWrite(buzzer, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(buzzer, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
}
}

Comments

pamarthy (author)2015-12-11

hi very good idea and great effort. cant we use another gsm module other than wavecom gsm modem like sim900 etc....? and also other than sky lab gps???

boraciner (author)pamarthy2016-11-25

you can use any gps module or gsm module, just be careful about parsing the messages. Debug it via serial port and be sure it takes correct parts from these messages

pamarthy (author)2015-12-11

hi very good idea and great effort. cant we use another gsm module other than wavecom gsm modem like sim900 etc....? and also other than sky lab gps???

MikeD15 (author)2015-04-20

Following on from my earlier comment.. I checked version 1.0 of this project and it would appear that the missing libraries are:

#include <TimerOne.h>

#include <TinyGPS.h>

#include <SoftwareSerial.h>

MikeD15 (author)2015-04-20

Someone forgot to include the libraries in the code....

At the start of the code the include lines are empty.

#include
#include
#include

TinyGPS gps;

SoftwareSerial gsmSerial(10,11);
//SoftwareSerial gsmSerial(3,2);
SoftwareSerial ss(5,6);

triumphman (author)2013-08-16

Too much work, who wants to type all that ? Certainly not me !

boraciner (author)triumphman2014-07-11

It's your choice ;)

gmakhaliev (author)2014-05-09

you did it to show off? Don't you have a desire to help the person? Can you help me, I need to graduate work??? please? Is is works on ARDUINO UNO???

gmakhaliev (author)2014-04-29

It's shows only this lines, what is wrong? can you help man?

basla

RING

RING

RING

RING

RING

RING

manfredpw (author)2013-05-22

great project.
How long does the battery last?

boraciner (author)manfredpw2013-05-22

Thanks .. I connected it to car battery, So it's working every time.

askserver (author)boraciner2014-04-12

i found this Post wich i think will complete your answer

https://www.instructables.com/id/Power-Your-Arduino...

gmakhaliev (author)2014-04-07

Hello! I've got Wavecom WMOD2, and is it compatible with this project? Or it already has some of this functions? I can't understand some aspects, can you please help me?? I'll made it for my diploma project!! thanks!!!

Tomahawk92 (author)2013-08-15

think you could pull this off with an arduino uno?

boraciner (author)Tomahawk922014-01-16

yes of course

Raphango (author)2013-09-11

Do you need a GSM Card (chip) for this project? (The same used on common phones)

boraciner (author)Raphango2014-01-16

Yes I used a simcard used on common phones

boraciner (author)2013-10-04

You should see the lines which includes the pin Connections

wehappyfew (author)2013-09-29

Nice project but you could be way more descriptive for people who do not have much experience.
You should not make an instructable by only providing pictures.

boraciner (author)2013-09-28

If you mean sim card.. Yes I used Of Course

boraciner (author)2013-09-28

I used wavecom gsm modem and skylab gps module..