BASIC on Raspberry Pi Pico
  • BASIC Interpreter
  • BASIC with VGA Display
  • BASIC with WiFi & Internet

  • Maximite Family
  • Colour Maximite 2
  • Original Colour Maximite
  • Monochrome Maximite
  • The Maximite Story

  • Micromite Family
  • Micromite Summary
  • Standard Micromite
  • Micromite Plus
  • The Microbridge

  • Micromite LCD Backpack
  • Micromite LCD Backpack
  • Air Quality Monitor
  • DDS Signal Generator
  • Super Clock
  • Boat Computer MkII
  • Parking Assistant

  • Other Projects
  • Pico Gamer Console
  • Precision Analog Clock
  • Watering Controller
  • Windows/DOS MMBasic
  • ASCII Video Terminal
  • Utility Power Supply
  • Precise Voltage Reference
  • ISM Band Scanner
  • Game of Pong
  • Simple GPS Based Clock

  • Useful Techniques
  • 3D Printed Cases
  • Measuring Capacitor ESR
  • Surface Mount is Easy
  • Programming PIC Micros
  • Custom PC Boards
  • The Gerber Format

  • General Articles
  • Problems in Open Source
  • Hantek DSO-2250 Scope
  • Rigol DS1000 Scope
  • Brickbats

  • WEB Site
  • Home
  • Old or Obsolete Projects
  • About



  •  

     

     

    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0)

    GPS Tracker

     

    The GPS Tracker is a small gadget that will record exactly where your vehicle, boat or aeroplane has travelled over time. It is intended to be wired into the ignition of your vehicle and then forgotten.

    It will record your travels in Google Earth format, GPS Exchange format or as raw NMEA data and using software such as Google Earth you can then see your trips mapped onto the surface of the earth with a resolution of a few meters.

    A great device for off road drivers, sailors, farmers and gray nomads the GPS Tracker can record a lifetime's worth of travelling on a single SD card.







    The design for the GPS Tracker was published in the November 2013 issue of Silicon Chip magazine.  This web page briefly describes the device but you will find much more detail in the article.  You can purchase access an electronic version of the November 2013 issue using the above link for AU$8.20 and this small investment is well worth it if you are intending to build the GPS Tracker.

    If you are looking for a firmware update, that will be listed in the Downloads section at the bottom of this page.

    What Does It Do?

    The GPS Tracker will automatically record your vehicle's movement on an SD card.  It will start recording when power is applied and the record will be closed when the power is removed.  Normally the Tracker is connected to the vehicle's ignition system so that it is powered up every time the vehicle is used.  This means that it will record each movement of the vehicle as a separate file (called a track).

    The data can be recorded in any combination of the following formats:

    1. Google Earth KML format. If you have Google Earth installed on your computer you only need to double click on the KML file recorded by the GPS Tracker and the file will open up in Google Earth showing your track over the surface of the Earth. All of the examples in this web page are screen grabs from Google Earth.
    2. GPS Exchange GPX format.  This is an open format used by many mapping applications.  In particular you can use it with software that will use the time stamp in your photographs to add the latitude and longitude of where the photograph was taken.
    3. NMEA data (recorded with a .TXT extension).  This is the raw RMC and GGA records from the GPS module and there are many applications that can use this data in interesting ways.

    The SD card can be formatted in FAT16 or FAT32 and can be up to 64GB in size.  With an 8GB card you can typically record about a million kilometres of travel. 

    In the downloads section at the bottom of this page there are a number of tracks recorded by the GPS Tracker, so you can download them and try them out with your favourite mapping software.  The images below will also give you an idea of what the output looks like.


    Here you can see the exact track of the vehicle (in red) as it went through the roundabout.

    This image came from Google Earth.

















    In this camping trip you can see exactly where the group stopped for lunch.

    In Google Earth you can click on the yellow marker to get the precise latitude and longitude of the location.











    This is an example of a long trip displayed in its entirety.  In Google Earth you can zoom in to see the trip in detail, even to the extent of observing the traffic lane that the vehicle travelled in.

    The yellow marker time stamped at 9:36 is an hourly marker added to the track to indicate progress on a long trip.  The time interval for these markers is configurable.

    Google Earth allows you to join together many different tracks recorded over many days to make one large track.  You can use this feature to display the whole of your travels, even if it was a three week tour in the country.







    The POI Input

    You can connect a push button switch to the POI (Point of Interest) input to the Tracker and when it is pressed it will cause the Tracker to do one or more of the following (these are configurable):

    1. A yellow pin will be placed on the KML track with the time and distance from the start.  This can be used to record an interesting location such as a good fishing spot.
    2. An entry will be made in an Excel compatible spread sheet (called LOG.XLS) recording the date/time and latitude/longitude of when the button was pressed.  This will give you a handy record of your points of interested without having to look through all the KML tracks.
    3. An entry will be made in a second Excel compatible spread sheet (called DIARY.XLS).  This spreadsheet will record the date/tine and starting/end latitude/longitude  of every trip.  If the POI button was pressed the distance for the trip will be recorded in the "Business" column otherwise it will be recorded in the "Private" column.  This can be used to justify a tax deduction for business use of a private vehicle.

    File Structure

    The Tracker records one file for each trip (ie, when you start the engine and travel more than 100 metres).   To make it easy to locate a particular trip the data is recorded in a number of subdirectories on the SD card. 

    At the top level of the SD card (the root) the two spreadsheets (described above) are recorded along with three directories or folders, one for each format (GEARTH, GPX and NMEA).  Within each of these directories there is a second level subdirectory for each month/year.  And within these subdirectories there are multiple files, each containing one trip.  The file name of each trip file contains the day and a sequence number so, for example, the path to the 5th trip on the 10th March 2014 would be:  \GEARTH\2014-03\10--#05.KML

    Configuration

    When you place a blank SD card in the Tracker and power it up, it will create a standard configuration file (called TRACKER.TXT) on the card.  This file is read each time the Tracker is powered up and you can edit it (using a plain text editor like Notepad) to suit your requirements.

    The following is an example of a configuration file (the comments make it self explanatory):

    Technical Details

    All components are mounted on a single PCB measuring 137mm by 69mm which fits in a standard instrument case (a detailed parts list is included in the Construction Pack downloadable from below).

    The following illustration highlights some of the technical features of the design:



    The circuit for the GPS Tracker is shown in the image below (click on the image for a high resolution version).

    It consists of three main sections.  The first is the power supply which uses a high efficiency buck converter from Microchip.  Because of the large reservoir capacitor (4700µF) the power supply can maintain the 3.3V power to the processor and SD card for up to 2 seconds after the power has been removed.  This gives the processor plenty of time to flush its buffers and safely close the files on the SD card, even with all possible files open at the same time.

    The Tracker is intended to be connected to the vehicle's ignition circuit (ie, 12V when the engine is running).  It can be permanently connected to the fuse block or plugged into a cigarette lighter style outlet.

    Click on the image for a high resolution version


    The other section of the circuit is the GPS module, Q1 and the SuperCap.  Q1 is is a MOSFET which is used to cut the power to the GPS module and indicator LEDs when power is removed.  This minimises the power drain and allows the 3.3V supply to hold up longer after the ignition has been turned off.  The GPS module is the UP501 from Fastrack and can be purchased from RS Components (part 716-5283) or Element14 (part 2113837).  A six pin header is soldered to the module which is then plugged into a header socket on the PCB.

    The GPS Tracker will also work with the EM-408 GPS Module.  This comes with a cable which needs to be soldered to a six pin header which can then be plugged into the PCB (details are in the Construction Pack).  The only problem with the EM-408 is that it does not have an obvious method of mounting it.  However, with a little ingenuity and foam packing material it can be kept securely in place.

    The GPS module needs a backup supply to keep its memory alive when the power is removed.  By doing this the module can get a fix much more rapidly (in 10 seconds vs many minutes).  This is accomplished with the 1 farad SuperCap which can provide backup power for up to a week.  If you use the EM-408 you should omit the SuperCap and associated resistor and diode as the EM-408 has its own internal SuperCap.

    The third section of the circuit is the microcontroller and the SD card.  The processor is a Microchip PIC32MX250F128B-I/SP which has a 32 bit processor core, 128KB flash and 32KB RAM.  It comes in an easy-to-solder 28 pin package and costs just US$3.80 in one off quantities (direct from Microchip).  At this cheap price there is no point looking at 8 bit or 16 bit processors - the 32 bit processor is just as cheap and has lots more power.

    Constructing the GPS Tracker

    The easiest way to build the GPS tracker is to purchase it as a kit of parts.  These come with the microcontroller pre programmed, a copy of the magazine article and all parts.  They do cost more than sourcing the parts yourself but it is certainly easier.  Jaycar is offering a kit of parts (GPS Data Logger Kit Cat Nbr KC-5525) and will post the kit to anywhere in the world.  At the time of writing they are currently preparing the kit and may not have it immediately listed on their website - so check back regularly.

    If you would like to source your own parts (it is not hard) you can get the important components from Silicon Chip magazine.  These include the printed circuit board, the microcontroller pre programmed with the appropriate firmware and some of the more specialised components such as the voltage regulator and inductor.  Follow this link for the Silicon Chip on line shop.

    Everything else you can get from your parts bin or purchase over the counter.

    The Construction Pack (downloadable from the bottom of this page) contains the full parts list, circuit diagram, firmware, photographs, PCB design files (so that you can get them made yourself) and more.

    During construction there are only a few areas where you should be careful:

    When you are experimenting with the Tracker on your workbench be aware that it will only record a track when the vehicle has moved by more than 100 metres. This feature was included so that it did not record unimportant movements like repositioning the vehicle in a car park.

    Installation

    If you are using the two optional inputs (POI and NEW TRACK) then you should note that they are intended to be used with a switch that shorts them to ground. The maximum voltage on these inputs is 3.3V so don't connect them directly to the vehicle's 12V system.   If you want to connect the NEW TRACK input to the ignition circuit use a diode so that the input is only pulled low (not high).

    The NEW TRACK input is provided so that the Tracker can be permanently connected to power if required. Then this input, when shorted to ground, will signal that the current trip has finished and, when released, will start the recording of a new track. The advantage of keeping the GPS receiver powered up is that there will be no delay in it getting the current location. Also, because of the efficient power supply design, the Tracker only consumes about 50mA and that level of permanent drain can be acceptable in a vehicle that is driven often.

    The POI input uses a programmable pull-up resistor incorporated into the chip to pull the input up to a logic "high" level.  When this input is shorted to ground by a switch the POI will be recorded.  This is not a strong pull-up and with the switch mounted on the dashboard of the vehicle the long wire might pick up noise resulting in false POIs being recorded.  If this happens a 3.3K resistor should be connected between pins 25 and 28 on the microcontroller on the underside of the PCB.  This would provide a strong pull-up that should be immune to noise.

    The GPS Tracker can be installed on the dashboard, on the rear parcel shelf or under the dashboard.  In that last location the GPS signal level could be insufficient and in that case the GPS module should be remotely mounted where the signal level is stronger and connected to the Tracker by a six core cable.  If you are using the EM-408 module you can attach an external antenna which will provide a tremendous boost in sensitivity.

    Frequently Asked Questions (FAQ)

    Can the tracker run off batteries for portable use?

    It could be powered from nine AA cells but that is not very portable.  I plan to produce a portable version (hopefully in the first half of 2014) which will get 20 hours from two AA cells and be small enough to be clipped to a belt.

    The voltage regulator (MCP16301T-I/CHY) is in very short supply.  Can you recommend an alternative?

    You could use the Microchip MCP16301T-E/CH with no change to the circuit or the Linear LT1933ES6 which requires that a second 27K resistor be wired in parallel with the current 27K resistor (so that the combined resistance is 13.5K).  Both have been tested and work fine.

    I am trying to use the EM-408 GPS module from dx.com and it just refuses to work.

    There is a variant of the EM-408 that has an RS-232 output and you may have one. Check my page on the EM-408.

    Does the Tracker compensate for daylight saving?

    No, you need to manually change the TZ configuration setting to adjust for daylight saving.

    I have a solid fix and no errors, but any track on the card is zero bytes in size.

    A track with a length of zero bytes is an indicator that the microcontroller was not able to close the files before the power failed. Normally power to the microcontroller is held up for about 2 seconds after the 12V input drops to zero which is plenty of time to close the files. Your problem could be because the power supply is faulty or the 4700 µF capacitor is faulty or not present.

    I have checked the power supply and the 4700 µF capacitor but I still get zero length files.

    Another possibility is that the 12V input voltage to the tracker does not fall to zero promptly when the ignition is turned off. Normally there is other circuitry connected to the 12V circuit in a vehicle that will pull it low but if the power to the tracker is just disconnected the power input will float and the microcontroller will not see this input fall to zero - as a result it will not close the files before the power fails resulting in zero length files.  The fix for this is to wire a 2.2K resistor across the power input to the tracker.

    When the vehicle is stationary (eg, at a red light) the track appears to move about over a small distance.

    This is due to the uncertainty in the GPS position data due to atmospheric variations that delay the signal from the GPS satellites.  It is normal and is less apparent when the received signal level is high.

    Updated Firmware

    An updated version of the firmware (V1.2) is listed in the Downloads section below.  It adds support for the PAM-7Q GPS module (the PAM-7Q is a drop in replacement for the UP501), it adds the ability to configure the distance for ignoring small movements and it fixes one bug which can cause corruption of the SD card file system.

    None of these are critical so you do not need to update the firmware if they are not important to you.

    Due to an issue in the bootload firmware in V1.1 this update can only be loaded via a PIC32 programmer. Also, this version does not include a bootloader, so subsequent versions will also need to be loaded via a PIC32 programmer.  These are very cheap and easy to use - see this page for details..

    To save you from having to check this web page all the time I can also send you an email when an update is available.  To enable this please enter your email address in the box below and click on Submit.  Your address will be held confidential and will only be used to notify you of an update.

                                          

    Downloads

    Firmware V1.2 update (requires a PIC32 programmer to load - NOT the bootloader) DOWNLOAD
    Examples of data recorded by the GPS Tracker (KML, GPX and NMEA files) DOWNLOAD
    Windows Serial Port Driver (for connection to the GPS Tracker via USB - Windows only) DOWNLOAD
    GPS Tracker Construction Pack (circuit diagram, parts list, firmware, etc) DOWNLOAD
    Firmware Source Code V1.2 (requires MPLAB X and XC compiler - free from Microchip) DOWNLOAD