TinyGPS

A Compact Arduino GPS/NMEA Parser

Note: TinyGPS 12 is now available.  TinyGPS 12 provides several new features:

  1. satellites() – Number of satellites counter from $GPRMC
  2. hdop() – Horizontal Dilution of Precision from $GPRMC — the smaller this value is the more confidence you have in the accuracy of the location reading.
  3. course_to() – another Maarten Lamers’ borrowing that complements his distance_to
  4. cardinal() – a nice little static function by Matt Monson that converts a course to a compass direction like “SSE”.

Note: TinyGPS 11 is now Arduino 1.0 compatible.

TinyGPS is designed to provide most of the NMEA GPS functionality I imagine an Arduino user would want – position, date, time, altitude, speed and course – without the large size that seems to accompany similar bodies of code.  To keep resource consumption low, the library avoids any floating point dependency and ignores all but a few key GPS fields.

Usage

To use, simply create an instance of an object like this:

#include "TinyGPS.h"
TinyGPS gps;

Feed the object serial NMEA data one character at a time using the encode() method. (TinyGPS does not handle retrieving serial data from a GPS unit.) When encode() returns “true”, a valid sentence has just changed the TinyGPS object’s internal state. For example:

#define RXPIN 3
#define TXPIN 2
SoftwareSerial nss(RXPIN, TXPIN);
void loop()
{
  while (nss.available())
  {
    int c = nss.read();
    if (gps.encode(c))
    {
      // process new gps info here
    }
  }
}

You can then query the object to get various tidbits of data. To test whether the data returned is stale, examine the (optional) parameter “fix_age” which returns the number of milliseconds since the data was encoded.

long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;

// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);

// time in hhmmsscc, date in ddmmyy
gps.get_datetime(&date, &time, &fix_age);

// returns speed in 100ths of a knot
speed = gps.speed();

// course in 100ths of a degree
course = gps.course();

Statistics

The stats method provides a clue whether you are getting good data or not. It provides statistics that help with troubleshooting.

// statistics
gps.stats(&chars, &sentences, &failed_checksum);
  • chars
    - the number of characters fed to the object
  • sentences
    - the number of valid $GPGGA and $GPRMC sentences processed
  • failed_checksum
    - the number of sentences that failed the checksum test

Integral values

Values returned by the core TinyGPS methods are integral. Angular latitude and longitude measurements, for example, are provided in units of 10-5 degrees, so instead of 90°30’00″, get_position() returns a longitude value of 9050000, or 90.5 degrees. But…

Using Floating Point

…for applications which are not resource constrained, it may be more convenient to use floating-point numbers. For these, TinyGPS offers several inline functions that return more easily-managed data. Don’t use these unless you can afford to link the floating-point libraries. Doing so may add 2000 or more bytes to the size of your application.

float flat, flon;

// returns +/- latitude/longitude in degrees
gps.f_get_position(&flat, &flon, &fix_age);
float falt = gps.f_altitude(); // +/- altitude in meters
float fc = gps.f_course(); // course in degrees
float fk = gps.f_speed_knots(); // speed in knots
float fmph = gps.f_speed_mph(); // speed in miles/hr
float fmps = gps.f_speed_mps(); // speed in m/sec
float fkmph = gps.f_speed_kmph(); // speed in km/hr

Date/time cracking

For more convenient access to date/time use this:

int year;
byte month, day, hour, minutes, second, hundredths;
unsigned long fix_age;

gps.crack_datetime(&year, &month, &day,
  &hour, &minute, &second, &hundredths, &fix_age);

Establishing a fix

TinyGPS objects depend on an external source, i.e. its host program, to feed valid and up-to-date NMEA GPS data. This is the only way to make sure that TinyGPS’s notion of the “fix” is current. Three things must happen to get valid position and time/date:

  1. You must feed the object serial NMEA data.
  2. The NMEA sentences must pass the checksum test.
  3. The NMEA sentences must report valid data. If the $GPRMC sentence reports a validity of “V” (void) instead of “A” (active), or if the $GPGGA sentence reports fix type “0″ (no fix) then those sentences are discarded.

To test whether the TinyGPS object contains valid fix data, pass the address of an unsigned long variable for the “fix_age” parameter in the methods that support it. If the returned value is TinyGPS::GPS_INVALID_AGE, then you know the object has never received a valid fix. If not, then fix_age is the number of milliseconds since the last valid fix. If you are “feeding” the object regularly, fix_age should probably never get much over 1000. If fix_age starts getting large, that may be a sign that you once had a fix, but have lost it.

float flat, flon; unsigned long fix_age; // returns +- latitude/longitude in degrees gps.f_get_position(&flat, &flon, &fix_age); if (fix_age == TinyGPS::GPS_INVALID_AGE) Serial.println("No fix detected"); else if (fix_age > 5000) Serial.println("Warning: possible stale data!"); else Serial.println("Data is current.");

Interfacing with Serial GPS

To get valid and timely GPS fixes, you must provide a reliable NMEA sentence feed. If your NMEA data is coming from a serial GPS unit, connect it to Arduino’s hardware serial port, or, if using a “soft” serial port, make sure that you are using a reliable SoftSerial library. As of this writing (Arduino 0013), the SoftwareSerial library provided with the IDE is inadequate. It’s best to use my NewSoftSerial library, which builds upon the fine work ladyada did with the AFSoftSerial library.

Library Version

You can retrieve the version of the TinyGPS library by calling the static member library_version().

int ver = TinyGPS::library_version();

Resource Consumption

Linking the TinyGPS library to your application adds approximately 2500 bytes to its size, unless you are invoking any of the f_* methods. These require the floating point libraries, which might add another 600+ bytes.

Download

The latest version of TinyGPS is available here: TinyGPS12.zip

Change Log

  1. initial version
  2. << streaming, supports $GPGGA for altitude, floating point inline functions
  3. also extract lat/long/time from $GPGGA for compatibility with devices with no $GPRMC
  4. bug fixes
  5. API re-org, attach separate fix_age’s to date/time and position.
  6. Prefer encode() over operator<<. Encode() returns boolean indicating whether TinyGPS object has changed state.
  7. Changed examples to use NewSoftSerial in lieu of AFSoftSerial; rearranged the distribution package.
  8. Greater precision in latitude and longitude.  Angles measured in 10-5 degrees instead of 10-4 as previously.  Some constants redefined.
  9. Minor bug fix release: the fix_age parameter of get_datetime() was not being set correctly.
  10. Added Maarten Lamers’ distance_to() as a static function.
  11. Arduino 1.0 compatibility
  12. Added satellites(), hdop(), course_to(), and cardinal()

Acknowledgements

Many thanks to Arduino forum users mem and Brad Burleson for outstanding help in alpha testing this code. Thanks also to Maarten Lamers, who wrote the wiring library that originally gave me the idea of how to organize TinyGPS.  Thanks also to Dan P. for suggesting that I increase the lat/long precision in version 8.  Thanks to many people who suggested new useful features for TinyGPS, especially Matt Monson, who wrote some nice sample code to do so.

All input is appreciated.

Mikal Hart

Page last updated on March 17, 2012 at 6:39 pm
280 Responses → “TinyGPS”

  1. Jose

    1 year ago

    Hi Mikal, thanks for the code, really helpfull. I’m having the same problem as Federico. All info except date, heading, and speed are being read correctly. I have 0 checksum errors and the following are NMEA from the device:

    $GPRMC,213513.200,A,0441.4187,N,07401.6579,W,0.56,59.66,280411,,,A*4C

    $GPGGA,213513.400,0441.4187,N,07401.6579,W,1,7,1.28,2636.9,M,3.2,M,,*4C

    $GPRMC,213513.400,A,0441.4187,N,07401.6579,W,0.56,59.66,280411,,,A*4A

    $GPGGA,213513.600,0441.4187,N,07401.6579,W,1,7,1.28,2636.9,M,3.2,M,,*4E

    $GPRMC,213513.600,A,0441.4187,N,07401.6579,W,0.57,59.66,280411,,,A*49

    $GPGGA,213513.800,0441.4187,N,07401.6578,W,1,7,1.28,2636.9,M,3.2,M,,*41

    $GPRMC,213513.800,A,0441.4187,N,07401.6578,W,0.53,59.66,280411,,,A*42

    $GPGGA,213514.000,0441.4187,N,07401.6578,W,1,7,1.28,2636.9,M,3.2,M,,*4E

    $GPRMC,213514.000,A,0441.4187,N,07401.6578,W,0.53,59.66,280411,,,A*4D

    $GPGGA,213514.200,0441.4188,N,07401.6578,W,1,7,1.28,2636.9,M,3.2,M,,*43

    $GPRMC,213514.200,A,0441.4188,N,07401.6578,W,0.54,59.66,280411,,,A*47

    $GPGGA,213514.400,0441.4188,N,07401.6578,W,1,7,1.29,2636.9,M,3.2,M,,*44

    $GPRMC,213514.400,A,0441.4188,N,07401.6578,W,0.58,59.66,280411,,,A*4D

    $GPGGA,213514.600,0441.4188,N,07401.6578,W,1,7,1.28,2636.9,M,3.2,M,,*47

    $GPRMC,213514.600,A,0441.4188,N,07401.6578,W,0.61,23.50,280411,,,A*4D

    Thanks


  2. Jose

    1 year ago

    Hi Mikal, my previous comment about not getting the speed and others to work. I finally got it to work by changing the max buffer size on the Newsoftserial to 256
    #define _NewSS_MAX_RX_BUFF 256 // RX buffer size

    Thanks for the library and maybe this will help others with same issue.


  3. Ken

    1 year ago

    Strange, i am experiencing the same problem with the tinygps library.

    “Testing TinyGPS library v. 10
    by Mikal Hart
    Sizeof(gpsobject) = 103″

    is all that the serial monitor displays. The GPS unit is fixed (led’s are blinking instead of glowing constantly) and the GPS is based on SIRFSTAR III with the proper baudrate (4800) and outputs a UART TTL signal ..


  4. Mikal

    1 year ago

    Ken, make sure the wiring is correct. If your code says

    NewSoftSerial gps(rx, tx);

    that means that rx is the Arduino pin connected to the GPS TX/ line. It’s easy to get mixed up. Don’t connect RX to RX on the GPS.

    Mikal


  5. Phil Hutchinson

    1 year ago

    Has anyone seen TinyGPS not work in concert with the standard Wire and SD libraries that come with the Arduino-22 environment? I have a program that fetches data from a GPS using TinyGPS and a BMP05 pressure/temperature sensor using I2C, and then tries to write that data to a file on an SD card. I can get all three libraries to work great in programs on their own, but when I use them all in a single program, bad things happen (the processor becomes unstable or simply crashes).

    I’d be happy to show you the program the reproduces the problem. I’ve tried add and removing different lines of code, and the problem is elusive.


  6. Anthony

    12 months ago

    Is there any reason TinyGPS won’t work with an Arduino Pro Mini 3.3v? I followed Sparkfun’s tutorial (http://www.sparkfun.com/tutorials/176), except I used the pro mini, and read your instructions here but still have not been able to get the “test_with_gps_device” example to work. I get the following output:

    Testing TinyGPS library v. 10
    by Mikal Hart

    Sizeof(gpsobject) = 103

    but that’s it… I double and triple checked my wiring and I’m pretty sure its right. Is there any reason this library won’t work with an Arduino Pro Mini 3.3v?


  7. Mikal

    12 months ago

    @Anthony,

    TinyGPS is completely hardware agnostic, so no, there is nothing that would suggest that it doesn’t work with the Pro Mini. If the sample program is not printing anything, that means that either (a) it’s not receiving any data from the device (wiring issue) or (b) the data is being corrupted or lost. My best guess is (a). It’s a very common mistake to connect the TX lines together and the RX lines together. The correct way is to connect the GPS TX line to the Arduino RX pin and vice-versa. Is that your problem?

    A easy diagnostic is to add a Serial.print() of each character that is received from the GPS through NSS. If this prints nothing, you probably have problem (a). Also, you might periodically inspect nss.overflow() to see if you are losing characters. That might happen if you have a very high speed GPS device.

    Another possible problem is mismatched baud rates. Also, some GPS devices use a binary format and not the NMEA ASCII standard sentences.

    M


  8. Anthony

    12 months ago

    Mikal,

    Thank you for your help. I found that nss.overflow() was returning true a lot. So i adjusted the baud rate of my GPS down from 57600 to 19200 and started getting the expected GPS data output in the serial monitor!

    Your hard work is greatly appreciated.


  9. mac

    11 months ago

    The 8mhz arduino has a hard time processing the stream, I had to turn only RMC on at 1hz to get no checksum errors at 19200. With a 16mhz arduino I could receive 5hz at 19200


  10. 3dotter

    11 months ago

    Hi Mikal,

    How would you use TinyGPS with a I2C connection to a GPS receiver (e.g. uBlox NEO 5Q)?

    Best wishes,
    3dotter


  11. Henry

    11 months ago

    how can be use the TinyGPS library without the NewSoftSerial library, especially when you use the encode() sentence

    please let me know

    Thanks


  12. Henry

    11 months ago

    Hi

    I wonder if there is any way it can be sued this library and the bool feedgps() example, but without the NewSoftSerial library, but using the normal serial port,

    the GPS module is connected to the arduino serial port (baisc/original port 0,1)

    Thanks


  13. Mikal

    11 months ago

    @Henry,

    TinyGPS processes NMEA strings. It doesn’t care in the slightest where they come from–serial port, static data, etc. In fact, one of the examples shows how to process static data with TinyGPS. As long as you feed each character to it sequentially using encode() you are good.

    If you like, you can easily swap the NewSoftSerial port with the “real” Serial port and TinyGPS will work fine. Again, it doesn’t care where the data comes from.

    Mikal


  14. Andy

    11 months ago

    Thx a lot for the library.

    For my GPS I found a mistake:
    on line 223 in the TinyGPS.cpp file I has to change
    to this:
    _gps_data_good = _term[0] > ’0′ && _term[0] < '7' ;

    My GPS (Copernicus) does send a '7' when it got data from the past but it has no fix yet. Otherwise the library would tell me it has a fix.

    Thx
    Andy


  15. Mikal

    11 months ago

    http://www.gpsinformation.org/dale/nmea.htm

    @Andy,
    According to this “7″ means “manual input”. Hmm…

    Still, I think you’re probably right that line could be tweaked.

    Thanks,

    Mikal


  16. Alex Tang

    11 months ago

    Hey Mikal,

    Can the TinyGPS library be used to take the data from a string vs. directly off of the serial or soft serial line? I’ve got an app where i’m gathering data from multiple sources. The EM406 GPS only produces GPRMC data once per second, but on the other sources, i need to gather data as fast as possible (50 times per second is about as fast as i’ve gotten it). Using NewSoftSerial, i made a non-blocking read against the GPS, so if there’s no GPS data, i can continue to get the other data.

    I’d like to use TinyGPS for parsing of the GPRMC data, but feed it my data in a buffer. Can i do this?

    Thanks!


  17. Alex Tang

    11 months ago

    Ohhhhhh…i just re-read the API and realize that misunderstood what was going on. TinyGPS does exactly what i need. Nice job making the reading of the data outside the scope of the library, to allow us to ensure we can get the data read in the way that makes the most amount of sense to us. This is GREAT! :)


  18. JeffOB

    10 months ago

    Mikal,
    regarding

    // statistics
    gps.stats(&chars, &sentences, &failed_checksum);

    last i checked these values keep incrementing from the the time the object is instantiated. are there any function calls to reset these values? or can i access them directly and zero them out. i am unly interested in the stats for a given query not since the object was created.

    Thanks
    Jeff


  19. John Burch

    10 months ago

    Hi Mikal

    Many thanks for your library. Everything worked 1st time with the ISM300F2 GPS Module from http://inventeksys.com

    Thanks again

    John


  20. Kurt Pettersen

    10 months ago

    Has anybody been able to modify parse_degrees() in
    TinyGPS.cpp to get 5 or 6 digits of precision?


  21. Metehan Çetin

    10 months ago

    Hi Mikal,

    Which microcontrollers can be used with this library? I want to use PIC microcontroller. How can i use PIC with this library? I’m sorry if you explained that before.

    Thanks.
    Metehan


  22. Mikal

    9 months ago

    @Metehan Çetin,

    I tried to make the TinyGPS library fairly architecture-agnostic. However, it wouldn’t surprise me if it took a bit of tweaking to port to other architectures. Not too much tweaking though, I would imagine.

    M


  23. Jacob Rosenthal

    8 months ago

    Error in the static example file.

    #include
    should be
    #include


  24. Ritchie Wilson

    7 months ago

    I am using a 5v Pro Mini with Mediatek GPS over SoftwareSerial11(beta) and a gyroscope, accelerometer, magnetometer over i2c and ultrasonic over analogue.
    In individual sketches each works perfectly and I can put the i2c sensors and the analogue together without problem. Mix i2c and SoftwareSerial and the values are 0 (nothing gets returned).

    Any ideas why?
    Happy to share code if needed.


  25. Tom

    7 months ago

    Im having weird issues with tinyGPS using the test_with_gps_devise code.
    I can only get serial monitor to say:

    Testing TinyGPS library v. 10
    by Mikal Hart

    Sizeof(gpsobject) = 103

    But if I run New soft serial libraries example test code I get reading from gps:
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,001623.066,V,,,,,,,010209,,,N*41
    $GPVTG,,T,,M,,N,,K,N*2C
    $GPGGA,001624.066,,,,,0,00,,,M,0.0,M,,0000*57
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,001624.066,V,,,,,,,010209,,,N*46
    $GPVTG,,T,,M,,N,,K,N*2C
    $GPGGA,001625.066,,,,,0,00,,,M,0.0,M,,0000*56
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGSV,1,1,00*79
    $GPRMC,001625.066,V,,,,,,,010209,,,N*47
    $GPVTG,,T,,M,,N,,K,N*2C

    So I guess the GPS is sending something right?
    I have triple checked all the connections so pin’s should be right.
    Also I had it working for some time with the tinygps library, but now it suddenly stopped (Same code, nothing changed, same pins, same arduino.) and can’t find a way to fix it.


  26. Mikal

    7 months ago

    @Tom,

    I don’t see any lat/long info in the GPS data stream. Is it the EM-406A? Is the GPS LED flashing? Is the device outside or near a window?

    M


  27. Tom

    7 months ago

    The gps is micro-mini from sparkFun(http://www.sparkfun.com/products/8936). The module on micro-mini is MN5010HS. The led is flashing so it should have the signal and I used it outside to get better signal. It used to work inside too.
    I also used this code on arduino and tested if the nss wa available, to check whether I have the rx and tx connected right.

    #include
    #include

    #define RXPIN 3
    #define TXPIN 2

    NewSoftSerial nss(RXPIN, TXPIN);
    TinyGPS gps;

    long lat, lon;
    unsigned long age;

    void setup() {
    Serial.begin(9600);
    nss.begin(4800);
    }
    void loop()
    {
    while (nss.available())
    {
    //Serial.println(“available”); //for testing if rx & tx pins are correct
    int c = nss.read();
    if (gps.encode(c))
    {
    gps.get_position(&lat, &lon, &age);
    Serial.println(“———–”);
    Serial.println(” latitude “);
    Serial.println(lat);
    Serial.println(” longitude “);
    Serial.println(lon);
    Serial.println( ” age “);
    Serial.println(age);
    }
    }
    }

    I really have no clue why it is not working, maybe the gps is broken?


  28. Steve

    7 months ago

    I get 9999999 for altitude. The sentence looks good. Want to see it? How can I fix this?


  29. Steve

    7 months ago

    Seems like I had 2 different issues overlapping. Standby.


  30. Julien

    7 months ago

    Hello,

    I orginally used all of the GPS data to gather just location and time (that is all I need for the project). The GPS was originally at 57600 and worked perfectly sending the data to a computer.

    I then tried to send in the data wirelessly and I discovered that the 57600 was too much for the wireless. So, I configured the GPS unit to only output GGA at 38400. It now seems (to me) that the tinyGPS library fails to parse and gather any data. My question is this: Is there a minimum number and type of NMEA sentences needed for the library to work?

    Thanks,
    - J


  31. Mikal

    6 months ago

    @Julien,

    To get lat/long and time you need at minimum GPRMC or GPGGA. GPGGA also provides altitude, and GPRMC also provides date, speed, and course.

    Mikal


  32. Albert

    5 months ago

    Hi, I got my LS20031 GPS working with the Arduino Mega 2560. But now I would like to change the settings of the GPS. Do you know whether this is possible via the Arduino? Or do I need a FTDI cable? Thank you for your reply. Albert


  33. F4FWH

    5 months ago

    Hi Mikal,

    I’m working on a Hamradio project that is using your TinyGPS library.
    All the info that I need is in your library, but I need just one more things, is there a way to take the lat and lon as the NMEA sentences give it?

    For exemple on this sentence :
    “$GPRMC,201547.000,A,3014.5527,N,09749.5808,W,0.24,163.05,040109,,*1A”

    I need to had :
    3014.5527
    N
    09749.5808
    W

    Can you tell me how to modify the library to take this info?

    Thanks a lot for your works ;)

    73 Vivien


  34. Matt

    4 months ago

    Hey, I’d like to contribute some changes, namely storing off the # of satellites in view, and a bearing_to function to go along with the distance_to function.

    How would I go about getting you the changes?


  35. scompo

    4 months ago

    Hi, great stuff here, I just noticed that with the 1.0 release of the ide there is a problem compiling it.. The reference to wprogram.h it’s not working due to the new version of it..

    changing the include with this piece here (found on the release notes) works flawlessly for both new and old IDE..

    #if defined(ARDUINO) && ARDUINO >= 100
    #include “Arduino.h”
    #else
    #include “WProgram.h”
    #endif

    Thanks so much for the great stuff by the way!


  36. Joe

    4 months ago

    Hi Mikal!

    I couldn’t change the baudrate of my GPS (I dont know how) to 4800 so i changed the nss.begin(4800) to nss.begin(9600).

    either way however, im stuck at
    “Testing TinyGPS library v. 10
    by Mikal Hart
    Sizeof(gpsobject) = 103″

    i have checked that the RX goes to TX and vice versa.
    please enlighten me..


  37. Tomás

    4 months ago

    Tengo un GPS Parallax http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/gps/List/0/SortField/4/ProductID/396/Default.aspx, un Arduino Mega 2560 y el software arduino 1.0 y por más que trato leer los datos del gps no puedo U.U, incluí la carpeta GPS_Arduino_10 en donde esta el .h TinyGPS, he hecho muchas pruebas y nada :( , Somebody can help me? *.*


  38. UrSuS

    3 months ago

    Hi! Is there a way to check current GPS accuracy? (I want to log coordinates only if accuracy is +-3m)
    Thanks!


  39. Mikal

    3 months ago

    @F4FWH,

    Hmm… TinyGPS doesn’t provide access to the raw data. I should consider this. Thanks.


  40. Mikal

    3 months ago

    @Matt,

    Thanks for the offer. Email is probably the best way…


  41. Mikal

    3 months ago

    @scompo,

    TinyGPS now works with Arduino 1.0. Thanks!

    M


  42. Mikal

    3 months ago

    @Joe, I think I would examine the stats in TinyGPS. Are you actually getting any data?


  43. Van Taiariol

    3 months ago

    Hi Mikal,

    TinyGPS, Great program!. Have one question. Using a Polstar PMB-688
    (parallax purchase) I get 0.00 knt when actual is below 2Knts. Above
    3 knts read out is OK. Don’t know if this is a hardware issue (gps module)
    or software. Has anyone else experienced this??

    Regards,

    Van


  44. scompo

    3 months ago

    @Mikal You’re welcome. Glad I’ve helped.


  45. UrSuS

    3 months ago

    Could you please answer my question about position accuracy?


  46. Mikal

    3 months ago

    @UrSuS,

    I didn’t answer directly because I don’t know exactly, but I know of two strategies that people have used to increase accuracy:

    1. Examine the “number of satellites seen” field on the theory that the more satellites seen, the greater the accuracy. Note that the current version of TinyGPS does not support number of satellites in view, but I expect that the next version will, and it’s an easy patch.
    2. On the theory that the initial fixes reported by a GPS are the least accurate (and I confirm this experimentally with my EM-406A), simply wait until you’ve seen, say, 10 different fixes.

    That said, I don’t how to prove that the accuracy is within a given radius.


  47. Mikal

    3 months ago

    @Van Taiariol,

    It’s hard to imagine that being a software issue, but I can’t say for sure. Is there any chance you could capture the NMEA stream when the speed is below 2 knots?


  48. UrSuS

    3 months ago

    @Mikal,
    2. Do you mean $GPGGA sentence? The 7th value of the sting “Horizontal Dilution of Precision (HDOP)” (After fix quality and number of satellites)
    You say it’s unreliable?


  49. bklw

    3 months ago

    Great work dude, but can I also read the current time if the fix status is void? Could this be implemented or is it already?


  50. Kyle

    3 months ago

    @UrSuS – HDOP is only a measure of the standard deviation of the horizontal accuracy. While it can give you an idea of the possible radius, it’s extremely difficult to pin down what the position error actually is with any given fix.

    That being said, it would be nice to have access to the parameter. Willem posted a modified version 10 in these comments about a year ago with a hor_acc() function. Mikal, any way you could incorporate this into the main version? Not hard to add on our own but it’s always good to keep things centralized if possible.

    Thanks for your amazing work on the library, it’s been invaluable.

25 Trackbacks For This Post
  1. เริ่มต้นสร้าง GPS จอสีกับอาดูอี้โน่ | Ayarafun Factory

    [...] http://www.sundial.org/arduino/?page_id=3 [...]

  2. 10

    [...] won’t. I answer a few questions on the Arduino microcontroller forum and post an update to a library I [...]

  3. The Hired Gun » GPS project: show me something

    [...] this journey I also looked into using the TinyGPS library. While it does a nice job of handling the core GPS parsing, I still had the primary desire to log [...]

  4. GPS mit Arduino - Webmeister Blog

    [...] serielle Verbindung werden die  Daten ans Display geschickt. Verwendet werden die Bibliotheken TinyGPS und [...]

  5. The Frustromantic Box, Part 4: Software « New Bright Idea

    [...] Arduino developers for the great librarires, and to Mikal Hart in particular for his work on the TinyGPS and NewSoftSerial [...]

  6. Transmission success - Projects

    [...] and sending the bits of “Hello World” in 7N1 format.  I spent some time with the TinyGPS and NewSoftSerial libraries from Mikal Hart, and got the parsing working nicely and building an [...]

  7. GPS testing with LCD Character Display

    [...] can have the LCD output latitude, longitude, or whatever. You’ll need the TinyGPS library from Arduiniana downloaded and installed for it to work. They suggest using NewSoftSerial, but I couldn’t get [...]

  8. Arduino GPS — not exactly pocket-sized, but cool! « Arduino Projects FTW

    [...] EEPROM so they are persistent between power cycles. The sketch uses Mikal Hart's excellent TinyGPS library and includes code from the ArduPilot Projectfor [...]

  9. A fully functional Arduino GPS receiver | Embedded projects from around the web

    [...] uses a TinyGPS library for easier GPS shield access. So device can be used as normal GPS tracking device the only [...]

  10. Moving Forward with Arduino – Chapter 17 – GPS « t r o n i x s t u f f

    [...] point you will need to install two libraries into the Arduino software – NewSoftSerial and TinyGPS. Extract the folders into the libraries folder within your arduino-001x [...]

  11. Shield Driven Arduino GPS

    [...] sketch uses Mikal Hart’s excellent TinyGPS library and includes code from the ArduPilot Project for [...]

  12. GPS bővítés « Nikon D5000 DSLR

    [...] 2 [...]

  13. The Maritime Geocaching Association » Build Your Own Steampunk GPS

    [...] attached code should pretty much speak for itself. Using the TinyGPS library, your current position is taken and the direction to the final location is calculated. [...]

  14. Moving Forward with Arduino – Chapter 19 – GPS part II « t r o n i x s t u f f

    [...] pull-down resistor). You will need to install the SdFAT library, NewSoftSerial library, TinyGPS library and the SdFat library if not already [...]

  15. Arduinoによる放射線データ収集(3) « stastaka's Blog

    [...] http://arduiniana.org/libraries/tinygps/ USBシリアルを使っているとTX,RXが使えませんが、 [...]

  16. reptile-addict.nl | My Arduino Blog

    [...] Mikal Hart’s tinyGPS library; [...]

  17. Communicating to GPS Receiver using USB Host Shield « Circuits@Home

    [...] how to send raw GPS output to a NMEA 0183 message parser. For the following code example I used Mikal Hart’s TinyGps library. Since the library itself is not handling serial input, it was only necessary to make changes in [...]

  18. GpsBee and Seeeduino Stalker v2 « Wireless Building Automation

    [...] easy developing of the necessary Arduino application I used an existent dedicated library: TinyGPS (http://arduiniana.org/libraries/tinygps/), which help us to parse all the packets received on the serial port from the GpsBee module. Ok, so [...]

  19. SheekGeek » Blog Archive » Weather Balloon Payload Testing on a Model Rocket (Pt.1)

    [...] and gyroscope package and slapped together a simple SD card interface. The libraries I used were TinyGPS and fat16lib (for SD card use). Weather_Balloon_Code and schematic in case you’d like to [...]

  20. Moving Forward with Arduino – Chapter 19 – GPS part II « t r o n i x s t u f f

    [...] forget the 10k ohm pull-down resistor). You will need to install NewSoftSerial library, TinyGPS library and the SdFat library if not already [...]

  21. Anonymous

    [...] [...]

  22. Jacket Positioning System: JPS « Titles are Strange Things

    [...] it’s pretty simple. It only does those functions, but with the help of the truly fantastic TinyGPS library, I have a destination function in the [...]

  23. Testing MTK3329 10Hz GPS module and making an Arduino GPS logger | Develop with Arduino

    [...] TinyGPS for Arduino [...]

  24. Arduino + GPS Shield + LCD 16x2 | We Are The Electric Brothers

    [...] tinygps [...]

  25. TinyGPS Libraryを使ってGPSデータを取得

    [...] ちなみに、データ処理部分は、TinyGPS Libraryなる便利なものがあったので、それを使ってみた。 [...]

Leave a Reply