Arduino GPS Tutorial

I wrote a tutorial on how to use GPS and SD card shield with Arduino, to make a GPS logger. But I received requests for a much simpler tutorial on just how to use the GPS module with the Arduino. So this article is only about how to use Arduino GPS module.

The GPS (Global Positioning System) is accessible from almost everywhere on Earth and provides exact coordinates of your current location so that you can figure out where you are.

The Type of GPS Module

There are many different model of GPS modules that can be used with the Arduino boards. Before deciding which module you want to buy I suggest check out the wikipedia page on GPS, and familiarize yourself with this technology. These are the things I paid attention to when I choose my GPS module:

  • Update Rate – The update rate of a GPS module is basically how often it recalculates and reports its position. 5 and even 10Hz update rates are becoming more and more available for cheap.
  • Number of Channels – the more frequencies (channels) that you can check at once, the faster you’ll find a fix. After you get a lock, some modules will shut down the extra blocks of channels to save power. If you don’t mind waiting a little longer for a lock, 12 or 14 channels will work just fine for tracking.
  • Antennas – Many modules come with this chunk of something on top of it, some do not. it’s a chunk of ceramic that is finely trimmed to pickup the GPS L1 frequency of 1.57542 GHz. This antenna needs to point towards the sky.
  • Accuracy – Most modules can get it down to +/-3m, but if you need sub meter or centimeter accuracy, it gets really expensive.

Connection with Arduino


The GPS moduels usually use Serial communication (some use I2C). As you might know there is only one pair of serial buses on the Arduino UNO, if that’s used by the GPS, there will be no Serial monitor for debugging. Therefore we can use a SoftwareSerial, which turns some digital pins into Serial pins, in this case we are using pin2 and pin3.

Arduino GPS Coding

There are free available GPS libraries for the Arduino, such as the TinyGPS. If you are interested into how it works and want to do something that isn’t available from the library, you can check out the tutorial on the official Arduino website.

Receiving GPS Data

If you upload the code to Arduino, and hook up the Arduino and GPS module, you will get some really confusing data like this.


This is actually useful information called the National Marine Electronics Association (NMEA) protocol. More information on NMEA standard data strings can be found at this site. There are four main type of sentences.

  • $GPGGA: Global Positioning System Fix Data
  • $GPGSV: GPS satellites in view
  • $GPGSA: GPS DOP and active satellites
  • $GPRMC: Recommended minimum specific GPS/Transit data

Each of these sentences contains a wealth of data. The one we use here is the $GPRMC string, which gives us these information.

  • Time (accuracy of millisecond) (GMT time).
  • Date
  • Position (accuracy of 2 to 3 meters)
  • Altitude
 Field #
 1    = UTC time of fix
 2    = Data status (A=Valid position, V=navigation receiver warning)
 3    = Latitude of fix
 4    = N or S of longitude
 5    = Longitude of fix
 6    = E or W of longitude
 7    = Speed over ground in knots
 8    = Track made good in degrees True
 9    = UTC date of fix
 10   = Magnetic variation degrees (Easterly var. subtracts from true course)
 11   = E or W of magnetic variation
 12   = Mode indicator, (A=Autonomous, D=Differential, E=Estimated, N=Data not valid)
 13   = Checksum

From here, we can now manipulate the received data to get the information that is useful to us.

1 thought on “Arduino GPS Tutorial

  1. pakistan

    “Hi Oscar”
    how to setup gps on my quadcoper for long range,autopilot and most important if i cant see my quadcopter in the air then just give it a command and its come back home on autopilot is possible ? any body help me plz i m waiting…..thats my facebook account….(


Leave a Reply

Your email address will not be published. Required fields are marked *

For prompt technical support, please use our forum I check blog comments weekly.