Portable GPS Tracker Project

Aviv Goll [avivgoll at gmail dot com]
Aviv Grafi [agrafi at gmail dot com]

Embedded Computing Course
Prof. Sivan Toledo Tel Aviv University Fall 2011

Goal

The goal of the project is to build a portable GPS tracking device that can be used for tracking course while walking, running or driving.

The device will record the acquired coordinates in KML format to a SD/MMC based File System so the tracked course can be easily processed by GIS software such as Google Earth/Maps.

Due to portability requirements, the device is battery powered so power efficiency is required. The device will have idle/Low-Power mode to enable power consumption reduction mode.

Challenges

During the project we encountered several issues that were addressed.

Use Case - Application Flow

Application Flow

The device is meant to be powered at all times and the power consumption in idle mode was tuned to enable about a month of battery life. In reality our board was equipped with several additional peripherals such as an RF transmitter and voltage regulator which made the current consumption higher than expected – so we added a main power switch.

When the device is on - it’s in either a track mode or idle mode (selectable by the Idle switch).
In track mode it is recording GPS coordinates to a file. The LED is constantly ON until the 1st valid coordinate is acquired, then it's starting to blink periodically for every valid acquired coordinate (pre-configured for every 5 seconds).

When switched back to idle mode using the idle button, it shuts the GPS power off, closes the file and transits to sleep mode until the next recording request. In this state the LED is constantly OFF.

Hardware

The hardware is proprietary board that was used for other unrelated project and was donated to our project and adapted to our needs by Virtual Extension. The main blocks are presented in the following diagram:

Hadware Diagram

Software

The software blocks designed to drive the peripherals and to control application flow.

Software Diagram

Drivers

During the development we had to implement several drivers:

File System

The implemented File System is FatFS Version R0.09, which is a FAT16/32 implementation based on modular disk I/O routines.

The disk I/O routines we implemented are based on the SD/MMC init/read/write routines that were adapted from an example by Texas Instruments.

We also used the acquired GPS data to adjust the file system time stamps (so the creation/modification timestamp will be accurate).

NMEA Reader

NMEA is a standard GPS data protocol which is a default output from the GPS module we used.

We used some proprietary messages to setup which specific NMEA message we would like to receive. We tried several messages types such as GLL, GGA and RMC messages. Eventually, RMC was chosen for its detailed timing format.

The NMEA reader module is a string-parser which translates the received RMC message to a usable data structure. We defined two possible modes: Valid for GPS fixed based message and Invalid for no-fix GPS message.

In addition, the module converts the ddmm.mmmm of the NMEA format to decimal degrees according to the formula:
    Deg = dd + ( mm.mmmm / 60.0 )

This module was written by us.

KML Writer

As an output format we chose KML files which are compatible with Google Earth PC software. We used a constant XML template (header + footer) that we filled with the parsed coordinates (Latitude and Longitude) received from the NMEA reader module.

The file name is the time of the first fix in MMDDHHmm.KML format. Samples can be found here.

Tests and Samples

 

SD-SPI Schemes

As mentioned earlier, we designed the SD-SPI interface including the electrical scheme:

The line names are compatible with the board electrical scheme we got.
This wiring was implemented by a professional technician and it looks in reality like that:

As part of the development we integrated the SPI layer based on TI source code examples. We had several integration bugs, mainly on SPI interface and initialization routines that we had to solve by carefully following the wires states using Oscilloscope that connected to pins 1, 2, 5 and 7 of the SD/MMC card.

Pictures of the board:

Side 1: The micro-controller, GPS module and LED.

Side 2: The SD House, GPS antenna (pink wire) and custom SD/MMC SPI wiring..

Entire device: The board, battery and 2 switches (orange wires are connected to the idle switch)

Front

Back

Future Possible Enhancements and Ideas

Source Code

The source code is hosted on Google Code repository and can be obtained by visiting the project page. Project presentation can be found here