Subtotal: 0
View Cart

GPS Vehicle Tracker

Information provided by: Ashfaq Juna, Applications Engineer
Maxim Dallas Semiconductor

This article describes a simple way of tracking a vehicle’s location if it is stolen. The idea is to get the coordinates (in degrees latitude and longitude) via a standard mobile telephone "text" message, which can then be used to determine the exact location of the vehicle.

This has many possible uses, from tracking an individual car to managing a fleet of trucks and buses.

This project offers a very simple approach to location reporting of a vehicle; more features can be added according to individual requirements.

The Ingredients:

The project uses the following building blocks:

1. GPS receiver (Garmin GPS 35). This provides information about the location of the vehicle.

2. GSM module (Siemens TC35). The GSM modules is used to send SMS (Text messages) to a pre-programmed mobile number.

3. iButton (DS1990A). The iButton is used to identify the driver to be authorised to operate the vehicle.

4. Parallax Basic Stamp® (BS2P) module in conjunction with a BASIC Stamp microcontroller Board of Education®  development board. (www.parallax.com)

The block diagram below in Figure 1 shows basic setup:

The GPS receiver provides information in ‘NMEA’ format. The Latitude and Longitute can be extracted from the ‘$GPRMC’ sentence (in form of “ABC degrees North”, “DEF degrees West”).

The GSM module is used to send SMS messages (text messages) to a pre-programmed mobile phone.

The DS 1990A iButton (also known as ‘serial number iButton’) is used as a means of identification or ‘Key’. This device contains a unique factory programmed 6 Byte ID with 2 bytes of CRC. This device is a ‘Read Only’ iButton. The system at present caters for 2 iButtons or ‘Keys’, allowing for a ‘spare key’. More ‘key’ codes can be easily added as required.
  • On start-up, the BASIC Stamp module continuously scans for two things:
    • an iButton to be momentarily connected to the input
    • the ignition being active
       
  • Normal operation would be for an ‘authorised’ iButton to be connected to the port and then the car is started within 25 seconds.
     
  • Intrusion is detected by the following conditions:
    • If the ignition is detected to be active without a valid iButton being connected to input port within 25 seconds of starting the car.
    • If no iButton is connected within 25 seconds of starting the car, this will also be an intrusion state.
       
  • Upon establishing that an intrusion has occurred, the BASIC Stamp microcontroller looks for the information from the GPS receiver. It waits for the string ‘$GPRMC’ to appear on the serial output of the GPS receiver.
    • It then sends an SMS message to a pre-programmed mobile number with the coordinates extracted from the ‘GPRMC’ sentence received from the GPS.
    • This process is repeated every 2 minutes to keep the owner informed of the car’s location.
Putting it all together:
The core of this project is the BASIC Stamp module. It interfaces to the GPS receiver, the GSM modem, the iButton and the ignition connection from the vehicle.

In this project the Ignition line is used to detect if the car has been started, other indicators can be used instead if required (e.g. ultrasonic transducer or other forms of intrusion detectors).
  • The GPS receiver’s output is connected to P0 of the BASIC Stamp microcontroller.
  • The GSM module’s receiver input is connected to ‘Sout’ or Pin 1 of the BASIC Stamp module.
  • P1 of the basic stamp is connected to the ignition connection. A High state indicates that the ignition is on and vice versa.
  • P15 is used for the interface to the iButton.

Note that the BS2P in the BASIC Stamp microcontroller range will support the 1-wire interface for the iButtons, previous variants will not support the interface.

Entering your mobile number:

To program a mobile phone number in the code, enter it in the line indicated in the program as shown below:

'================================================================================
DEBUG "+44********** " ' Enter the destination mobile phone number here
'================================================================================

It must be in the format:

+ Countrycode (using UK’s code in the example above)
followed by the mobile’s number omitting the leading zero from the number.

This will be the number that the system will use to send SMS messages with the location of the car.

Entering the iButton serial numbers:

Enter the iButton serial numbers of the iButtons that are to be to used. If only a single iButton is used, then duplicate the serial number in the slots for the 2nd iButton.

The area of code that will need to be entered will look as stated below, in this instance, there are example iButton numbers entered. Replace the numbers following the ‘$’ symbol. The serial numbers are represented in HEX.

A separate program can be supplied that will display the serial number of specific iButtons. The serial numbers can then be entered into the final code that will be downloaded to the BASIC Stamp microcontroller.
 


' ENTER THE FIRST iBUTTON Serial Number is the lines below'

IF romData(0) <> $03 THEN CheckSecond 'First Byte
IF romData(1) <> $F0 THEN CheckSecond
IF romData(2) <> $BC THEN CheckSecond
IF romData(3) <> $08 THEN CheckSecond
IF romData(4) <> $10 THEN CheckSecond
IF romData(5) <> $00 THEN CheckSecond
IF romData(6) <> $00 THEN CheckSecond
IF romData(7) <> $30 THEN CheckSecond 'Eighth Byte


GOTO ButtonOK


CheckSecond:

' ENTER THE SECOND/Spare iBUTTON Serial Number is the lines below'

IF romData(0) <> $01 THEN BadButton 'First Byte
IF romData(1) <> $68 THEN BadButton
IF romData(2) <> $21 THEN BadButton
IF romData(3) <> $24 THEN BadButton
IF romData(4) <> $08 THEN BadButton
IF romData(5) <> $00 THEN BadButton
IF romData(6) <> $00 THEN BadButton
IF romData(7) <> $31 THEN BadButton 'Eighth Byte


After making these modifications, the system should be able to track any vehicle.
Further indepth details will be available on our website: http://www.maxim-ic.com/GPS-TRacker

A similar version of this article appeared in November 2002 Edition of EPD.

Downloads:
1-Wire ID.bsp (2.51 KB)
EPD Release v.2.01.3E.bsp (9.75 KB)

Home    |    Contact Us    |    Job Opportunities    |    About Parallax    |    Privacy Statement    |    Terms Of Use    |    Copyright 2007 by Parallax, Inc.