loading
Hi I made an Arduino Controlled Car Tracking System based on SMS for my father's car. 
The used modules are;
Arduino nano V3.0
SkyLab GPS module
WaveCom GSM module

The SoftwareSerial Library , TinyGPS are used to communicate with modules.
When I called the device from registered phone numbers , it returns the lat , lon and the googlemap link in a sms =)

Source Code is :




<code>

#include <TimerOne.h>
#include <TinyGPS.h>
#include <SoftwareSerial.h>

TinyGPS gps;

SoftwareSerial gsmSerial(2, 3);
SoftwareSerial ss(5,6);

String inData = "";
boolean inputAvailable = false;

String ADMIN_PHONE_NUMBER_1 = "05558233343";
String ADMIN_PHONE_NUMBER_2 = "05323342543";
String ADMIN_PHONE_NUMBER_3 = "05396933985";
String ADMIN_PHONE_NUMBER_4 = "05373624959";

String recievedNumber = "";
String  bora =  "";
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;
boolean gsmdinle = false;

void setup()
{
  delay(30000);
  Serial.begin(9600);
  ss.begin(9600);
  gsmSerial.begin(9600);

  Timer1.initialize(8388480); //about 8.3 seconds
  Timer1.attachInterrupt(callback);

  delay(2000);
  gsmSerial.listen();

  //Serial.println("basla");

  gsmSerial.println("AT+CLIP=1");
  
  delay(1000);
  gsmSerial.println("ATE=0");
 
  delay(1000);
 
  gsmSerial.listen();
}

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

  }
}

void KoordinatBilgisiGonder(){
 
 
  bora = "AT+CMGS=\"";
  bora+= "+9";
  bora+=recievedNumber;
  bora+= "\"";
 
  gsmSerial.println("AT+CMGF=1");
  delay(2000);
  gsmSerial.println(bora);
  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);

 
}

int IsRinging()
{
  if (inData.indexOf("CLIP:") >= 0 )
  {
    return 1;
  }
  else
  {
    return 0;
  }
}
int IsAdminNumber()
{

  if(ADMIN_PHONE_NUMBER_1 == recievedNumber)
  {
    return 1;
  }
  else if(ADMIN_PHONE_NUMBER_2 == recievedNumber)
  {
    return 1;
  }
  else if(ADMIN_PHONE_NUMBER_3 == recievedNumber)
  {
    return 1;
  }
  else if(ADMIN_PHONE_NUMBER_4 == recievedNumber)
  {
    return 1;
  }
  return 0;

}

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


</code>
<p>Hi </p><p>We made this devices and is for sale in Uruguay! We made in Spanish and Portuguese, is avaible for sale in all countries. The cost of final product is less 85USD. You see it in <a href="http://www.logicasur.com/smsautoalerta.html" rel="nofollow"> www.logicasur.com/smsautoalerta.html</a></p><p>all comunications are by SMS and don't give fixed cost.</p><p>We made two apps too, for iOS and Android, search by LOGICASUR SMS AUTOALERTA in AppStore and Google Play.</p><p>if you want sale it in your country please contact me: comercioexterior@logicasur.com </p>
<p>Imagino que le reconoce algo de una boracine ya que esta generando dinero con el proyecto de el.</p>
<p>hello, is this code compatible with arduino uno?</p>
<p>Hi, can i replace the GSM modem with SIM800L?</p>
<p>InsyaAllah boleh..huhuhu</p><p>xoxo</p>
Hi. Can u help me to make this tracker system by using lonet sim808 and arduino uno?
<p>hello! we have made a gps tracking device but we are using a Sim800l gsm. Do you know what code we should use</p><p>thanks beforehand</p>
how much did it cost to make?
GSM Module 80 USD <br>GPS Module 35 USD <br>Microcontroller almost 25 USD <br>The other materials (cables, RS232 to TTL converter etc.. ) 20 USD <br> <br>totally 160 -180 USD
Hi, how are you? <br>Please, I have the GPS and GPRS skylab SKM53 Hilo - Sagem and I want to do anything similar. <br>Could you send me the code for the arduino test? <br> <br>Thanks <br> <br>S&Atilde;&copy;rgio <br>sergiolinux@gmail.com
The source Code : <br>https://github.com/boraciner/gps-gsm-boraciner/blob/master/gps-gsm-boraciner.ino
<p>Send me circuit diagrams to patrickaine1@gmail.com</p>
<p>I would love to make the same system. can u help me with the connection/circuit diagrams</p>
<p>sir good day, i can you if you have a code for arduino 238 codes just to receive long and lot then plot it to the web page? heres my e mail sir artusalbi@gmail.com, thank you ver much..</p>
<p>wow this is the same which I was looking from long</p><p>I am a newbie but I am very much fascinated by the this or projects from arduino board.</p><p>Could anybody can help me understanding &amp; setting up the project step by step.</p><p>I would be very much thankful.Please help me</p>
Excellent!
THERE IS A NEW VERSION ===================&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br>https://www.instructables.com/id/Version-20-Arduino-Controlled-Car-Tracking-System/
<p>What's the difference between the version 2.0 and this one?</p>
<p>good job...</p>
<p>HI,</p><p> I'm working on similar project, &quot;On demand human location system&quot;, but I can't utilise the SoftwareSerial on my device </p> <br><p><a href="http://www.dfrobot.com/index.php?route=product/product&product_id=673" rel="nofollow">http://www.dfrobot.com/index.php?route=product/product&amp;product_id=673</a></p><p>can you show me how I can utilize the above code w/o softwareserial?<br></p>
<p>Hey <br>Im trying to make a Cheap Car tracker<br>so I want to make one with the cost between $25 - $35 <br>so ive found this arduino <a href="https://www.instructables.com/id/The-RRRRRRRRRRBA-or-What-They-Dont-Teach-You-in-/" rel="nofollow"><em><strong>3$ arduino</strong></em></a> and the gprs shield is the only problem so ive found <a href="https://www.instructables.com/id/Arduino-Mini-Shields/" rel="nofollow"><em><strong>this guy who make mini shield</strong></em></a> but I have no idea how to make one with a gprs module <br>and also ive found this shield for <a href="https://store.open-electronics.org/index.php?_route_=GSM_GPRS_GPS_SHIELD" rel="nofollow"><strong><em>16.20&euro; </em></strong></a></p><p>im very new bie so ive bought this for u <br>I think that u aew interested in made a very cheap car track too with less than 180 USD! <br>Gimme ur opnion! Im from Brazil and we have a lot of prob with car thiefs<a href="https://www.instructables.com/id/The-RRRRRRRRRRBA-or-What-They-Dont-Teach-You-in-/" rel="nofollow"> <br></a></p>
Hello please i am doing this arduino car tracking project but i can not get it working because my gsm modem can not send the coordinate to my phone but when i test it on hyper terminal it works ok, i have even tied to harwire the Gsm modem by connecting the Tx, Rx and Ground and even the RTS to the CTS on the Rs232 side of the Gsm modem but it still does not send message. can you please tell me how you did the connection on your project bcs i am using the same hardware which Arduino nano, RS232 to TTL converter and wavecome Gsm modem. Thanks for your reply.
hi! you must check correct RX TX pinout of wavecom gsm modem which is connected to RS232 module, I can still make mistake while connecting them, (made 3 pcs.) after that you should just monitor what is coming from wavecom... print it with Serial.println to your debug monitor of IDE. <br>if everything is ok , then connect the gps module and monitor it again, after that you can upload your main code....
Hello please i am doing this arduino car tracking project but i can not get it working because my gsm modem can not send the coordinate to my phone but when i test it on hyper terminal it works ok, i have even tied to harwire the Gsm modem by connecting the Tx, Rx and Ground and even the RTS to the CTS on the Rs232 side of the Gsm modem but it still does not send message. can you please tell me how you did the connection on your project bcs i am using the same hardware which Arduino nano, RS232 to TTL converter and wavecome Gsm modem. Thanks for your reply.
Hi guys please can someone let me know if the Ardruino nano V3.0 uses the AT command like the 8051 microcontroller , because i am designing one with the 8051 but looking at the Aedruino it looks less complicated wit the programming?
Arduino is less complicated 'cause you don't have to be confused with fuse configrations etc..

About This Instructable

30,346views

91favorites

License:

More by boraciner:Truck Roof Amber Lights Version 2.0 Arduino Controlled Car Tracking System based on SMS Arduino Controlled Car Tracking System based on SMS 
Add instructable to: