INGREDIENTS:
-1x Linkit ONE board
-1x GPS antenna
-1x Lithium-ion Battery
PURPOSE:
This is a quite simple project that will let you track something, by saving continuosly its Β GPS position and other usefull informations.
Data are stored in a file named "yyyy-mm-dd.txt",Β so a new file is created every day.
here is an example:
Each line is in this format:
date,time,latitute,longitude,altitude,dilution of position, geoid, track angle, speed in knots, speed in m/s,signal fix, number of visible satellitesΒ
SOFTWARE:
You can choose the storage you want to use by uncommenting one of the following lines:
#define Drv LFlash // use Internal 10M Flash // #define Drv LSD // use SD card
The sketch will store GPS informations only if there are at least 4 visible satellites. if you read the NMEA sentence with less than 4 satellites you'll find the last known GPS data, and wrong date and time.
if (getData(&info) > 3)
The main function in the skecth is getData, which extract information from NMEA sentences and convert them into a more pratical format.
I take data from GGA and RMC, because they contain usefull and pratical information.
GGA:
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 Where: GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038,N Latitude 48 deg 07.038' N 01131.000,E Longitude 11 deg 31.000' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode 08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4,M Altitude, Meters, above mean sea level 46.9,M Height of geoid (mean sea level) above WGS84 ellipsoid (empty field) time in seconds since last DGPS update (empty field) DGPS station ID number *47 the checksum data, always begins with *
RMC:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A Where: 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 *
HereΒ you can find the list and structure about all the NMEA sentences
Longitude and latidute are given in (d)ddmm.mmmm and direction format, so I converted them into a signed (d)dd.mmmmmm format because it will be usefull then for calculations or for using google maps tools.
float convert(String str, boolean dir) { double mm, dd; int point = str.indexOf('.'); dd = str.substring(0, (point - 2)).toFloat(); mm = str.substring(point - 2).toFloat() / 60.00; return (dir ? -1 : 1) * (dd + mm); }
MORE
The next step of this project, is to store data on internet and then show them on Google Maps.
This summer I travelled along Italy and I made some test, here are the results:
Comments