Arduino GPS System

A fully functional GPS receiver with the ability to display the current location, heading, speed, average speed and maximum speed, the distance traveled, the bearing, distance and ETA to a way-point or coordinates, and the date and time.

Description

This is a sketch to interface an Arduino, SparkFun GPS Shield, digital compass (optional), and Nuelectronics LCD Keypad Shield together in a useful way, providing all the functionality of older commercial GPS receivers.

The sketch provides four modes of operation: current location, heading and speed; distance traveled, average and maximum speed; bearing, distance and ETA to a set of coordinates or a way-point; and the date and time. In addition, up to 20 way-points can be saved with names, so you can build a library of locations you have visited or plan to visit later. All settings can be configured on the fly from a configuration menu, and the settings and saved way-points are saved in EEPROM so they are persistent between power cycles.

The sketch uses Mikal Hart's excellent TinyGPS library and includes code from the ArduPilot Project for navigation.

The source code for the sketch is available for download below.

Hardware

In this basic configuration, the Arduino, SparkFun GPS Shield, and Nuelectronics LCD Keypad Shield are all stacked together using extra long stacking headers.

The only assembly required is attaching the GPS module to the GPS shield, soldering the stacking headers on to the GPS shield, and setting the toggle switch on the GPS shield to DLINE mode. After that, just attach the shields to the Arduino.

Modes of Operation and Configuration Options

Mode & Configuration Options Example Output

Current Location, Heading and Speed
The heading can be shown either as cardinal directions or in degrees.

Distance Traveled, Average and Maximum Speed
No configuration options.

Bearing, Distance and ETA to a Way-point or Coordinates
The bearing can be shown either as cardinal directions or in degrees, and can be shown as relative or absolute in respect to true north.
The ETA can be based on either the current or the average speed of travel.

Date and Time
The time can be adjusted for different timezones and daylight savings time.

Demonstration

Files: 
AttachmentSize
Arduino GPS System v 2.034.65 KB
Project Categories: 
An image of a microprocessor
A image of a file of code written in C
An image of a satellite

Comments

Peter's picture

Nice work.

Joe Lawrence's picture

I am using Windows 7 64 bit and Arduino 1.0.3. When I click to download the file I get a window with the file in one big sentence without separation between lines. I have tried to place carriage return after all suspected breaks but the file is missing a lot of things and will not run. Don't know what else to do?

Sean Carney's picture

The reason why the sketch lacks any line breaks is due to different newline conventions on Linux and Windows. Wordpad should open the file correctly, you can then save it with the Windows line break characters.

Christian's picture

Hello
I am very interested in this project and I would like to know what method are you using for the backup with an EEprom?
Is the internal EEprom ? It is not dangerous to 'tired' this 'beast'?
Do you have a plan for an external EEprom?
Adafruit has a shield with a backup on SD card.(GPS shield V1.1)
Very good job. Thank you

Sean Carney's picture

For saving data I used the internal EEPROM on the Arduino.

Using on-board EEPROM keeps the project simple since it doesn't require any extra parts. The Arduino's EEPROM has an advertised lifespan of 100,000 writes which is sufficiently large that I see no danger of losing data. The biggest drawback is that you only have 1,024 bytes to work with, but if you are creative and manage each byte carefully you can make good use of the limited space.

The backup of the EEPROM just outputs the entire contents of the EEPROM over the Arduino's serial connection. From there you can store the backup on a computer and restore it with by uploading a simple sketch. This seems to be the simplest way to do backups.

Right now I don't have any plans to change anything to do with memory, I'm more focused on improving features such as adding a digital compass.

Judemo's picture

Thank u very much for your post, it's need little modificacions for Arduino one.
Great
JBP

Sean Carney's picture

The next time I start working on the code again, I might review if it works correctly with newer Arduino models. Otherwise, I'm happy still working with my Duemilanove.

Christian's picture

Hello
After the acquisition of the equipment and checking of the proper functioning of the head GPS "Ultimate GPS Breakout" that I use, I started editing.
The display is stuck after "Arduino GPS Version 2" and no display on the serial port appeared.
After lengthy research and installation of multiple control points, I realized that it was the "Clear eeprom" and "Save eeprom " functions which prevented the smooth running of the programme.
After having neutralised them, the program worked perfectly.
I would like the program at your disposal if you wish.
Mystery !! No
I'm not sure that satellites signals pass through the LCD Keypad?
Thanks again

Sean Carney's picture

Glad to hear that you got it working.

The keypad shield does block the satellite signals a bit, but that only seems to be a problem when initially acquiring a signal. If I'm having trouble with it I usually take the keypad shield off until the GPS gets a fix then I put the keypad shield back on again.

Christian's picture

It's a bit "military" as the method!
Finally the LCD Keypad does block not too long ago the signal less than another GPS for my manufacturing with a Nokia 5110 display.
I added a routine to move the coordinates from decimal to sexagesimal and degrees and decimal minutes which are the most widely used forms on the GPS.
Thanks for your advice.

Petter 's picture

Hi there!! I loooove this project! Great work! Is it a possibility to press one button to snap the cordinates from A to B?!

I having difficulties on the new arduino software! And implementing softwareserial.h instead of the newsoftserial.h! Doesn't work!! And don't know what to do!!

Christian's picture

Hi,.
Need to download the SoftwareSerial .h using the link below and paste it into the Arduino library directory.
Then must be replaced one by one by SoftWareSerial NewsoftSerial terms in the .ino.
This should work.

https://github.com/arduino/Arduino/blob/master/libraries/SoftwareSerial/...

Petter's picture

I just love this project to much! but I am a newbie and just hate the lcd shield cuz I cant find any case for that thing... I am dreaming about Ir remote controlled system... Anybody wants to earn a buck for helping me coding it... searched and tried for many weeks now.. Cant figure it out how to blend those modules together... the code wich I adore is to hard for me!

borjang's picture

My board is Arduino Uno R3 and IDE version 1.0.5 . When I verify the code, it show the error message:「call of overloaded 'write(int)' is ambiguous 」and lots of other errors. So I google this error message, I find this link:「http://forum.arduino.cc/index.php?topic=122201.0」. So I use 「 lcd.write((byte)0);」replace 「lcd.write(0);」then verify the code again.
It works !

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.