Skip to first unread message

Jordan Warne

unread,
Oct 24, 2015, 11:34:07 AM10/24/15
to MIT App Inventor Forum
how can you make a GPS speedometer?

SteveJG

unread,
Oct 24, 2015, 12:03:23 PM10/24/15
to mitappinv...@googlegroups.com
Impossible to make an instantaneous speed GPS speedometer with App Inventor Jordan.  The best one can do is take a gps fix at one point, then perhaps a minute later take the fix at another point; calculate the distance between the points and divide by the time between the readings.  That is the average speed of travel assuming the Android traverses a straight path.

Several factors prevent instantaneous speed and calculation of speed over small sampling time intervals:
1: the time required for the GPS to acquire a satellite fix (which is variable from a few seconds to over 20 seconds perhaps)

2: the LocationSensor property called Accuracy" (which is a measurement of the statistical probability the GPS actually is where you think the Android is located. Read the LocationSensor tutorial and the Accuracy square part of    "

AI2 Static Maps 104…calculate distances between points and add an Accuracy Square

for an explanation.     Exploring with Location Sensor in AI2

The location sensor object is used to communicate with the global positioning satellite receiver (GPS) in your phone/tablet. When the LocationSensor communicates with the built-in GPS receiver, the GPS can determine the location of your device.  The sensor can also work with network/wifi location services.  Finding a location using the network uses very different techniques to determine a location. Location means, the device's present latitude and longitude or it can mean your street address.

The 104 tutorial also shows ways to calculate distance between two points.

3) There is no simple calculation method that can produce a distance between point following a path  using AI2/  Simple methods are available to calculate straight-line distance between points.  If a vehicle makes turns between location fixes, the distance traveled is greater than what the simple distance calculation will provide.

You can have fun calculating speed; however, the measurement will not be precise.  The AI2 LocationSensor has no method to calculate speed.

You might also review the following links:  https://groups.google.com/forum/#!searchin/mitappinventortest/speedometer    The link about arduino provides a possible solution that requires AI2, an Android and an Arduino microcomputer that might work for you.


Regards,
Steve




Reply all
Reply to author
Forward
0 new messages