All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Radio and Communications

Notices

Radio and Communications Discussion forum for all aspects of RF and communication engineering, including antennas, modulation regimes, RF circuits and filter design, and telematics.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-03-2010, 03:59 PM
ozarkdan ozarkdan is offline
New Member
 
Join Date: Jan 2010
Posts: 7
Default GPS Speedometer

I need some help. My new project is to make a GPS speedometer for my car. I have a GPS Receiver/Antenna that was used with a marine speedometer(which I couldn't salvage). I need help understanding what signal(s) are transmitted by the receiver and how to determine speed from them. My search on the internet has been fruitless so far. I would greatly appreciate any and all guidence or suggestions. Thanks.

Dan
Reply With Quote
  #2  
Old 03-03-2010, 07:34 PM
beenthere's Avatar
beenthere beenthere is offline
Senior Member
 
Join Date: Apr 2004
Location: Missouri, USA (GMT -6)
Posts: 15,815
Blog Entries: 10
Default

Do you know who makes the receiver? Get the manual and that should tell you what data comes out.
__________________
First comes the hardware, then the software.
Reply With Quote
  #3  
Old 03-03-2010, 10:51 PM
davebee davebee is offline
Senior Member
 
Join Date: Oct 2008
Location: San Francisco Bay area
Posts: 526
Default

All the GPS receiver-only modules I've seen emit bursts of RS232 data using standard NMEA messages that look like this -

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545. 4,M,46.9,M,,*47

Lots of people have developed their own displays by having a microcontroller receive these messages, pull out the data they want to use and display it on an LCD.

Some GPS receivers can be configured to send many different messages having different selections of fields, and some have fields that will tell you your speed directly.

Maybe that's the kind of sensor you have. But like beenthere said, the best approach would be to start with the unit's manual, if you can find one.
Reply With Quote
  #4  
Old 03-03-2010, 11:17 PM
retched's Avatar
retched retched is offline
Senior Member
 
Join Date: Dec 2009
Location: Baltimore, MD
Posts: 5,198
Blog Entries: 14
Default

You have to take two sets of lat. and long. and figure the distance between the two and then calculate the time it took the receiver to travel from the two points, resulting in speed.(mph if you choose)

There is no easier way. Unfortunately. There may be some systems that xmit an average speed in a rs232 burst, but that would be a company specific option.
__________________
-rm-
Reply With Quote
  #5  
Old 03-04-2010, 12:10 AM
davebee davebee is offline
Senior Member
 
Join Date: Oct 2008
Location: San Francisco Bay area
Posts: 526
Default

Actually, there's an interesting thing I learned about GPS receivers.

Since the incoming GPS signal is so weak, and since the thermal noise in an amplifier is directly related to the bandwidth, they have to use a fairly narrow-bandwidth amplifier to keep amplifier noise from swamping out the signal.

But the Doppler shift of the signal as the GPS satellite is at different points in the sky shifts the signal a greater amount than the bandwidth of the receiver, so the local oscillator has to be shifted in order to place the IF signal into the narrow bandwidth of the amplifier.

But since the amount of shift of the local oscillator is directly related to the relative velocity between the satellite and the receiver, and the velocity of the satellite is known from its orbital parameters, then the velocity of the receiver is a free byproduct of the position decoding, completely independently from position decoding.

I've even read that since the frequency of the signal is less affected by ionispheric fluctuations than the timing of the modulation on the signal, that the velocity output from a GPS receiver is usually less noisy than the position output.
Reply With Quote
  #6  
Old 03-04-2010, 01:50 AM
retched's Avatar
retched retched is offline
Senior Member
 
Join Date: Dec 2009
Location: Baltimore, MD
Posts: 5,198
Blog Entries: 14
Default

Humph... So by measuring the dopler shift you can get a stellar speed? I guess you would still have two samples like 25,010mph on sample1 and 25,075mph on sample two subtracting the two gives you the receivers local speed?

Or is it more of a ratio? What does the resulting data look like?
__________________
-rm-
Reply With Quote
  #7  
Old 03-04-2010, 12:38 PM
Art Art is offline
Senior Member
 
Join Date: Sep 2007
Posts: 519
Default

Quote:
You have to take two sets of lat. and long. and figure the distance between the two and then calculate the time it took the receiver to travel from the two points, resulting in speed.(mph if you choose)

There is no easier way. Unfortunately. There may be some systems that xmit an average speed in a rs232 burst, but that would be a company specific option.
Not exactly, in fact exactly the opposite. The speed data in Kmph is right there delivered to your door as RS232 serial data.

Even a USB GPS mouse has a serial terminal if you pull it apart.

To make a machine that is strictly a speedometer only, you are only interested in two NMEA sentences:
Quote:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4 ,230394,003.1,W*6A


RMC Recommended Minimum sentence C
123519 Fix taken at 12:35:19 UTC
A Status A=active or V=Void.
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
022.4 Speed over the ground in knots
084.4 Track angle in degrees True
230394 Date - 23rd of March 1994
003.1,W Magnetic Variation
*6A The checksum data, always begins with *


$GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48


VTG Track made good and ground speed
054.7,T True track made good (degrees)
034.4,M Magnetic track made good
005.5,N Ground speed, knots
010.2,K Ground speed, Kilometers per hour
*48 Checksum
Look at the "A" value in the $GPRMC sentence to tell you the GPS unit has a valid position fix so you know the speed value isn't going to be rubbish.

Look at the KMPH value in the $GPVTG sentence, and there's your speed.
Alternatively you can just as easily aquire the speed in knots from the $GPRMC sentence.
You can do a simple calculation to convert Kmph to mph if you wish.

But while you're at it, you might as well get the bearing as well.

A speed logger/playback device I made a few years back:
http://www.youtube.com/watch?v=hWDVA7Sby30

BTW, NMEA sentences are pretty much standard. Variations across brands I've only seen introduce new sentences you can just ignore.


Cheers, Art.

Last edited by Art; 03-04-2010 at 12:43 PM.
Reply With Quote
  #8  
Old 03-04-2010, 02:34 PM
BMorse's Avatar
BMorse BMorse is offline
Senior Member
 
Join Date: Sep 2009
Location: Vermontville, Michigan (GMT -5)
Posts: 2,658
Blog Entries: 15
Default

If the GPS antenna is dumping serial data there are 4 main strings you can parse to extract all the info you need, which are standard for almost all brands of GPS receiver antennas....

GPGSA
GPGSV
GPGGA
GPRMC


In the GPRMC string you can extract the SOG (Speed over ground), and multiply it by 1.151 to get MPH....

here is the code I used in my GPS application I wrote for the pocket PC (ported it over to that format) and for Visual Basic 6.0....bold section is for the SOG extraction and calculation routine in the function....

Code:
Public Function Extract_RMC(ByVal iText As String)
'to extract and display each data
On Error Resume Next
Dim SearchChar As String
Dim mDir As String
SearchChar = ","
Dim MyPos As Long
Dim SecPos As Long
'to extract the protocol header
If iText <> "" Then
iText = Mid$(iText, 8)
'UTC
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtUTC = Mid$(iText, 1, MyPos - 1)
iText = Mid(iText, MyPos + 1)
'Status
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtStatus.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'Latitude
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtLatitude.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'N/S Ind
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
mDir = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'Longtitude
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtLongtitude.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'E/W Ind
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
mDir = mDir & Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
txtDirection.Text = mDir
'SOG
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
'lblSpeed = "Speed (mph): " & Format(curstr * 1.151, "0.00") & " (" & Format(maxspd, "0.00") & " MAX)"
txtSpeed.Text = Mid$(iText, 1, MyPos - 1)
txtSpeed.Text = Format(txtSpeed.Text * 1.151, "0.00")
iText = Mid$(iText, MyPos + 1)
'COG
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtCOG.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'Date
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtDate.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'Magnetic Var
MyPos = InStr(1, iText, SearchChar, vbTextCompare)
txtVar.Text = Mid$(iText, 1, MyPos - 1)
iText = Mid$(iText, MyPos + 1)
'Me.Caption = iText
End If
End Function
Select All
B. Morse
__________________
There is no spoon -Neo-
Disclaimer: The example programs,circuits, projects and information I provide or post on this web site are for educational purposes only. By copying anything from this site posted by me, you agree to the "as is" nature of the programs, circuits, information and to the statements listed in this disclaimer.No warranty or liability is expressed or implied. Working with AC /DC voltages can be dangerous and even deadly. Proceed at your own risk!

Last edited by BMorse; 03-04-2010 at 03:02 PM.
Reply With Quote
  #9  
Old 03-04-2010, 03:00 PM
BMorse's Avatar
BMorse BMorse is offline
Senior Member
 
Join Date: Sep 2009
Location: Vermontville, Michigan (GMT -5)
Posts: 2,658
Blog Entries: 15
Default

I basically wrote an app for the PocketPC so I can have basically my own GPS unit in my truck, but it also doubled as a GPS data-logger, whos data I can import to a PC and view the corresponding maps to the locations from the file, I am working on making it a uc based data logger to store GPS data on an SD Card using a Pic32MX UC.....

here is the screen shot of the PC side app and some MAP data it pulled of the web based on the coordinates in the GPS data...

GPS DATA.jpg

B. Morse
__________________
There is no spoon -Neo-
Disclaimer: The example programs,circuits, projects and information I provide or post on this web site are for educational purposes only. By copying anything from this site posted by me, you agree to the "as is" nature of the programs, circuits, information and to the statements listed in this disclaimer.No warranty or liability is expressed or implied. Working with AC /DC voltages can be dangerous and even deadly. Proceed at your own risk!
Reply With Quote
  #10  
Old 03-04-2010, 03:06 PM
BMorse's Avatar
BMorse BMorse is offline
Senior Member
 
Join Date: Sep 2009
Location: Vermontville, Michigan (GMT -5)
Posts: 2,658
Blog Entries: 15
Default

Quote:
Originally Posted by Art View Post
A speed logger/playback device I made a few years back:
http://www.youtube.com/watch?v=hWDVA7Sby30

Cheers, Art.
That must have been quite a "jerky" drive going from 70 to 14 or 80+ to 0 just like that ...... looks like your update of the display is not quite "real Time"... cool gadget though....

B. Morse
__________________
There is no spoon -Neo-
Disclaimer: The example programs,circuits, projects and information I provide or post on this web site are for educational purposes only. By copying anything from this site posted by me, you agree to the "as is" nature of the programs, circuits, information and to the statements listed in this disclaimer.No warranty or liability is expressed or implied. Working with AC /DC voltages can be dangerous and even deadly. Proceed at your own risk!
Reply With Quote
Reply   Post New Thread

Tags
,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Project: GPS Tracker OldSpring The Completed Projects Collection 13 02-07-2012 09:19 PM
GPS Mapping Application Art Programmer's Corner 1 08-18-2009 11:04 PM
12v dc power supply for gps maura The Projects Forum 8 03-22-2009 10:59 AM
Powering a combination circuit, hacking a GPS antenna clathe Embedded Systems and Microcontrollers 7 03-06-2007 01:40 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.