Pages: 1 [2]   Go Down
Author Topic: GPS-LCD Speedometer  (Read 3703 times)
0 Members and 1 Guest are viewing this topic.
Miers 46500 France
Offline Offline
Sr. Member
****
Karma: 14
Posts: 322
EmbeddedAT .. From Concept to Prototype to Production
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the TinyGPS (https://github.com/awaxa/arduino/tree/master/libraries/TinyGPS) library there is a ground speed option there that uses the NMEA string $GPVTG to calculate the Ground Speed
The sentence is broken up like below if you prefer to decode it yourself

Track Made Good and Ground Speed.

$GPVTG


eg1. $GPVTG,360.0,T,348.7,M,000.0,N,000.0,K*43
eg2. $GPVTG,054.7,T,034.4,M,005.5,N,010.2,K


           054.7,T      True track made good
           034.4,M      Magnetic track made good
           005.5,N      Ground speed, knots
           010.2,K      Ground speed, Kilometers per hour


eg3. $GPVTG,t,T,,,s.ss,N,s.ss,K*hh
1    = Track made good
2    = Fixed text 'T' indicates that track made good is relative to true north
3    = not used
4    = not used
5    = Speed over ground in knots
6    = Fixed text 'N' indicates that speed over ground in in knots
7    = Speed over ground in kilometers/hour
8    = Fixed text 'K' indicates that speed over ground is in kilometers/hour
9    = Checksum

The actual track made good and speed relative to the ground.

$--VTG,x.x,T,x.x,M,x.x,N,x.x,K
x.x,T = Track, degrees True
x.x,M = Track, degrees Magnetic
x.x,N = Speed, knots
x.x,K = Speed, Km/hr

Hope this help a little

Cheers Pete.
« Last Edit: March 21, 2014, 06:31:38 am by Bainesbunch » Logged

EmbeddedAT .. From Concept to Prototype to Production

Electronics and firmware design and project mentoring

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I have a question for you: How would I go about displaying this on an LCD? Do I set it as a variable and display the variable about every half a second? How do I do that? Thanks
Logged

Southeast US
Offline Offline
God Member
*****
Karma: 15
Posts: 683
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have information displaying on the LCD at all?  If not, go looking for an appropriate library.

Otherwise, yes, you would parse the NMEA string to read the variable, and then you have the software update the LCD every half second based on the variable.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I do have the appropriate libraries to do so. I will upload my code do far soon.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still have no idea how to do the variables and make the LCD read them. Can someone help?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
and make the LCD read them.
I'm pretty sure that the LCD can't read anything. You have to write to it.
Logged

Miers 46500 France
Offline Offline
Sr. Member
****
Karma: 14
Posts: 322
EmbeddedAT .. From Concept to Prototype to Production
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Go read the examples that come with the Tiny GPS library that i pointed you at a few posts back. It will demonstrate how to extract the params from the NMEA strings that you need into variables. then , depending on the LCD library that you have you can "Print" to it like any other streaming device. you will also be able to clear the display and set the curser position.... this is really a very simple task if you do a bit of reading ..
Logged

EmbeddedAT .. From Concept to Prototype to Production

Electronics and firmware design and project mentoring

Pages: 1 [2]   Go Up
Jump to: