TinyGPS

A Compact Arduino GPS/NMEA Parser

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 mandatory 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 millionths of a degree, so instead of 90°30’00”, get_position() returns a longitude value of 90,500,000, 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: TinyGPS13.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()
  13. Improved precision in latitude and longitude rendering. get_position() now returns angles in millionths of a degree.

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 August 31, 2013 at 7:00 pm
702 Responses → “TinyGPS”

  1. Joe

    15 years ago

    I am switching from an Uno to a Mini Pro 3.3v and am using the exact same wiring setup (pin2 gets the data from GPS) on both units and the exact same code on both units. Everything is great on the Uno, but I get nothing on the Mini Pro. The Mini Pro seems to be working fine otherwise. Thanks a lot for this.


  2. Mikal

    15 years ago

    @Willem–

    Thanks! I get a lot of call for these fields. I’ll work on integrating them into the next version.

    Mikal


  3. Mikal

    15 years ago

    @Joe, it’s important to point out that TinyGPS is a software-only library and has no connection whatever to the physical attributes of the device. I’m guessing that your GPS is a 5V unit and isn’t getting enough power, or possibly that its logic levels are not compatible with the 3.3V power bus? What kind of GPS unit is it?

    Mikal


  4. Joe

    15 years ago

    I understand it is software only, the GPS is an LS20031 and was previously powered by the 3.3v output of the Uno. Thanks Again.


  5. Roman

    15 years ago

    Dear Mikal,
    I like your tiny GPS library and I’d like to use it for my project – RC glider vario.
    I’m still new in Arduino programming so I’m sorry if my question is stupid.
    I found that patch for your code:
    http://arduino.cc/forum/index.php/topic,37465.msg276610.html#msg276610
    and I’d like to implement it, but I don’t know how to merge it with your code.
    Can you advise me and possibly write me, if that patch works well?
    Thanks!
    Roman


  6. markham

    15 years ago

    Mikal,

    I know that 100000ths of a degree should be accurate enough but unfortunately it’s less than the accuracy of a standard NMEA sentence of dddmm.mmmm. Unfortunately you get slightly jagged lines when you zoom down on google earth. You do get nice straight lines if plotted to the full accuracy of the NMEA sentence. I’ve tried changing your code in a number of places but I don’t think I’ve got it right completely. How do I change the code below to increase the accuracy?

    unsigned long TinyGPS::parse_degrees()
    {
    char *p;
    unsigned long left = gpsatol(_term);
    unsigned long tenk_minutes = (left % 100UL) * 10000UL;
    for (p=_term; gpsisdigit(*p); ++p);
    if (*p == ‘.’)
    {
    unsigned long mult = 1000;
    while (gpsisdigit(*++p))
    {
    tenk_minutes += mult * (*p – ‘0’);
    mult /= 10;
    }
    }
    return (left / 100) * 100000 + tenk_minutes / 6;
    }

    Is it as simple as increasing the 100000 to 1000000, because I did that but the accuracy is still not quite there?

    Thanks
    Markham


  7. Mikal

    15 years ago

    Hi Roman,

    Those patches are organized so that you add all the lines beginning with the + sign and remove all the lines beginning with the – sign. I can’t vouch for whether the code works, because I haven’t tried it, but I bet it does. Brett Hagman is a talented coder and writer.

    Mikal


  8. Roman

    15 years ago

    Dear Mikal,
    thanks for the answer but unfortunately it’s not clean enough for me. Lines in the patch file aren’t numbered so it isn’t clean WHERE to put WHICH line…
    I guess it’s prepared for some automatic merging software and everyone (except me) knows which one…
    Roman


  9. Mikal

    15 years ago

    Roman, I haven’t got any recommendation for “patch applier”, but I bet if you asked Brett for a copy of the modified code he’d supply it. The unadorned lines in the patch (no + or -) are the reference lines that show where to put the mods.


  10. Roman

    15 years ago

    Mikal,
    thanks for all the explanations!
    I’ll look at it again and if I’m still don’t know, I’ll try to contact Brett. Good luck for your further work!
    Roman


  11. Pantelis Ar

    15 years ago

    Mikal,

    Im using TinyGPS and the Wire libraries to tranfer (floats) latitude and longitude from an Uno(slave) to a BT(master) arduino communicating with I2C protocol (master analog A4 to slave analog A4 and A5 to A5). I’m using the test_with_gps_device sketch ofcourse. My two boards are also connected at their Analog pins A0 and when the gps locks, the slave’s A0 analog pin (output) turns HIGH and the master board reads its A0 analog pin (input) in order to understand that the gps is locked and proceed to my robots guidance.

    When I use the test_with_gps_device sketch without the two boards communicating (no requests from master to slave for data) things work fine, I get no checksum errors and the gps data are very accurate. When the boards communicate with I2C, everytime there is a request from the master board and the slave sends the lat and long values I get checksome errors, aproximately 2 errors with every gps read, the lat and long values have less acuracy something which is devastating for my guidance.
    How can I work this around? According to which criteria should I feed the gps object during the proccess of the rest of my code to avoid checksum errors?

    I’ve uploaded the slave’s sketch in hotfile to avoid posting all the code here. Maybe you could take a look at it.

    http://hotfile.com/dl/112385160/bad8cd3/slave.rar.html


  12. Paul

    15 years ago

    Hi Mikal

    Thank you very much for your TinyGPS library.

    I am using a EM-406A GPS with the sparkfun shield connected to a UNO Arduino board. I uploaded your test_with_gps_device script and it works very well.
    Of course seeing is believing, so a quick test by entering the fix produced by the script into google earth resulted in a satellite’s view of my house!

    Thanks again.

    Paul


  13. Mikal

    15 years ago

    Cool, Paul! :)


  14. Jose

    15 years 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


  15. Jose

    15 years 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.


  16. Ken

    15 years 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 ..


  17. Mikal

    15 years 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


  18. Phil Hutchinson

    15 years 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.


  19. Anthony

    15 years 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?


  20. Mikal

    15 years 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


  21. Anthony

    15 years 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.


  22. mac

    15 years 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


  23. 3dotter

    15 years ago

    Hi Mikal,

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

    Best wishes,
    3dotter


  24. Henry

    15 years ago

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

    please let me know

    Thanks


  25. Henry

    15 years 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


  26. Mikal

    15 years 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


  27. Andy

    15 years 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


  28. Mikal

    15 years 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


  29. Alex Tang

    15 years 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!


  30. Alex Tang

    15 years 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! :)


  31. JeffOB

    15 years 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


  32. John Burch

    15 years ago

    Hi Mikal

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

    Thanks again

    John


  33. Kurt Pettersen

    15 years ago

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


  34. Metehan Çetin

    15 years 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


  35. Mikal

    14 years 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


  36. Jacob Rosenthal

    14 years ago

    Error in the static example file.

    #include
    should be
    #include


  37. Ritchie Wilson

    14 years 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.


  38. Tom

    14 years 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.


  39. Mikal

    14 years 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


  40. Tom

    14 years 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?


  41. Steve

    14 years ago

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


  42. Steve

    14 years ago

    Seems like I had 2 different issues overlapping. Standby.


  43. Julien

    14 years 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


  44. Mikal

    14 years 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

6 Trackbacks For This Post
  1. 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 […]

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

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

  3. reptile-addict.nl | My Arduino Blog

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

  4. 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 […]

  5. 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 […]

  6. 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 […]

Leave a Reply