Pages: [1]   Go Down
Author Topic: TinyGPS  (Read 3362 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am writing some code to develop a digital speedometer whose data is pulled and converted using TinyGPS. I am testing the code in my house and am getting a solid red LED on my Parallax GPS unit but there are times when the module is sitting still that I will get speeds of up to 8 mph output in the serial monitor. Has anyone else experienced anomalies of this nature with the GPS units? Attached is my code:

Code:
#include <NewSoftSerial.h>
#include <TinyGPS.h>
NewSoftSerial nss (2,3);
TinyGPS gps;

void setup()
{

  Serial.begin(4800);
  nss.begin(4800);
}

void loop()
{
  while (nss.available())
  {
    int c = nss.read();
    if (gps.encode(c))
    {
      int fmph = gps.f_speed_mph(); // speed in miles/hr
      Serial.println(fmph);      
    }
  }
}

Also, please forgive me if I missed it when reading the .h file, but is there any way in TinyGPS to extract the data from the GPRMC that indicates a valid lock (i.e. the 3rd part of the string that is either A or V)? Thanks.

-Jeremy
Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't used this particular device, but I've used several other GPS units and they all can give anomalous readings at startup and when signal quality is poor (e.g. indoors).  Even my Garmin MAP60C showed me moving at 100MPH between my driveway (where I powered up) and the main road (~200 yards away), where max speed was 25 or 30 MPH.

According to an old Trimble 6 channel GPS, my truck would drift around in a circle all day while I was at my desk (with the keys in my pocket smiley ).

-j
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the input. I've never used GPS until this point so I wasn't sure if that was normal or not.
Logged

Sydney, Australia
Offline Offline
Full Member
***
Karma: 3
Posts: 230
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You'll see localised drift even with current generation devices... no matter where your keys are!
Logged

Is life really that serious...??!

Pages: [1]   Go Up
Jump to: