0% found this document useful (0 votes)
33 views

Vehicle Tracking System Source Files

This Arduino sketch uses a GPS module and GSM shield to track vehicle location and send SMS updates. It extracts latitude and longitude values from incoming GPS data strings, displays them on an LCD, and sends SMS messages with the coordinates every 20 seconds. The sketch initializes serial communication and an LCD display, then continuously loops to read GPS data, parse coordinates, display and send updates until the next reading interval.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Vehicle Tracking System Source Files

This Arduino sketch uses a GPS module and GSM shield to track vehicle location and send SMS updates. It extracts latitude and longitude values from incoming GPS data strings, displays them on an LCD, and sends SMS messages with the coordinates every 20 seconds. The sketch initializes serial communication and an LCD display, then continuously loops to read GPS data, parse coordinates, display and send updates until the next reading interval.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SCHEMATIC DIAGRAM

SOURCE CODES [ARDUINO SKETCH]


#include<LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


char str[70];
char *test="$GPGGA";
char logitude[10];
char latitude[10];
int i,j,k;
int temp;
int Ctrl+z=26; //for sending msg
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
lcd.setCursor(0,0);
lcd.print("GPS Besed Vehicle ");

lcd.setCursor(0,1);
lcd.print("Tracking System");
delay(10000);
}
void loop()
{
if (temp==1)
{
for(i=18;i<27;i++)
//extract latitude from string
{
latitude[j]=str[i];
j++;
}
for(i=30;i<40;i++)
//extract longitude from string
{
logitude[k]=str[i];
k++;
}
lcd.setCursor(0,0);
//display latitude and longitude on 16X2 lcd display
lcd.print("Lat(N)");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Lon(E)");
lcd.print(logitude);
delay(100);
Serial.println("AT+CMGF=1"); //select text mode
delay(10);
Serial.println("AT+CMGS=\"9610126059\""); // enter receipent number
Serial.println();
Serial.print("Latitude(N): ");
//enter latitude in msg
Serial.println(latitude);
//enter latitude value in msg
Serial.print("Longitude(E): ");
//enter Longitude in Msg
Serial.println(logitude);
//enter longitude value in msg
Serial.write(Ctrl+z);
//send msg Ctrl+z=26
temp=0;
i=0;
j=0;
k=0;
delay(20000);
// next reading within 20 seconds
}
}
void serialEvent()
{
while (Serial.available())
//Serial incomming data from GPS
{
char inChar = (char)Serial.read();
str[i]= inChar;
//store incomming data from GPS to temparary string
str[]
i++;
if (i < 7)

{
if(str[i-1] != test[i-1])
{
i=0;
}
}
if(i >=60)
{
temp=1;
}
}
}

//check for right string

You might also like