Go Down

Topic: GPS-LCD Speedometer (Read 4253 times) previous topic - next topic

Bainesbunch

#15
Mar 21, 2014, 12:28 pm Last Edit: Mar 21, 2014, 12:31 pm by Bainesbunch Reason: 1
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.
EmbeddedAT .. From Concept to Prototype to Production
Electronics and firmware design and project mentoring
I do answer personal requests for help when accompanied with a PayPal receipt ;)

inval1d

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

mirith

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.

inval1d

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

inval1d

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

PaulS

Quote
and make the LCD read them.

I'm pretty sure that the LCD can't read anything. You have to write to it.

Bainesbunch

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 ..
EmbeddedAT .. From Concept to Prototype to Production
Electronics and firmware design and project mentoring
I do answer personal requests for help when accompanied with a PayPal receipt ;)

BobTheBoat

Hi all. I want to build a boat speedo using an Arduino and a gps. The main purpose (apart from displaying lat, long and time) is to provide a speed readout but a 'nice to have' would also give me real time heading. I've looked at the nmea sentences from a number of gps's and they all seem to be able to resolve from zero upwards to an accuracy of one decimal place. The speedo is for use on a very slow boat which has a max speed of about 3.5 mph.
My question:
Will the gps be accurate at such low speed?
Is there a way of coaxing more-than-one-decimal-place from the gps?
Are there any gps sets that are better than others to do what I want?
Any advice will be most welcome
Bob the Boat

Go Up