SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By ptkacik
#183279
I need a GPS Odometer but feel that surely somebody has already done this. I don't have much (or any) experience on making these things. It is for distance travelled by a vehicle over the road.

Does anybody know how to make a GPS odometer?

Thanks,
Peter
By skimask
#183281
Distance = speed x time

1 Mile = 1 Mile per hour for 1 hour
1 Mile = 60 Miles per hour for 1 minute
1 billion miles = 1 billion miles per hour for 1 hour
1 light year = Light speed for 1 year
By jremington
#183282
Do you have a GPS module, and can you read the NMEA sentences?

If so, in many cases the relevant sentence (e.g. $GPRMC) is output once per second, or you can program the module so that this is the case. Read the current speed from that sentence, see: http://www.gpsinformation.org/dale/nmea.htm#RMC

The distance traveled is just the sum of those values over whatever period of time you are summing, in units of (speed x 1 sec).

This "distance traveled" function is already built in to most of even the cheapest hand held GPS units.
By ptkacik
#183291
I was really thinking somebody would have worked out the details about what needs to be purchased to make the GPS odometer, how to wire it up, and how to program it. How do you access the distance and reset it?

What if it loses power? Does it pick back up where it left off? It would be supplied by 12 VDC but lose power occasionally.

How long can it record or do you just store a single distance number?

Can a remote GPS antenna be able to withstand outdoor conditions?

Thanks,
Peter
By jremington
#183314
If you have to ask those sorts of questions, a GPS odometer is way, way too much for a first project. You won't find a "canned" project explaining how to make one, but if you did, likely much of the information would be out of date. Technology changes rapidly.

I recommend to buy an Arduino and work your way through the example projects. Most of the basics are covered in various on-line tutorials, including how to receive GPS coordinates and store info on an SD card. With those done and understood, it would a straightforward couple of evenings of work to make the odometer.
By skimask
#183323
Same theory, but using a vehicle's OBD to give me current speed. Integrate current speed over time, and you get distance.

(watch the LCD screen in the upper right hand corner of the video, that's the calculated odometer)

https://www.youtube.com/watch?v=7sUVMn4OJ58

Do the same thing with the GPS speed output instead of using OBD like I did.

Or calculate the distance between the last known position (Lat/Long/Alt) and the current position (Lat/Long/Alt), get the distance between the two, make the new current position = the last known position, add the last calculated distance between the two into an accumulator.

But, this is probably toooooo much...