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.

Delorme Tripmate
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:

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:
$GPRMC,123456,A,4234.4594,N,11233.2892,W,010.0,022.7,220107,015.5,W*77

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
*77 Checksum

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).

SchematicPIC16F88 Delorme Tripmate GPS Logger Schematic
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.

Power Supply
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.

MAX233
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.

PIC16F88
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).

24LC1025
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)

  1. Crossover cable is used to connect Tripmate and circuit
  2. Tripmate is turned on (batteries are put into the case)
  3. Circuit is turned on
  4. Mode switch is pressed after power is connected to begin data logging
  5. 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)
  6. Disconnect circuit power to end data logging
  7. Turn off Tripmate

Theory of Operation (Reading GPS Data)

  1. Normal serial cable is used to connect computer and circuit
  2. Open serial terminal application to record Latitude and Longitude data
  3. Power circuit with mode switch depressed to read back GPS data stored on EEPROM
  4. Disconnect circuit power to stop reading data

Source Code
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.

Example Output

  • Raw data output from PIC16F88 Delorme Tripmate GPS Logger: TestCapture.txt

40 thoughts to “PIC16F88 Delorme Tripmate GPS Logger”

  1. this is a sweet project, however I’d love to see a hack where you can add a backlit LCD screen and have it function as a simple, portable speedometer. Maybe even add a readout for course direction.

    Sweet hack tho

  2. It’d be slick to exchange some of the EEPROM’s coordinate storage space for time stamps. With time you could go back and calculate velocities.

    A 12v power supply would be handy for an automotive application.

    Very cool project! Much appreciate your willingness to write it up and share.

  3. I agree with #4. Timestamps would be great. I woudl want them so I could Geotag my photos.

    Code to log position with time stamp once every 1 minutes is sufficient for this. Even sending the PIC into a sleep state between captures could help extend battery life.

    A pre-programmed PIC would be great for us novices. Any chance of selling them? Even a kit of parts?

    I see you can get MAX chips that work off ~3V and so will the PIC. This is great as I have a Holux GPSlim 236 which has it’s own rechargeable L-ion battery and has serial and 3.8V supply output port so no additional battery back required.

  4. I was turned onto this from the Cr-4 email. I love this! I am a land speed time trials car driver/owner. This would be perfect as a stand alone speedometer in my race car! I have very little electronics capabilities but if this were available in easy to follow steps to modify the gps receiver, and then to add a simple 3 and a half digit LCD display it would be really great. We all get timing slips, as we motor down the salt, at one mile increments but this would be great data to have in between the mile markers. Oh, how fast does the gps unit update? I drive in the 200 to 250 mph speed range and at 200 mph that covers about 300 ft every second. So update speed would be key here also.

    Many thanks for listening. I would love to hear from anyone else regarding the use as a speedo. you could send email to drmayf@yahoo.com

    many thanks,
    drmayf

  5. #8 Older GPS units update about once per second. I believe SRFIII GPS (the new types) can update 3 times a second but you may need to set them up for a fast Serial speed in order to get the info to your logger that fast.

    #9 A clear view of the sky is best for all GPS units. The more trees, building or objects the GPS is packed underneath all degrade the signals to a point where it may no longer provide a lock / position. The Newer SRFIII type GPS unit are extremely sensitive, mine will get a fix from inside my house. Many modern GPS also allow you to boost the sensitivity by using an external antenna.

  6. Very cool project…Thinking of making robotic submarine with some sort of gps built
    in. As for sending the data to lcd, it should be no problem to add this on. There is
    tons of info out there on PIC’s driving LCD’s, tried it myself with minimal problems.

  7. #11 Driving the LCD is the easy part, the hard part is that the PIC would need to do trigonometry math. To get speed you have to convert two coordinates into distance, then divide by elapse time. To convert coordinates into distance, you have to look at the world as a sphere, this is where your Sin/Cos/Tan comes into play. If I’m not mistaken, the PIC would have to contain Sin/Cos/Tan tables to accomplish the math required. Perhaps there is an easier way to do this?

  8. haha. I didn’t see the speed variable in the NMEA sequence. I did some GPS software development work a few years back and the NMEA version we were using didn’t include speed so we had to calculate it. Your method seems like a much easier approach. (grin)

  9. Hey all, please excuse the delayed response, I’ve had a nasty cold and haven’t been able to respond to the comments. So here goes nothing!

    #1 (Florian) – Right now the PIC16F88 is jam-packed with code, so I’m not sure if I could efficiently add the code to read and write MMC/SD data. In addition, I would need to use a PIC with more memory because the MMC specification requires that I write whole 512 byte pages at a time (and not fractional parts thereof). However, if this project is transitioned to an 18F PIC, then it would not be a problem to add the necessary code. It would even be possible to implement a simple FAT file system to save files that could be directly accessible on a computer.

    #2 & #6 (Francesco) – Thanks Francesco!

    #3 (Tony) – Making this into a speedometer/bearing readout would be very easy. The GPS outputs the heading as well as the ground speed in knots, so all that you would need to do is to add the LCD code and convert knots to km/h (1 knots = 1.85200 km/h) or mph (1 knots = 1.15077945 mph). The only reason I did not save speed or heading was because all I wanted was position information. To be honest, speed is also something important to include, so I’ll definitely include it in my next iteration.

    #4 (Craig) – The time information is a good variable to record as well. I would be tempted to include the date too if the application is a longer-term position log. However, if you interest is in deriving the speed from location information (literally dx/dt), then you can do that right now with ok accuracy with this firmware. The Tripmate transmits the position and satellite information at 1 Hz (1 time per second), so you could use the latitude and longitude information, plug it into the Haversine formula, and have estimate of the distance traveled per second. Ohh, and as for the 12V power supply, that can be created using a 7805.

    #5 (nemi) – Timestamps are a good idea, I agree. The only reason I did not include them was because the original intention of this project was just to record run routes, which did not require time or speed info. However, I’d like to possibly expand this project to a more universal GPS data logger with more configurable settings. As of right now the only options are read and write. :-p As for selling the PICs, I have no intention of selling programmed PICs for a profit; however, I would be happy to program any PICs sent to me and send them back at-cost (i.e. postage). I actually have a couple of PIC16F88s lying around that I would be happy to program with the bootloader and GPS firmware. The beauty of having the bootloader is that you would be able to reprogram the PIC using any computer with a serial port. I love it.

    #7 (ohararp) – Neat circuit! It’s nice to have all of the components including the GPS receiver, logger, and battery charger onboard. This project was an attempt at making a barebones cheap gps logger that worked well. So far I feel like I’ve accomplished that goal for hobbyists and do-it-yourselfers, but you do have a very nice board.

    #8 (drmayf) – The Tripmate sends position and satellite information at 1 Hz. If you cover 300 feet per second, then this might not be the best for a high speed time trials participant such as yourself. However, these GPS units are often used by amateur pilots and their accuracy is often quite good (although you might want to look up information about WAAS). The units send speed and heading information, so it would be very easy to capture that and output it to a screen, but the update rate would only be 1 Hz.

    #9 (nathan) – The Tripmate needs a clear view of the sky for its initial satellite acquisition. It is older GPS technology, so it may not (and in my case usually does not) acquire a fix when there are any obstructions. However, once it acquires a fix, the Tripmate is usually ok when traveling through wooded areas.

    #11 (Dave) – I wonder how well the GPS would work underwater. Don’t forget, GPS signals are electromagnetic waves which are just as prone to refraction as any other wave.

    #12 (Craig) – I agree, the trigonometry is a pain on the PIC, requiring either lookup tables or wasteful floating point routines. I would recommend avoiding it if possible and use the speed in the $GPRMC NMEA sentence.

  10. this is an interesting project that seems quite easy to make…but it would be great if you could post some more photos (close-ups of the finished product, etc.).

  11. #15 (john) – Thanks! I’ll be more than happy to include some better pictures when I get home. I have to say that my perfboard layout isn’t very pretty (tons of flywiring), but I’m more than happy to post more pictures if you are interested. I’d love to make a PCB (either handmade or fabbed), but the costs can be prohibitive for a project like this. Come to think of it, that would be great to have a PCB fabbed… I could add on an additional 3 24LC1025s for even more storage or alternatively I could look into using a PIC18F microcontroller with a MMC/SD card.

  12. i was wondering if this device would work as a data logger for any rs232 devices so that it just stores the information from the machine etc to the memory card for later processing on a computer

  13. #17 (andrew hough) & #19 (lee) – Yes, it could be modified to log any serial to the EEPROM. Right now it is configured in such a manner that it will only log the GPRMC sentence, but it can easily be modified.

  14. Hello again Steven, you have other bug in the schematic, pin 11 from PIC goes to pin 2, not 11 to 1, check the pdf of max233, i have spend 2 hours do discover this because i dont have pulses in bootloader comming to com port, im going to try connect to a bluetouht gps, i disable the BT and found the rs232 ports in pcb, but the gps send mnea commands at 9600 bps, can you change the hex for me please, or tell me what correct program to assemble your .c (asm).
    Thanks and best regards
    Rogerio from Portugal

  15. #21 (Rogerio) – ARGH!! You’re absolutely correct! I’ll fix the schematic immediately. I should just make a MAX233 part in Eagle, which would eliminate all of the confusion. I’m sorry that it caused so much frustration, but I really appreciate your double checking the MAX233 datasheet.

  16. Hi, Just found your project during a websearch for a GPS datalogger.
    Has anyone modified this idea to be used solely as an accurate Odometer?
    I am looking for a ‘sure-fire’ PIC based system I can build that will log 2 hours worth of travelling time and display the total miles travelled.
    This is for a radio club transmitter hunting competition where competitors have to Direction Find (DF) the transmitter in the shortest time and distance.
    I am pretty adept with the electronics side of this but not a PIC programmer.
    Thanks in anticipation….Dave

  17. hi,
    thank you for this project. i’d loke to build it, i’m new in microcontroller, could you please guys to help me.
    does anybody have GPSTripmate for sale, i couldn’t get to start my first gps data logging project.
    what i want to do is logging a voltage and save it with repect to the gps coordinates.
    so please again help me guys
    thank you very much

  18. I have no idea how to act on the information presented here, but I’m sure glad someone is tampiring with the dripmate. It’s probably a well known fact, but the software that came with the thing had a fatal y2k bug. A few years ago found a Qbasic routine that at least gets me back the ability to retrieve coordinates from the (expletive deleted) thing. Will the stuff posted here allow me (should I actually somehow do the project) to lose the laptop, or simply to interface to it in a less (?) proprietary way?

  19. I have posted, with Steven’s permission, a version of his GPS with time and speed for the PIC18F2550 which also uses his graphical LCD drivers for the 128×64 pixel LCD. It will display the datum as well as log it. It also parses the GPGGA sentence for the altitude information. You can find it on this website: http://www.cvtelectronics.com/GPS.html

    Peter

  20. I picked up a trip mate for $0.50 at a yard sale. 🙂

    I’m going to be trying this with some modifications. Thanks for the source code.

    1. I will only store the value if the diff between values can’t be stored in a byte. This will allow me to write over 5 days of infomation to the EEPROM.

    2. I will code the PIC to send “ASTRAL” to the tripmate rather than modifying the trip mate. (I’m really really curious why you didn’t do this, My other thought was to use a single throw double pole switch hooked inline on the serial cable to get the thing started, so modification wouldn’t be necessary and I could use it with other serial devices.)

    3. I am going to try to power the tripmate and the pic off the same battery source.

    4. I may use a secondary PIC and board to run an LCD screen.

    Abitious, maybe, but I’ve got lots and lots of time to figure things out. If you or anyone else reading this wants to track my progress, I will be posing it online hopefully soon.

    I do have some questions, however, I am well aware that tons of people ask you questions feeling you are obligated in some way to answer them. Please only respond to my questions if you are so incline.

    Questions:
    1) I noticed on some of your other projects you mention that you use the CRC compiler. I am quite poor and can’t aford anything but the feebies on MicroChip’s website or wherever else I happen to look. Am I going to have a problem compiling your code with one of these? Is there a way I can rectify any problems?

    2) Is there any other problems you want to warn me of?

    Thanks, if you are interested I’ll keep you posted. If not… Well when I have a site set up with the project I’ll post it here then and anyone who’s intrested can have a look.

    Awesome project thanks for helping on a jumpstart by posting what you did.

  21. i i need help find out how to get the software for my gps and how to make a seril to usb and maybe a sd card piece to go with it can anyone help me

  22. Pingback: Remembering my Tripmate™ GPS… « Kuya Marc's Electronic Projects
  23. @mark

    It will sort of…

    The hyperformance uses “EARTHA” as the string instead of “ASTRAL”.
    Also and this is where it gets complicated, the hyperformance uses binary data instead of a $GPRMC sentence.

    So what does all this mean to you? Well the code has to be rewritten to handle the binary data but the circuit is exactly the same.

    I know it was nearly a year ago you asked this question. But I thought I would provide the answer in case anyone stumbled along here. If anyone has questions about the hyperformance, you can e-mail me at hyperformance(AT)learn2think.org. Of course replace (AT) with the appropriate symbol and hopefully that won’t garner to much spam.

  24. friend, built the circuit as it is, load the pic. Button to start works, also performs the reading, but can not get the circuit to work when the GPS already has an A in the plot GPRMC, simply EEPROM LED does not light, but if it does for downloading recorded data but as no do not get anything valid, I can do?

  25. Hi,

    I am looking for a GPS developer who can make GPS system for my company.

    Please contact me on = +91-9711343010

Leave a Reply