# Thread: Getting speed off a bluetooth GPS device

1. ## Getting speed off a bluetooth GPS device

Hey guys,

I'm developing a J2ME MIDlet for a S40 device that connects and reads raw NMEA data off a BT GPS device (I used this as reference);
I need to be able to know whether or not the GPS device is in movement. The device will be in a car. Is there / can you think of a way to get the speed of the device off the GPS or otherwise find out if the device is in movement?

Thanks!

2. ## Re: Getting speed off a bluetooth GPS device

You need to check fetch and read the GPS data NMEA string after every 1 min from GPS reciever and if you get different readings of lat/long you can understand that the device is moving.

You can calculate distance between two pairs of lat/long and divide it by the time gap in which you have read these pair of lat/long to find the speed.

thanks,
~Amitabh

3. ## Re: Getting speed off a bluetooth GPS device

Hey,

Thanks for the response. I tried using a Vector to keep the last 5 coordinates read from the device (I query the device for its location every 1 second). I then took the min and max longitude and latitude out of the last 5 coordinates and then subtracted the min from the max to receive a diff. I tried to play around with that diff - couldn't really get to a place where I can really indicate a movement with a 10 seconds or so resolution. Anyone has a better idea?

Thanks!

4. ## Re: Getting speed off a bluetooth GPS device

afaik there are mathematical solutions for establishing the distance inbetween 2 GPS coordinates...
That's all you need, together with a time-stamp of these two coordinates....
You got the distance, you got the time, you can calculate the speed...
You should NOT calculate the difference in longitude and latitude and relate this to a disctance ! A specific difference in longitude/latitude is NOT constant throughout the globe... A distance of 1 latitude might be (as an example) 2000 meters in one part of the globe and 4000 meters on another part...

5. ## Re: Getting speed off a bluetooth GPS device

I see. Where can I find these mathematical formulas?

Thanks!

6. ## Re: Getting speed off a bluetooth GPS device

Try this service...

http://boulter.com/gps/distance/

thanks,
~Amitabh

7. ## Re: Getting speed off a bluetooth GPS device

you can find them on google
So did I so I am sure they are avalable...
It's better for you to search for them, because most of the time they are accompanied by an explanation and why you should choose for a specific one (there are a least a couple of different ones, some see the globe as a sphere and some don't because obviously it's not, but also makes the calculation much more complex)...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•