Build Your Own Raspberry Pi Flight Tracker
2023-03-16 | By Nate_Larson
License: See Original Project Raspberry Pi
Have you ever looked at a plane flying overhead and wondered where it was going? Where it came from? Did you know you can easily find out and help track aircraft using a Raspberry Pi?
All you need to put together a Raspberry Pi flight tracker is a Raspberry Pi, power supply, microSD card, and a Software Defined Radio (SDR) with Automatic Dependent Surveillance-Broadcast (ADS-B) support, such as the RTL2832-based SDR I received some time back in AdaBox007.
ADS-B information is transmitted by aircraft to provide identification and altitude information to other aircraft as well as ground-based air traffic control stations. Using an SDR, we can receive this data, and when paired with the data from other receivers using a service such as FlightRadar24, the position of the aircraft can be triangulated.
Setup the Operating System
To create your own flight tracker, begin by flashing your microSD card with the latest version of Raspberry Pi OS using the Raspberry Pi Imager.
Before flashing the SD card, open the advanced options by clicking the gear icon.
From the advanced options window, set your device’s hostname and password, enable SSH, configure your wireless LAN, and select your locale settings. Then write the operating system to your SD card.
Once the software is written to the microSD card, remove the card from the PC and install it on the Pi. Plug the SDR USB dongle into one of the Pi’s USB ports and power up the Pi.
Setup and Configure Your Flight Tracker
With your Pi booted, we need to connect to the Pi via SSH to install the flight tracker software. Note that this can also be done locally on the Pi by connecting a keyboard, mouse, and monitor directly to the Pi and opening a terminal window if you so choose.
Using a program such as PuTTY or Tera Term, open an SSH connection to your Pi using the hostname you previously assigned, followed by “.local”. In my case, I can connect to my Pi at FR24Pi.local.
Once logged in, make sure your Pi’s software is up to date by entering the following commands:
sudo apt update && sudo apt upgrade
sudo reboot
Allow your Pi to reboot, then reopen the SSH connection. The next command will install the FlightRadar24 flight tracker software. If you haven’t already signed up for a free FlightRadar24 account, you should go to https://www.flightradar24.com/premium/signup to do so now.
Install the flight tracker software:
sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
Step 1.1: When prompted, enter the email address used for your FlightRadar24 account.
Step 1.2: Since this is our first time setting up a flight tracker, we can leave this step blank.
Step 1.3: MLAT is the process by which aircraft positional data is triangulated as was mentioned earlier. To participate in these MLAT calculations, answer yes to this step.
Step 3.A: Enter your antenna’s latitude. You can find the latitude, longitude, and elevation for your location using this website: https://www.freemaptools.com/elevation-finder.htm
Step 3.B: Enter your antenna’s longitude.
Step 3.C: Enter your antenna’s altitude. Remember to enter the altitude in feet.
You will then be asked to confirm these settings are correct.
Step 4.1: Specify your receiver. For the RTL2832-based SDR USB dongle we are using, we can select option 1.
Step 4.3: Leave this step blank.
Step 5.1 & Step 5.2: We don’t need these data feeds, so we can answer no to both.
Step 6: Enter 0 to disable logging.
With that, the setup is complete, and we are now feeding flight data to FlightRadar24. Note that this process may take some time to finish, so be patient and keep this window open until the command prompt displays indicating the process is complete.
View Data
Now that setup is complete, you can view the flights your receiver is picking up by pointing your browser to your Pi’s hostname followed by “/dump1090/gmap.html”. In my case, this information is found at http://fr24pi.local/dump1090/gmap.html
Additionally, you can open the https://www.flightradar24.com/ homepage, select the filter option, and input your radar ID from above to see only the aircraft your receiver is picking up.
Getting Better Reception
You will note from the above filter that we are not currently able to track many aircraft in our region. This is due to the antenna being in a suboptimal location. Remember that antenna position matters, so for better reception, try placing your receiver near a window or outside. In optimal conditions, you may be able to track aircraft 250 miles from your receiver’s location. Below, you can see reception and range improved dramatically when I relocated the receiver to its permanent position on one of my outbuildings.
For the final placement, I mounted my Pi in a weatherproof enclosure with a clear lid so I can add a camera as well, but that is for a different project. I drilled holes using a step drill bit and used cable glands to seal the wires for the power supply and antenna to keep the enclosure weathertight so I could mount my Pi outside where the antenna would have unobstructed access to aircraft transmissions.
You may also notice I added a Fan SHIM to keep my Pi cool, for which you can find the installation guide here: https://www.digikey.com/en/maker/projects/getting-started-with-fan-shim/314fa57086944d00871adb95ccf4a804
Going Further
FlightRadar24 is just one of many flight-tracking communities available. Should you decide, you would like to feed your data to different or additional communities, the setup process is often similar and requires no additional hardware. Here are a couple other flight tracker communities you may consider contributing your data to:
https://www.adsbexchange.com/how-to-feed/#feedclient
https://flightaware.com/adsb/piaware/install
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum