You’ve built a brand new project, and it’s a wonderful little thing that’s out and about in the world. The only problem is, you need to know its location to a decent degree of accuracy. Thankfully, GPS is a thing! With an off-the-shelf module, it’s possible to get all the location data you could possibly need. But how do you go about it, and what parts are the right ones for your application? For the answers to these questions, read on!
All The Same, But Totally Different
Working with GPS may seem daunting, but thanks to the efforts of industry and individuals, these days, it’s remarkably straightforward. Most modules on the market all work in a similar way. They most commonly communicate over a standard serial interface, usually at 9600 baud, though I2C and SPI interfaces are also available. The messaging format is also standardised, with data being output in the NMEA-0183 format. This standard is well-documented for those wishing to parse the data. However, for those truly in a hurry, it’s possible to find code for many microcontroller platforms that will do the work for you. Projects like NeoGPS, Adafruit GPS, and minmea will take an incoming serial data stream, and spit out all the geographic location data you could possibly ask for. So is a GPS just a GPS?
Depending on your application, you may require different things out of your GPS module. Fast-moving platforms relying on GPS to guide an autopilot will benefit from a fast update rate, while a passive location tracking device may do perfectly well updating just once per second. Accuracy requirements are varied, with some applications requiring resolution down to the centimeter range. There are also additional features that help in edge cases, like dead reckoning and multi-constellation fixes. A clear understanding of your use-case and budget are key to picking the right hardware for the job.
I Just Need To Know Roughly Where It Is!
For applications where you’re looking for accuracy down to a few meters at low update rates, a basic GPS module will do. Available for under $20, they generally offer refresh rates of 1-5 Hz, and few bells and whistles. For many projects, this is enough for indicating the location of a person, robot, or vehicle. Basic autopilots can also get by at these refresh rates. Power draw of such modules is usually below 50mA, and communication is over serial.
Devices based on the GP-20U7 and the now-superseded uBlox NEO-6M fall into this range. Cheap and cheerful, they’re a great way to build your first GPS project on a budget.
I Need A Signal At All Times!
If losing a fix is unacceptable, or you’re trying to pull a lock in difficult urban environments, it pays to source a module capable of operating in such conditions. In these cases, features like external antenna connectors can help, allowing bigger antennas to be fitted. An important note is that the common PCB U.FL connectors are only rated for a handful of cycles, and break easily – so consider getting a U.FL to SMA pigtail to avoid this. Antennas come in many shapes and sizes, but most dedicated parts will be an improvement on the standard small ceramics that come with many modules.
Getting an accurate location fix depends on having a clear signal from a multitude of satellites – so having more to choose from makes this easier. Modules that can also pick up signals from alternative constellations are more likely to “see” enough satellites to get a fix. With China’s BEIDOU, Europe’s Galileo, and Russia’s GLONASS systems in orbit, having a module that can pick up these additional signals can be a huge benefit when working in complex environments with limited view of the sky.
Sometimes, though, no matter what, you’re going to be out of reach of even a single satellite. Things like tunnels can make it impossible to get a fix. In these cases, modules that feature dead-reckoning come in handy. When signals drop out, the module uses onboard inertial measurement hardware to update the location fix until reception is resumed. This can make a big difference in usability, particularly for turn-by-turn guidance applications.
These added features can improve the availability of a fix, but come at a cost. Modules like the XA1110 and ublox NEO-M8U ship in the $50-100 range. However, for the price, they also often pack in additional interface options like USB-serial and I2C, along with higher update rates.
I Need Fast Updates!
If you’re building something that moves at rapid speeds, 5 Hz updates might be a little slow for your tastes. Faster modules update anywhere from 10Hz to 25Hz, providing much better guidance for whatever you’re building that might have cause to travel so quickly. Of course, if you’re building a cruise missile, you’re probably not shopping at Sparkfun, but hey, go off queen! These devices generally communicate at higher baud rate serial or I2C to provide quicker location updates.
Modules offering this capability can still be had fairly cheaply, falling anywhere from $20-100. Look out for units like the SAM-M9N or BN-880Q for your high-speed projects.
I Need Accuracy Down To The Centimeter!
For some applications, accuracy is everything. If you’re piloting a combine harvester and don’t wish it to drive through a fence, a fix down to the meter simply isn’t good enough. In these cases, receivers using Real Time Kinematics (RTK) technology are just the ticket. They pair the received satellite signals with local correction data sourced from a base station, ideally within a 10 km radius of their position.
This data can be provided over the Internet or via a LoRa radio link, and allows the module to deliver a fix accurate down to the centimeter in ideal conditions. Some operators run base stations for public use, but it’s possible to run your own with the right hardware. Many high-end modules can be set up to act as a base station for other units operating in the area.
The cost of this accuracy is complexity and, of course, price. RTK-capable GPS modules come in at around the $200-300 mark, featuring modules like the NEO-M8P and ZED-F9P. A base station is also required to provide correction data, and you’ll have to provide your own if one isn’t available locally. You’ll need to get the data into the module too, either over the internet or other radio data link. Be sure to account for these requirements when costing the design!
Conclusion
We are blessed to have access to a wide variety of GPS modules aimed at the maker market, spanning a broad spectrum of capability and price. Where high performance once cost thousands of dollars and was only available at the industrial level, now it can be had for much less from a variety of retailers online. Use your project requirements as a guide, and set forth to complete your now location-aware project. As always, happy hacking!
And soon (TM) we’ll have access to L5-capable devices outside of current high-end phones and we’ll be able to get down to 30cm or so (I think). Can’t wait.
Like the ublox F9P? But multi-frequency antennas are more expensive than L1 only ones.
I’ll choose GPS!
Because, it’s American!
B^)
But the GPS unit you use is made in China.
u-Blox at least is a swiss company.
Is there a similar guide that lists WAAS (SBAS) capable modules.
I would think modules that do glonas, GPS and all the others would be fast and accurate.
I pulled the GPS receiver out of an automotive aftermarket GPS a few years ago. Sort of like the GP-20U7 linked in the article. It only had a small RF connector on it, no separate Power, Ground.
I figure it is using phantom power, but I’m not sure how to hook it up.
Is it not just an antenna alone? If yes, probably can be connected to any module that puts 2.5-5V DC bias on the input.
I have really been a fan of ublox hardware and the massive reams of documentation from their software and api’s are not too bad to wade through if you need something specific.
I am using the NEO-M8N at the moment and it is pretty powerful and accurate indoors with a good antenna.
Be aware that running too many outputs or processing onboard can hamstring performance, so keep an eye on asking for things like multiple augmentation constellations (was/sbas) and having all of the interfaces on if you are only using usb for example.
I have also read a few times that if you want to use it for timing, picking a multiple of the internal oscillator drastically improves the jitter on the timing pin as opposed to forcing it to an arbitrary frequency.
I also like the LEO/NEO as they are keeping the footprint the same for a few generations, so you can design all your stuff with cheap modules and upgrade if you need something better.
Ublox have a gotcha that if you try to output too much on a port all of the output ports stall. The trick is to turn off all the outputs on the ports you are not using and crank the serial port baud rate up.
Also the m8c or m8q can run a faster output rate than the m8n
I also avoid using the chatty NMEA protocol and use u-Blox own binary UBX protocol. Disabling all messages and only enable the PVT message further reduces bandwidth. Another drawback of the M8 modules is that the update rate goes down if you enable multiple GNSS systems. The new M9 chipset fixes this and gives you 25Hz update rate even with Glonas/GPS/Galileo/Beidou enable at the same time,
And then there’s 1PPS as well as IRIG outputs.
https://en.wikipedia.org/wiki/IRIG_timecode
I’ve seen 5 Hz in combination with OBD-II.
@Ostracus said: And then there’s 1PPS as well as IRIG outputs.
1PPS is ubiquitous. But can you tell us about an affordable GPS module or device that provides 1KHz IRIG-B output?
@Ostracus said: And then there’s 1PPS as well as IRIG outputs.
Yep – No response… Too bad. Insert Sad Face
For completeness’s sake, here’s an option for “I need accurate position fixes in orbit, regardless of the high-radiation environment, with extreme reliability”: https://gdmissionsystems.com/products/communications/spaceborne-communications/spaceborne-gps-receivers/sentinel-m-code-gps-receiver
There’s also the NavSpark range of dev boards that integrate GPS and a microcontroller (programmable from the Arduino IDE) into a single board for $25. They also have specialised variants for RTK, high precision timing, and high update rates.
NavSpark seems to add value by selling break-out boards for the SkyTraq “chips” and some added user + software support, and they do a good job IMO. NavSpark and SkyTraq seem to live in Taiwan. The NavSpark/SkyTraq products are very interesting, but in a commercial build be careful – it seems there is no second source, and no disclosure on what components and/or software come out of the Chinese Communist Party (CCP) controlled mainland. Links follow…
http://www.navspark.com.tw/
https://www.skytraq.com.tw/homesite/
One more use case — what if all I want is an accurate time reference for a clock with no WWV reception? How cheap can I get?
Very cheap. Even most of the low-end modules available from China have a flashing LED on the board, which is driven from the PPS output of the GPS module. Even if the module doesn’t have a dedicated PPS pin, you can just lift the anode of the LED and attach a wire to the (now free) end of the resistor to provide the Pulse Per Second drive to your clock circuitry.
For those who don’t know already, Christan Baars integrated GPS-as-a-sensor into TASMOTA at the beginning of the year. It doesn’t make a very accurate NTP server, but it does make an accurate clock for humans.
https://esp8266hints.wordpress.com/2020/03/06/using-a-gps-with-tasmota-part-i/
How does one find out if there are existing RTK base stations in the area?
You can check out
http://www.mywayrtk.com/detailedmap/
Sorry, above link is not free. Can’t edit my comment.
Coverage map is free. Hardware and service, not so much.
Thanks all. It seems that SparkFun have a module for a DIY solution, but still pretty expensive (US $199.95). They also have some good tutorials on RTK and a few links to external sources.
Here’s a link to a cheaper option.
http://navspark.mybigcommerce.com/ns-hp-gn2-px1122r-multi-band-quad-gnss-rtk-breakout-board/
Hi, does anybody know what happened to the 4800 Baud baudrate? Is it still supported?
– Please excuse my ignorance, but I’m not up to date in terms of GPS, I’m afraid .. 😅
Last time I messed with these receivers, I tried to get an APRS tracker going..