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?
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! Most GPS modules for FPV drones use either M8 or M10 chip. Both work fine for drones, but M10 are newer and perform better, get M10 if you can.
The benefits of M10:
- M10 GPS receiver can simultaneously connect to four Global GNSS (GPS, Galileo, Glonass, and Beidou), providing better coverage and reliability.
- With the M10 chip, GPS lock-on is faster and it can connect to more satellites compared to M8-based units.
- Improved performance in areas with interference or limited view of the sky.
- Despite its superior performance, the price difference between M8 and M10 units is not substantial, making M10 a cost-effective choice.
- Comes in different models (Nano, Mini, Pro) to suit different needs, with options like larger antennas and built-in compass.
There are a lot of options when it comes to GPS modules. I recommend getting one of these which I’ve personally tested with great results:
Top Performer – HGLRC M100 Mini
- Banggood: https://oscarliang.com/product-r3o7
- GetFPV: https://oscarliang.com/product-knfl
- RDQ: https://oscarliang.com/product-6zvg
- AliExpress: https://s.click.aliexpress.com/e/_DCXKBFj
Smallest Worth Having GPS – GOKU GM10 Nano V3
- GetFPV: https://oscarliang.com/product-kky6
- RDQ: https://oscarliang.com/product-sglj
- Flywoo: https://oscarliang.com/product-jwzb
Before M10 came around, BN-220 was the most popular choice with decent performance (on average it gave me over 20 satellites within a couple of minutes). However they have the older M8 chip with lower performance than M10, which means they generally take longer to get a lock and see fewer satellites. If you are struggling to get decent performance with this GPS, you can try optimizing the settings as shown here.
You can still get the BN-220 here:
- AliExpress: https://s.click.aliexpress.com/e/_DENus9Z
- Banggood: http://bit.ly/2nD6QxP
- Amazon: https://amzn.to/3Xelr1F
If you want a M8 GPS with onboard compass, then check out the BN-880. It’s the big brother of the BN220 with a built-in compass which is useful for firmware like iNav but not necessary for Betaflight Rescue mode to work.
Get the BN880 here:
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.
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.
Avoid using Softserial for GPS, as it only supports up to 19200 baud rate, and with 9600 baudrate the GPS is simply not reliable enough for GPS operations. It’s best to use a hardware serial port (any TX and RX pins on the FC), and set baudrate to 57600.
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. This component is essential for determining directions (north and east) while controlling the position during stationary or low-velocity movements. Some GPS modules has built-in compass, or you can get external magnetometer and connect it to the FC via the i2c port. However, be aware that magnetometers are sensitive to magnetic fields and require calibration. 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.
Can’t enable GPS after flashing Betaflight
It’s possible that GPS was excluded from the compiled firmware due to the new Cloud Build system in Betaflight 4.4.
To confirm this is the case, enter this command in CLI:
If CLI returns “gps not available”, then it means the GPS feature isn’t part of the betaflight firmware in your FC. In this case you will have to reflash your FC, this time you should make sure GPS included in the Cloud build system option when compiling it.
GPS Coordinates Decimals
To display GPS coordinates in the OSD you have the options to select how many decimals to display (currently only 4 and 7 decimals are available). It affects how precise the position is when you search for the coordinates on a map.
On Wikipedia page “Decimal Degrees” there’s a table on Degree Precision vs. Length.
decimal places degrees distance ------- ------- -------- 0 1 111 km 1 0.1 11.1 km 2 0.01 1.11 km 3 0.001 111 m 4 0.0001 11.1 m 5 0.00001 1.11 m 6 0.000001 11.1 cm 7 0.0000001 1.11 cm 8 0.00000001 1.11 mm
Beware of the difference between accuracy and precision. Your GPS may report any number of digits (its precision) but many of the decimal places might be just erroneous (accuracy)1.
- Aug 2018 – Tutorial created
- Jan 2023 – Updated