Version 2.0 Arduino Controlled Car Tracking System Based on SMS

26,625

77

21

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

About: Computer engineer

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

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

Step 2: 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

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

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

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    21 Comments

    0
    pamarthy
    pamarthy

    5 years ago

    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???

    0
    boraciner
    boraciner

    Reply 4 years ago

    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

    0
    pamarthy
    pamarthy

    5 years ago

    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???

    0
    MikeD15
    MikeD15

    5 years ago on Step 5

    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>

    0
    MikeD15
    MikeD15

    5 years ago on Step 5

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

    0
    triumphman
    triumphman

    7 years ago on Introduction

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

    0
    gmakhaliev
    gmakhaliev

    6 years ago on Introduction

    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???

    0
    gmakhaliev
    gmakhaliev

    6 years ago on Step 5

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

    basla

    RING

    RING

    RING

    RING

    RING

    RING

    0
    manfredpw
    manfredpw

    7 years ago on Introduction

    great project.
    How long does the battery last?

    0
    boraciner
    boraciner

    Reply 7 years ago on Introduction

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

    0
    gmakhaliev
    gmakhaliev

    6 years ago on Introduction

    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!!!

    0
    Raphango
    Raphango

    7 years ago on Introduction

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

    0
    boraciner
    boraciner

    Reply 7 years ago on Introduction

    Yes I used a simcard used on common phones

    0
    boraciner
    boraciner

    7 years ago

    You should see the lines which includes the pin Connections

    0
    wehappyfew
    wehappyfew

    7 years ago on Introduction

    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.

    0
    boraciner
    boraciner

    7 years ago

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