Hello ! I am looking for a project of a pic vehicle satellite tracker. Can anybody help me?
Hi ... I try digg the net and I see some nice project here is:
I just finished a summer project which is a GPS tracker demonstration program with data logging capacity. It uses BasicStamp 2P (also you can use PIC chip) to interface with a GPS Module, JP Module and 16x2 LCD display. Sample code used is standard PBasic 2.5 ( It can be changed to PicBasic or PicBasic Pro very easy).
It can record GPS data to a MMC/SD card with latitude and longitude information. The data can be processed from Google Map at the website
'================================================= =====
' File...... GPS Tracking Data Logger Demo
' Purpose... BS2P + JP Module + GPS Module + 16x2 LCD
' Author.... OldSpring
' Email.....
[email protected]' Started...
' Updated... 18 July 2008
'
' {$STAMP BS2p}
' {$PBASIC 2.5}
'
'================================================= ======
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
T2400 CON 396
T4800 CON 188
T9600 CON 84
T19K2 CON 32
#CASE BS2SX, BS2P
T2400 CON 1021
T4800 CON 500
T9600 CON 240
T19K2 CON 110
#CASE BS2PX
T2400 CON 1646
T4800 CON 813
T9600 CON 396
T19K2 CON 188
#ENDSELECT
'-------------------------------------------------------
' I/O Definitions
'-------------------------------------------------------
E PIN 1 'LCD Enable Pin
SOUT PIN 15 'Send command and data to JP Module
StatePin PIN 14
ResetPin PIN 13
GPS_In PIN 12 'GPS Data in
RecIndicator PIN 11 'GPS Data record Indicate
'-------------------------------------------------------
' Constants
'-------------------------------------------------------
'-------------------------------------------------------
' Variables
'-------------------------------------------------------
RecCount VAR Byte
x VAR Nib
GPSData VAR Byte(24) 'GPS Data from module
JP_Baud CON T19K2 ' 19200,8,N,1
GPS_Baud CON T4800 ' 4800,8,N,1
'--------------------------------------------------------
' LCD command
'--------------------------------------------------------
LcdCls CON $01 ' clear the LCD
LcdHome CON $02 ' move cursor to home
LcdLine1 CON $80 ' Lcd address for line 1
LcdLine2 CON $C0 ' Lcd address for line 2
Init_LCD:
PAUSE 1000 ' LCD self init
LCDCMD E, %00110000 ' wakeup
PAUSE 10
LCDCMD E, %00100000 ' set data for 4 bits
LCDCMD E, %00101000 ' set 2(4) line mode with 5x8 font
LCDCMD E, %00001100 ' turn cursor off
LCDCMD E, %00000110 ' auto increment cursor
'------------- First Screen ---------------
LCDCMD E, LcdCls
LCDOUT E, LcdLine1, [" GPS Tracking "]
LCDOUT E, LcdLine2, [" Data Logger "]
PAUSE 2000
'************************************************* **********
' Format MMC/SD Card with FAT16
'Warning: Format will erase ALL data on your MMC/SD card!!!!
'================================================= ==========
' GOSUB Formatting If formatting MMC/SD Card
'================================================= ==========
GOSUB Init_JP_Module
' ----------------------------------------------------------
' Initialization
' ----------------------------------------------------------
Initialize:
RecCount = 0
' OUTPUT RecIndicator
LCDCMD E, LcdCls
LCDOUT E, LcdLine1, ["La:"]
LCDOUT E, LcdLine2, ["Lo:"]
'-----------------------------------------------------------
' Main program
'-----------------------------------------------------------
HIGH RecIndicator 'Turn LED ON
Main:
GOSUB DisplayData 'LCD Dispaly GPS Data
GOSUB RecordData 'Record Record Data
PAUSE 5000 'About per sample/per 5 sec.
GOTO Main
END
' ----------------------------------------------------------
' Subroutines
'-----------------------------------------------------------
RecordData:
GOSUB Rec_GPS_Data 'Get GPS Data for record
'************************************************* **********
' Change GPS Data format "xxxx.xxxx,N,xxxxx.xxxx,W"
' to Google Earth Data format "xxxx.xxxx,-xxxxx.xxxx"
'************************************************* **********
'DEBUG GPSData(11),CR
IF GPSData(11) = "N" THEN
GPSData(0) = " "
ELSE
GPSData(0) = "-"
ENDIF
'DEBUG GPSData(24),CR
IF GPSData(24) = "W" THEN
GPSData(12) = "-"
ELSE
GPSData(12) = " "
ENDIF
GPSData(11)= " "
'DEBUG STR GPSData\23,CR
SEROUT SOUT, JP_Baud, [STR GPSData\23, CR,"!!"] 'Data recording
RETURN
'-----------------------------------------------------
DisplayData:
GOSUB LCD_GPS_Data
LCDOUT E, LcdLine1 + 5, [STR GPSData\11]
FOR x = 0 TO 12
GPSData(x) = GPSData(x+12)
NEXT
LCDOUT E, LcdLine2 + 4, [STR GPSData\12]
RETURN
'-------------------------------------------------------
LCD_GPS_Time:
GPSData(6) = 0
SERIN GPS_In, GPS_Baud, [WAIT ("$GPRMC"), SKIP 1, STR GPSData\6]
RETURN
'-------------------------------------------------------
LCD_GPS_data:
GPSData(24) = 0
SERIN GPS_In, GPS_Baud, [WAIT ("$GPRMC"), SKIP 13, STR GPSData\24]
RETURN
'-------------------------------------------------------
Rec_GPS_data:
GPSData(24) = 0
SERIN GPS_In, GPS_Baud, [WAIT ("$GPRMC"), SKIP 12, STR GPSData\25]
RETURN
'-------------------------------------------------------
Formatting:
LCDCMD E, LcdCls
LCDOUT E, LcdLine1, [" Formatting... "]
SEROUT SOUT, JP_Baud, ["MF!"] 'Format MMC/SD Card
PAUSE 50
SEROUT SOUT, JP_Baud, ["OldSpring!!"] 'Volume label
PAUSE 1000
Waiting:
IF StatePin = 1 THEN
LCDOUT E, LcdLine1, [" Finished! "]
ELSE
PAUSE 1000
GOTO Waiting
ENDIF
RETURN
'-----------------------------------------------------
Init_JP_Module:
OUTPUT ResetPin
ResetPin = 0
PAUSE 1000
ResetPin = 1
PAUSE 1000
SEROUT SOUT, JP_Baud, ["MA!"] 'Open data file
PAUSE 50
SEROUT SOUT, JP_Baud, ["GPSTrack.CSV!!"] 'File Name
PAUSE 1000
IF StatePin = 0 THEN 'If file not find, create a new file
ResetPin = 0
PAUSE 1000
ResetPin = 1
PAUSE 1000
SEROUT SOUT, JP_Baud, ["MC!"] 'Create a new file
PAUSE 50
SEROUT SOUT, JP_Baud, ["GPSTrack.CSV!!"] 'File Name
PAUSE 1000
SEROUT SOUT, JP_Baud, ["Latitude,Longitude", CR,"!!"] 'Data title
PAUSE 1000
ENDIF
RETURN