GPS
Figure 1: NEO6MV2 GPS module
The NEO6MV2 stand-alone GPS module allows you to receive data from GPS satellites in order to calculate the location of your project. To work properly, the module needs a clear line of sight to the satellites and it may not work indoors.
The module uses a simple serial connection consisting of a transmit (tx) pin and a receive (rx) pin. The Particle Argon has only one UART and you need to connect the tx pin of the module to the rx pin of the Argon and vice versa as shown in Figure 2.
Some GPS libraries available through the Particle IDE only work with the Particle Photon.
With the Argon, you need to choose the Particle-GPS
library. You can use the example
sketch all-data.ino
(shown below) to test your hardware setup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
When the sketch is running, you can use the Particle CLI to monitor the serial communications. In a terminal window on your computer, type the following command.
1 |
|
If everything is working, you should see a series of data blocks like the one shown below which is made up of one National Marine Electronics Association (NMEA) sentence per line.
1 2 3 4 5 6 7 |
|
Notes
$GPGLL: Geographic position, latitude / longitude
$GPGGA: Global Positioning System Fix Data
$GPGSA: GPS dilution of precision (DOP) and active satellites
$GPGSV: GPS satellites in view
$GPRMC: Recommended minimum specific GPS/Transit data
$GPVTG: Track Made Good and Ground Speed
The example above shows how the output looks before the GPS resolves the location. Line 4 shows that there are 16 satellites in view, but there is no location information in line 1. It may take up to a few minutes for the module to resolve the position at which point the displayed information will look more like that shown below.
1 2 3 4 5 6 7 |
|
In this example, the $GPGLL sentence can be interpreted as follows:
Element | Value | Meaning |
---|---|---|
Sentence identifier | $GPGLL | Geographic Position, Latitude / Longitude and time |
Latitude | 5558.14854 | 55 degrees, 58.14854 minutes |
North/South | N | North |
Longitude | 00309.70605 | 3 degrees, 9.70605 minutes |
East/West | W | West |
Timestamp | 171248.00 | 17:12:48 UTC |
Validity | A | Valid |
Checksum | A*7D | Error check |
The behaviour of the module can be disconcerting when it first starts. The on-board LED only starts to flash once a fix has been obtained. Until then, there is no visible sign that the board is working. If you are looking for reassurance that everything is working correctly, it is therefore better to rely on the data output rather than on the hardware itself.