PIC16F88 Delorme Tripmate GPS Logger
This project focused on creating a simple serial data logger for the Delorme Tripmate (also known as the GPSTripmate). The Tripmate is an older GPS receiver that can be purchased on eBay for <$20. I happen to have one that my family used a couple of years ago and it is still in great shape. It has been sitting in the back of my car for the past four years, so I finally decided to put it to good use. The plan was to create a GPS data logger that would record the position of the unit and allow me to read back the latitude and longitude after acquiring the data. My ultimate goal will be to use a small backpack to record my runs (once the weather warms up). This was a fun experiment because not only did I need to interface the PIC16F88 to the Tripmate, but I also needed to parse the output and implement an efficient storage solution. Read on to find out more information about the project, see the schematic and soure code I wrote, and find out how the data was visualized.
The Tripmate was a GPS receiver manufactured by Delorme that was originally intended for use with their Street Atlas USA computer program. The Tripmate uses an RS-232 serial connection to send and receive data using the NMEA 0183 standard (i.e. 4800 baud, 8 data bits, 1 stop bit, no parity). The one interesting quirk about the Tripmate is that it needed to receive the string “ASTRAL” before it would output any information. I modified my Tripmate to self-start using a loopback modification. Now the Tripmate will output the NMEA strings whenever it is powered. More information about the self-start modification can be found on these websites:
- Modify the Delorme Tripmate to selfstart
- Tripmate Self-Start and External Power Mod
Once the Tripmate is modified to self-start, it will automatically output position and satellite information when power is applied. The sentences that the Tripmate outputs are GPRMC (Recommended minimum specific GPS/Transit data), GPGSA (GPS DOP and active satellites) GPGGA (GPS Fix Data), and GPGSV (GPS Satellites in view). We are specifically interested in the GPRMC sentence for this project.
$GPRMC sentence information
An example $GPRMC sentence sent by the Tripmate would be:
This sentence contains the following information:
123456 UTC Time of fix 12:34:56
A Navigation receiver warning (A = Valid, V = Invalid)
4234.4594,N Latitude 42 degrees, 34.4594 minutes North
11233.2892,W Longitude 112 degrees, 33.2892 minutes West
010.0 Speed (Knots)
022.7 Course Made Good (Degrees)
220107 UTC Date of fix January 22, 2007
015.5,W Magnetic variation, 20.3 deg. East
The job of the microchip will now be to parse this data, discard any irrelevant information, and store the variables of interest (Latitude and Longitude).
Here is the full schematic for the driver. I chose to use a PIC16F88 as the microcontroller it is cheap, has a high speed internal oscillator (8MHz), an internal USART, and is bootloadable. I will discuss each of the components below. As always, the part numbers for the components are linked to websites for data and more information when available.
UPDATE (February 9, 2007)
Terry pointed out that there is a mistake in the schematic. Pin 8 on the PIC16F88 (USART RX) should go to pin 3 on the MAX233 instead of pin 2.
UPDATE (February 20, 2007)
The schematic has been corrected.
UPDATE (May 10, 2007)
Rogerio pointed out another mistake in the schematic. Pin 11 on the PIC16F88 (USART TX) should go to pin 2 on the MAX233 instead of pin 1. It looks like the original mistake that I made was to shift the two lines one pin up when drawing up the schematic. The schematic has been corrected.
This is the only component that is ambiguous in the schematic. I use 4 AA NiMH batteries in series, giving me a supply voltage of approximately 4.8V (NiMH AA batteries are ~1.2V cells). This is very convenient because I can recharge 4 AA batteries for the Tripmate and 4 for the logger circuit and so far I have found that they last quite a while. However, if you want to use a 9V battery or alkaline batteries, I would suggest using a low-dropout voltage regulator to ensure that you don’t burn out the ICs.
I use a MAX233 as I do in my RS-232 Level Converter. You are more than welcome to substitute any suitable RS-232 level converter; however, the MAX233 is nice because it has internal capacitors. The MAX233 is used to convert the logic level signals of the PIC microcontroller to RS-232 compatible voltage levels for both the Tripmate and the computer. Although the MAX233 should nominally be run at 5 Volts, I have found that it works perfectly fine at 4.8V. The serial connection in the schematic is set up for a computer connection. To log data from the Tripmate, you must use a crossover cable that swaps the TX and RX serial data lines.
The microcontroller used is a Microchip PIC16F88. I initially programmed the PIC with the Tiny PIC Bootloader (tinybld16F88_i8MHz _19200.hex) so that the PIC would run at 8MHz using its internal oscillator. Whenever the firmware is updated, I can re-flash the PIC using the Tiny PIC Bootloader program. This allows for quick and easy debugging. R1 is a pull-up resistor necessary for operation. R4 and R5 are resistors for the status LEDs (LED1 and LED2). R6 is a pull-down resistor for the mode switch (S1).
The 24LC1025 is the EEPROM used in this project to store the latitude and longitude information. The 24LC1025 is a 1024K bit Serial EEPROM. The 24LC1025 can be read with a clock frequency of 400 kHz and has a 5 ms write speed. It has a rewrite endurance of 1,000,000 cycles and can operate between 2.5V and 5.5V. The 24AA1025 or the 24FC1025 can be substituted for the 24LC1025 in this project if necessary. I used a custom library to read and write bytes to the EEPROM. R2 and R3 are pull-up resistors for the Serial Data and Clock lines.
Theory of Operation (Aquiring and Recording GPS Data)
- Crossover cable is used to connect Tripmate and circuit
- Tripmate is turned on (batteries are put into the case)
- Circuit is turned on
- Mode switch is pressed after power is connected to begin data logging
- LED1 (pinLEDSTATUS) will turn on when the GPS unit has aquired a fix (i.e. Navigation receiver warning = ‘A’) and is recording data to the EEPROM (Please note that it can take over 5 minutes for the Tripmate to aquire a fix)
- Disconnect circuit power to end data logging
- Turn off Tripmate
Theory of Operation (Reading GPS Data)
- Normal serial cable is used to connect computer and circuit
- Open serial terminal application to record Latitude and Longitude data
- Power circuit with mode switch depressed to read back GPS data stored on EEPROM
- Disconnect circuit power to stop reading data
The PIC16F88 must initially programmed with the â€˜tinybld16F88_i8MHz _19200.HEXâ€™ hex file to program the bootloader on the PIC. Then, using Tiny PIC Bootloader, the hex file can be placed on the chip using the Tiny PIC Bootloader frontend. Please feel free to contact me if you have any problems.
- Raw data output from PIC16F88 Delorme Tripmate GPS Logger: TestCapture.txt