In this tutorial I will show you why and how to setup GPS in Betaflight, and explain what GPS module you should get. With GPS enabled you can display coordinates and home arrow on OSD, or have GPS rescue mode available.
Why Use GPS on FPV Drone?
You can display useful info on your OSD, including the location of the quad (latitude and longitude), distance to home, speed, altitude and arrow pointing home. The last known GPS coordinates can help you find the quad after you crash.
You can even enable Betaflight Rescue mode – similar to “return to home” feature that’s commonly found in DJI camera drones. When working correctly, the drone can fly back to you on its own when signal is lost! I don’t know how many times Rescue mode has saved me from crashing/losing my drones, it’s the main reason why I always have GPS setup in my drones whenever possible. Once you have setup GPS following this guide, you can check out my other tutorial on how to setup GPS Rescue Mode in Betaflight.
For flight controller firmware that supports features like “Return to Home” or “Position Hold”, requires GPS module to work.
What’s the Best GPS Module for Betaflight?
There are a lot of options when it comes to GPS modules.
In Betaflight, compass is not required for Rescue mode to work, so it’s not necessary to use a GPS receiver with built-in compass, which is heavier and more expensive. A small GPS module would be preferable for FPV drones, because every gram counts!
I have great experience with the BN-220 (on average over 20 satellites within a couple of minutes), buy here
- AliExpress: https://s.click.aliexpress.com/e/_DENus9Z
- Banggood: http://bit.ly/2nD6QxP
- Amazon: https://amzn.to/3Xelr1F
There is a smaller GPS, the BN180:
- Banggood: http://bit.ly/2TWrozB
- AliExpress: https://s.click.aliexpress.com/e/_DmhWxar
- Amazon: https://amzn.to/3WrXuD7
I have tried both 220 and 180, they both are functional for FPV and can get a satellite lock within a minute or two, but I tend to get more satellites with the BN220 (a few more). The BN180 is smaller and lighter, and it doesn’t have flash memory for saving configuration. This is an important consideration if you want to change GPS config to boost performance. I would use the BN220 whenever possible.
If the BN180 isn’t small enough, then you can check out the NLRC Tiny GPS, it weighs only 1.6gr. However it’s not as sensitive as the bigger GPS modules with larger antenna (it takes almost twice as long to get a lock, and doesn’t always see as many satellites), but hey, it’s absolutely tiny!
If you want a powerful GPS option, then check out the BN-880. It’s the biggest of all the modules listed here, it has a built-in compass, useful for firmware like iNav but not necessary for Betaflight Rescue mode to work. So I think BN220 or BN180 is enough for Betaflight.
Get the BN880 here:
There are many other GPS receivers (some are just rebrands), it can be confusing what to choose. It’s important to get one with M8N chip, not the older versions such as M7N. M8N can get a GPS fix quicker because it can see 2-3 different satellite constellations (systems) at the same time. It effectively doubles or even triples the number of satellites the GPS receiver can see.
If you see some scratches on the metallic patch of the GPS antenna, it is not necessary defect or damage, it could just be the result of antenna tuning during final testing in the factory. These types of antenna have a nominal tuned frequency, but are often impacted by construction, components location and soldering. Placing small nicks in the centre of the long edges, or corners, can fine tune its frequency.
Most of these GPS units come pre-configured, which means they are plug and play with our flight controller out of the box. However, you can modify settings in the GPS receiver to optimize it for certain applications.
On BN220, BN180 and BN880, there are two LED indicators, labelled “TX” (usually blue) and “PPS” (usually red).
Flashing blue (TX) indicates UART usage. If it is off, then the GPS is not sending data out. This is also an indicator of the refresh rate, in 1Hz it should flash once per second, while in 5Hz it will flash 5 times a second.
Flashing red indicates the 2D/3D fix status of the GPS. If “PPS” is off then you don’t have a fix yet.
Connecting GPS to Flight Controller
Wiring the GPS module to a flight controller is straightforward, just connect it directly to any free UART on the FC (TX to RX, RX to TX), and power it with 5V.
On some FC (such as the Speedybee F405 V3), there are 4V5 pads, this is the same as 5V pad, but these pads can get power from USB port too. This allows you to power your GPS by simply connecting the USB cable, no need to plug in the LiPo battery to power the GPS. As we know GPS can take a while to get a satellite lock, if you connect the LiPo while waiting for GPS on the ground, your VTX can overheat. If you just plug in the USB cable, your VTX isn’t powered. It also speeds up satellite lock because the VTX isn’t interfering with the GPS. Your FC might have 5V pads that can be powered by USB, but labelled differently, check with a multimeter if not sure.
How to Setup GPS in Betaflight
In the Ports tab in Betaflight, select GPS under “Sensor Input” for the UART that is connected to the GPS receiver. In this example, UART6. If you are not sure about the baud rate of your GPS, simply select Auto and let Betaflight choose for you.
Betaflight supports the following speeds: 9600, 19200, 38400, 57600, 115200. If your GPS is set to a non-supported speed, then AUTO mode will not work.
In the Configuration tab:
- Enable GPS (for navigation and telemetry)
- Select Protocol, it’s either UBLOX or NMEA. Usually it’s UBLOX for BN180/BN220, but try the other if it’s not working
- Enable Auto Config
- Enable Auto Baud if you set Baud Rate to Auto in the Ports tab, otherwise disable it
- Save and Reboot
Once you have wired and set it up correctly, you should see the GPS indicator light up at the top of the configurator (that means the GPS is talking to the FC). If GPS module is not powered, you try to plug in the LiPo battery.
Pro Tip: How to check if my GPS is working at all?
How do I know if my GPS module is talking to the flight controller at all? Is the UART connection correct?
Well one way to find out is to run the ‘gpspassthrough‘ command in the CLI. It will let you see if there is any data communication going on between the FC and GPS module.
If the GPS module is talking to the FC, you should see a load of hieroglyphic binary data characters. If you see nothing, then the GPS is either dead/unpowered, or the UART connection is incorrect, or there’s something wrong with your setup.
If the GPS icon doesn’t light up, you can’t proceed to the next step. Check again your wiring and configuration (e.g. try a different protocol, different baud rate etc). Try a different GPS module if you have a spare one.
Now you need to wait for the GPS unit to get a”3D fix” (aka “satellite lock”), it happens when it sees locks on to 4 or more satellites. It might take a few minutes depends on your location.
When it gets a 3D fix, the red LED on the BN-220 module should blink (together with the blue LED). You will see information under GPS in the Setup page, where it says “3D Fix” is True, and shows your coordinates.
When you power up the GPS module for the first time in a new location, it always takes longer to find satellites. This is referred to as a “cold start”. Once you’ve got a 3D fix the first time, it will get a lock much faster after that when you restart the GPS module (e.g. when you change battery), because your GPS remembers the location of the satellites.
You are more likely to get a lock outdoor. If you have to test this inside the house, try to get close to the windows with the antenna pointing to the sky, but it’s much harder than being out in the open.
You can display GPS info in the OSD. Check out this tutorial about Betaflight OSD if you are not familiar with it. You can display GPS coordinates, distance and direction to home and more.
Once you have GPS setup and got a lock, go to the radio’s telemetry page, select “Discover new sensors”. Some GPS related new sensors should appear including GPS coordinates. This only works if you have Telemetry enabled in your radio system. This allows you to log GPS coordinates in your radio. so you know the last known position of your aircraft. This helps to search for the lost quadcopter if you can’t see the coordinates in your DVR.
Testing GPS in Betaflight
You want to test the GPS thoroughly before relying on it for long range flying.
First of all, place the gps sats element in your OSD, so you know how many GPS satellites have been acquired without going into Betaflight Configurator. 6-8 is the minimum for rescue mode to work, the more the better. Your GPS coordinates will also get more accurate when you acquire more satellites.
Then you want to check if the GPS coordinates you are getting are correct. Enter those coordinates in Google Maps, and see if it points to where you are. Don’t get latitude and longitude mixed up, and watch out for the minus sign!
Mounting GPS Module
One common mistake is mounting the GPS upside down. The GPS receiver antenna should be facing up, it’s a flat square with small metal circular part in the middle. There should be no components at all on this side. As an example, this is the ceramic antenna in a GPS receiver, it should be facing up.
Make sure there’s nothing blocking or interfering with the GPS unit at anytime. Mount it on top of your quad, as far away from the VTX / RX antennas as possible (many radio receivers can actually transmit signal as well due to their two-way communication nature when telemetry is enabled). Also beware some HD cameras might produce radiation that can affect your GPS signal as well if they don’t have the appropriate shielding.
Here are some ideas where/how to mount the GPS module in an FPV drone.
On top of your GoPro/HD camera.
On top of your frame if you have an under-slung battery.
Using a mast to keep the GPS as far away from the quad as possible. But probably a bad idea to have it so close to the VTX antenna in this example…
The rule of thumb is that the GPS must see the sky at all times (except when you are doing a roll or inverted yaw spin).
Before your flight, it can take a while to get a GPS lock. You might want to power on your quad and GPS beforehand to “warm up” first, e.g. on the way to the flying field.
Setup Rescue Mode
If your GPS is working, you should now setup Rescue Mode in Betaflight, so when you lose signal, or when you get lost, you can just flip a switch and the drone will find its way home!
Additional Sensors for GPS
Additional sensors are not required for GPS in Betaflight. But by combining measurements from other sensors can give you a better picture of what the drone is doing. I will add more info here later.
A barometer is a pressure sensor that measures altitude. It’s more accurate than solely using GPS’s estimation. Many flight controllers come with a Barometer (BMP280) onboard, you can find out in the FC specs.
The compass is for measuring which direction the quadcopter is facing. Some GPS modules has built-in compass, or you can get external magnetometer and connect it to the FC via the i2c port. Betaflight doesn’t require a compass to work, it works out its direction by constantly comparing GPS coordinates.
How to Get a GPS Lock Faster
Most GPS modules have a small battery, which is used to store satellite information and time for a faster lock.
After the GPS module gets a satellite lock, it remembers all the satellite locations, so after you change the drone’s battery (the GPS module is powered off briefly), the GPS lock usually can resume almost immediately. But when the GPS doesn’t have satellite information stored in memory, or the satellites it remembers are no longer in view, it will take much longer to get a lock.
This is why some people powered on their quad (or just the GPS module) prior to their flight just to get a lock, so they don’t have to wait around before taking off.
If your GPS always takes a long time to get a lock, it’s worth checking if the battery is dead (with a multimeter). Also make sure there is as little interference to the GPS as possible, for example if you are using1.3GHz FPV setup, try moving powerful VTX away from the GPS. Cloudy day can also have an effect on GPS signal quality.
Also check out my post about optimizing GPS settings to get more satellite locks.
Not Getting GPS Lock
Interference from other electronics such as your VTX, radio receiver if you have telemetry, or even nearby wires that carry a lot of current can prevent the GPS from getting a lock. If you have trouble getting a GPS lock, try the following:
- Try to power your FC from USB and see if that powers up your GPS module. If not, try to move your GPS module power to another pad on the FC that gets power from the USB port
- Powering only the FC without the VTX should make it easier for the GPS to get a lock, once you get a lock, it should stay locked normally even when the VTX is powered on. But it’s still a good idea to mount your GPS as far away from VTX antenna and RX antenna as possible
- Shielding nearby wires can also help sometimes. Wires carrying current are like antennas, they could also potentially mess with GPS
GPS satellites transmit data on two frequencies, L1 1575.42MHz and 1227.60MHz, hence 1.3GHz FPV can cause interference to your GPS. Most people run 5.8GHz so this shouldn’t be an issue. But since GPS signal is so weak (it’s all the way from space after all), any powerful signal nearby can cause interference, therefore you should mount the GPS module as far away from any transmitting sources as possible.
When you run your GPS wires to the FC under the VTX, it can also cause issues as certain VTX’s don’t have proper RF shielding and the RF noise is enough to mess up your GPS. For example the Avatar VTX is known to cause GPS issue when running wires under it. Solutions could be properly grounding the VTX shielding, but you could also try to shield the wires between the GPS and FC, and make sure to ground it.
I tried shielding the wires with some foil in one of my quads, then connect the foil to a ground pad on the FC (to ground it). Finally wrap it with some cloth tape so it doesn’t short the frame. Some people reported good result with this modification, for me the improvement is little, but it’s worth a shot if there’s no other easy solution.
- Aug 2018 – Tutorial created
- Jan 2023 – Updated