Fully functional Arduino GPS logger

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

There exist endless ways that you can use a GPS sensor in your projects. Geocaching and reverse geocaching are just two typical applications. Last time I made an attempt to use GPS with Arduino and my Phi-1 shield and it was a great success. The GPS sensor fits nicely under the LCD and I got lattitude and longitude readings of my home (checked on google map). This time I made up my mind to make it into a fully functional arduino GPS logger. It will feature a menu to choose from many functions including:

  1. Send data to PC
  2. Erase EEPROM
  3. Record GPS to EEPROM
  4. Display GPS coordinates on LCD
  5. Parameters

It took me more than one whole day, thanks to the winter break, to finish all the above and again provide the code freely to anyone that uses it non-commercially. If you use this commercially, come on! Don’t you think a whole day’s work deserve something especially if you’re planning to use it for montary gain? 🙂

Here’s some details:

Menu gives you several choices:
* Send to PC: sends recorded GPS information to PC via the USB connection.
Two modes are available:
Verbose mode generates information as shown below.
Non-verbose mode sends only the column labels followed by tab-separated data, ideal for spreasheet programs to import. You may copy and paste.
* Erase EEPROM: erases the EEPROM
* Record: records GPS information, lattitude, longitude, altitude, date, time, speed to EEPROM
* Display: displays the GPS coordinates without recording
* Parameters: allows the user to adjust parameters such as period between two consecutive recordings, PC data format, to start recording at which data entry and end at which entry.
* Up and down cycle through the menu options.
* Left, right, B act as confirm or enter.
* A escapes and only will preserve the latest value.

The verbose mode outputs human readable format but takes longer time as the USB link is only as fast as 115200BPS:

(I’ve blocked out the last 5 digits so you won’t find my exact location on map:)
Lat/Long(10^-5 deg): 45xxxxx, -94xxxxx Date(ddmmyy): 291210 Time(hhmmsscc): 5170500
Alt(cm): 33470 Speed(mph): 1.64

This is easy to read but very hard to import into a spreadsheet to analyze. So I added a non-verbose mode (choose under parameters). Here is its non-verbose output:

Lat(10^-5 deg) Long(10^-5 deg) Date(ddmmyy) Time(hhmmsscc) Alt(cm) Speed(mph)
45xxxxx -94xxxxx 291210 5170500 33470 1.64

(I’ve blocked out the last 5 digits so you won’t find my exact location on map:)
The above output can be copy+pasted to excel.

To make this GPS logger, you need the following:

Phi-1 shield kit from dipmicro.com

Arduino Deumilanove or Uno from sparkfun.com

GPS module from sparkfun.com

GPS connector from sparkfun.com

Here is the main page of the multi-functional Phi-1 shield, where you will find documentation, assembly guide pictures, and FAQs.

Here’s a picture of how to connect the GPS to the shield (only 3 wires are needed): If you have been following my posts, please make the change of wiring. On my last post, I used analog pins 0 and 1 to connect to the GPS. This was my first attempt and it cost me the two buttons B and A (since they’re using analog pins 0 and 1). This time I realized I only need one pin since I am not talking TO the GPS, rather, only LISTENING to it. So I am using pin 12 for this.

Here is a picture of the shield powered up and displaying menu:

Everything fits nicely together. Here is a side view:

Here is a video of the action: In the video I just went through the menu items and sent GPS data to PC. Next time I travel (even to work), I will take it and record my trip 🙂

Most importantly, the code:

Download code

TinyGPS library

NewSoftSerial library

A Phi-1 shield is needed. Please consider purchasing this multi-functional Phi-1 shield if you plan to prototype anything including LCD, GPS, clock, EEPROM, buttons, speakers, etc. I am sure you will enjoy it.

10 Responses to Fully functional Arduino GPS logger

  1. jim says:


  2. Pingback: GPS tracking – trip to the Cities « Liudr's Blog

  3. Badiganc says:

    What is your real name? Maybe I can reply you on your Facebook page.

    • liudr says:

      I’m sorry I don’t use facebook much. If you want me to email you, I can do that. Just reply to this post with a yes and your correct email address. You email address is not visible to viewers of this site, just to me 🙂

  4. Hajo says:


    the gps-module is out of stock and perhaps a little old. I want to dig into APRS for Hams. Have you a recommendation for a gps module in connection with your PHI-1 shield?

    All the best

    • liudr says:

      Unfortunately I don’t know enough about APRS to give a suggestion. The module that is out of stock fits between the LCD and the shield nicely. If you want to use a different module, you need to either have it fit there or keep it off the shield and pass a few connections to the shield. If you find a GPS module you like, let me know. I want to look into it.

  5. iran says:

    Thanks for posting this. Could you pls tell me how accurate is this GPS module? Do you think it will work for an indoor application?

    • liudr says:

      GPS only works where there is an open sky. You will get very poor reception indoors if you get reception at all. The accuracy of the GPS is the same order of magnitude as any commercial GPS units so I bet a few meters/tens of feet. Google EM-406A you will probably find a link to sparkfun.com where this model is sold and there might be a spec sheet.

  6. kvan says:

    i am quite interested in trying to build this but i might need some pointers.
    can i have your email?
    Just so if there is any problem i can just email rather than wait here.

    • liudr says:

      Please just post questions on the phi-2 shield blog page. This way my answers are also visible to other potential users.

Leave a Reply