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
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.
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.
During the project we encountered several issues that were addressed.
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.
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:
The software blocks designed to drive the peripherals and to control application flow.
During the development we had to implement several drivers:
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 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.
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.
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.
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)