Hi all.
I am a hardware guy and have great interest on arduino NMEA parsing libraries. I did tested simple sketches on NMEA, TinyGPS and TinyGPS++ libraries respectively using oscilloscope to view input NMEA sentences vs output sentences from my Mega2560.
With due respect to respective library authors for their overwhelming effort, I would like to share my findings and likewise fishing for validations from others interested in this data.
- NMEA have about 82.7ms delay with respect to input GPS port (Mega Serial1) and output (Mega
Serial). - TinyGPS have about 2.07ms delay
- TinyGPS++ have about 2.07ms delay
I wanted to test with NeoGPS but owing to my very limited coding skills, I seem cannot show in serial monitor NMEA sentences. If anyone can provide a sample code to stream input NMEA sentences and passed through NeoGPS then outputs to serial monitor.
Below are the sketches I used to test.
- NMEA test sketch
#include <nmea.h>
NMEA gps(ALL);
void setup()
{
Serial.begin(4800); // serial port to PC
Serial1.begin(4800); // serial port from GPS
}
void loop() {
if (Serial1.available() > 0) { // if there's a byte waiting to be read
if (gps.decode(Serial1.read())) {
Serial.println(gps.sentence());
}
}
}
- TinyGPS test sketch
/* This sample code demonstrates the normal use of a TinyGPS object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
#include <TinyGPS.h>
TinyGPS gps;
void setup()
{
Serial.begin(4800);
Serial1.begin(4800);
}
void loop()
{
if (Serial1.available() > 0)
{
char c = Serial1.read();
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
// if (gps.encode(c)) // Did a new valid sentence come in?
}
}
TinyGPS++ Test sketch
#include <TinyGPS++.h>
TinyGPSPlus gps1;
void setup()
{
Serial.begin(4800); //set serial monitor Port Baud rate
Serial1.begin(4800); //set GPS Port One Baud rate.
}
void loop()
{
if (Serial1.available() > 0) // Port One Data available
{
char c = Serial1.read();
Serial.write(c);
// if (gps1.encode(c)); // Did a new valid sentence come in?
}
}
I have attached screenshots of my measurements. Photos are NMEAlib, TinyGPS & TinyGPS++ full data packet and zoom-in measurements.


