Maker.io main logo

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.‎

Raspberry Pi Flight Tracker

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.‎

flashing_1

Before flashing the SD card, open the advanced options by clicking the gear icon.‎

advanced_2

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.‎

software_3

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.‎

connect_4

name_5

Once logged in, make sure your Pi’s software is up to date by entering the following commands:‎

Copy Code
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_6

Install the flight tracker software:‎

Copy Code
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.‎

Fight Tradar24

Step 1.2: Since this is our first time setting up a flight tracker, we can leave this step blank.‎

blank_8

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.‎

yes_9

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

enter_10

Step 3.B: Enter your antenna’s longitude.‎

anntena_11

Step 3.C: Enter your antenna’s altitude. Remember to enter the altitude in feet.‎

altitude_12

You will then be asked to confirm these settings are correct.‎

settings_13

Step 4.1: Specify your receiver. For the RTL2832-based SDR USB dongle we are using, we can select ‎option 1.‎

receiver_14

Step 4.3: Leave this step blank.‎

step_15

Step 5.1 & Step 5.2: We don’t need these data feeds, so we can answer no to both.‎

no_16

Step 6: Enter 0 to disable logging.‎

logging_17

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

view_18

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.‎

homepage_19

homepage_20

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.‎

position_21

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.‎

case_22

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

case_23

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

制造商零件编号 SC0623
AC/DC WALL MNT ADAPTER 5.1V 13W
Raspberry Pi
¥65.12
Details
制造商零件编号 USDCOEM-32GB
MEM CRD MICSD 32GB 10UHS 1V10 3D
Delkin Devices, Inc.
¥102.32
Details
制造商零件编号 1497
SOFTWARE DEFINED RADIO USB
Adafruit Industries LLC
¥235.50
Details
制造商零件编号 PTR-28483-C
BOX PLASTIC CLEAR 8.6"L X 6.3"W
Bud Industries
¥146.10
Details
制造商零件编号 PTX-18483-P
PLASTIC INTERNAL PANEL
Bud Industries
¥20.65
Details
制造商零件编号 5308 905
CABLE GLAND 3-9MM 1/2" NPT
Altech Corporation
¥19.53
Details
制造商零件编号 7211 486
LOCKNUT NYLON 1/2" NPT GRY
Altech Corporation
¥8.52
Details
制造商零件编号 KTSB14
STEP DRILL BIT #14 - DOUBLE-FLUT
Klein Tools, Inc.
¥393.85
Details
制造商零件编号 PIM461
FAN SHIM FOR RASPBERRY PI
Pimoroni Ltd
¥96.90
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum