You can create all kinds of fun projects when you pair a Raspberry Pi with a low-cost USB Software Defined Radio (SDR). An SDR is essentially a radio wave receiver that can pick up signals from a variety of frequencies, such as digital television and AM, FM and DAB radio broadcasts. This tutorial will focus on the information transmitted by the transponders installed on aircraft flying overhead using Automatic Dependent Surveillance – Broadcast (ADS-B). These avionic systems provide information to identify aircraft, as well as their barometric altitude, to the Air Traffic Control (ATC) systems on the ground and to the Traffic Collision Avoidance Systems (TCAS) on other aircraft. Listening in to these signals provides a fascinating insight into a world we all take for granted.
Raspberry Pi 3 Model A+ is perfect for this project as it has a single USB A port, which is all we need, and our very best on-board Wi-Fi. We’re also going to team up with other SDR and aviation enthusiasts and contribute to Flightradar24, who operate the world’s largest network of ADS-B/Mode S receivers. This network, together with government air traffic control and other data sources, is how Flightradar24 is able to track aircraft around the globe. In other words, this is plane spotting — on steroids.
This project will work on any Raspberry Pi Model 3 or newer. For this tutorial, we’ll be using a Raspberry Pi 3 Model A+, so we will need a micro USB power supply. Raspberry Pi 4 models will require a USB-C power supply.
Projects like these are often left powered for long periods of time, so it’s important to have a good quality power supply for your Raspberry Pi. We recommend the official USB-C and micro USB power supplies, as they are designed to provide a consistent +5.1V with captive (that is, attached) USB cables. Don’t be tempted to use an old spare phone charger you may have lying around, as it may not provide sufficiently reliable power.
For the USB ADS-B receiver you can buy any RTL2832/R820T2-based USB dongle that’s available to you locally or from your favourite online retailer. Prices usually start around $20.
Another computer connected to your network. We’ll refer to this as “your usual computer”, to distinguish it from the Raspberry Pi computer that you are setting up for our flight tracker. We’re going to be accessing and controlling the Raspberry Pi via Wi-Fi from this computer, so there is no need for an additional keyboard, mouse, and display to be attached to your Raspberry Pi: this is called a headless setup.
Download a pre-prepared Raspberry Pi operating system image from flightradar24.com by clicking on the blue “Download Pi24” button:
NOTE: There are other ADS-B services that offer similar custom OS packages, e.g. FlightAware, ADS-B Exchange, and RadarBox, that will let you build an ADS-B ground station. We picked one here for the tutorial, but if you want to use one of the others the proceedure is going to look very similar. After installation you can also customise your installation to feed all of these services from a single Raspberry Pi.
We’re going to use Raspberry Pi Imager to install the operating system image onto our microSD card. Raspberry Pi Imager is available for free for Windows, macOS, Ubuntu for x86, and Raspberry Pi OS. Download it to your usual computer from here.
Connect your microSD card to your usual computer using an SD card adapter if you need one. We recommend a minimum storage size of 16GB. Open Raspberry Pi Imager, click CHOOSE OS, and select Use custom at the bottom of the list:
Navigate to the .img file you downloaded earlier and select it:
CHOOSE STORAGE: Select your microSD card.
If you’re familiar with Raspberry Pi Imager, you might expect the next step to consist of setting up the hostname, username, password, and Wi-Fi credentials using the Raspberry Pi Imager advanced menu. However, since we are using a custom operating system, we can’t do this setup in this way.
Select WRITE to start the process of writing the operating system to the SD card. This may take a few minutes to complete:
Now that the operating system is installed on the SD card, we’re nearly ready to proceed with our headless setup. However, before we begin, we will need to provide our Raspberry Pi with the Wi-Fi credentials to connect to our network. To do this we need to alter a small file on the SD card. In order to access the contents of your SD card after the image has been transferred to the card, you will need to remove it from the computer, and then re-insert it. Next, navigate to the boot drive to see its contents. Find the file named “wpa_supplicant.conf” and open it with your preferred text editor. Enter your Wi-Fi network name in the “ssid” field and the network password in “psk” within the quotes. Then save your changes to the file and safely eject the SD card.
Insert your microSD card into your Raspberry Pi and connect it to power. Your Raspberry Pi will now boot for the first time and will connect to your Wi-Fi network automatically, as we have already given it all the credentials it needs.
SSH, or Secure Shell, is a network communication protocol that enables two computers to communicate. Open a terminal session on your usual computer and run the following to access your Raspberry Pi computer via SSH:
$ ssh email@example.com
The first time you do this you will be asked to confirm the connection. Type “Yes” and press Enter to continue. Enter the default password, “raspberry”, when prompted. The response will look similar to this:
$ ssh firstname.lastname@example.org The authenticity of host 'raspberrypi.local (192.168.4.50)' can't be established. ED25519 key fingerprint is SHA256:yq+wCYsNy2hzEasOMZuREpqFYc+eZzE8x+YOngLqoMI. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.4.50' (ED25519) to the list of known hosts. pi@raspberrypi's password: Linux raspberrypi 5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021 armv7l SSH is enabled and the default password for the 'pi' user has not been changed. This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password. pi@raspberrypi:~ $
Note the warning about a security risk. Now is a good time to change your default password by typing the following:
You will be asked for the current password, and then given the opportunity to choose your own. Type it twice correctly to confirm the change.
An optional step here is to change the hostname of your Raspberry Pi. This is useful because, as it stands, your hostname is the default, “raspberrypi”. If you add other Raspberry Pi computers to your network using this same default hostname, a conflict may arise. Change the hostname to something memorable by typing the following:
$ sudo raspi-config
This will take you to the Raspberry Pi Software Configuration Tool:
Select 1 System Options and then S4 Hostname:
This will take you to a screen detailing what characters and conditions are allowed when assigning a new hostname. Replace the existing name “raspberrypi” with one of your choice. For this tutorial, we chose “Pi24”:
Click OK and confirm the reboot for the change to take effect. When your Raspberry Pi has had time to reboot, SSH back into it, this time using your new hostname:
$ ssh pi@Pi24.local
It’s best practice to run an update task for a fresh installation of an operating system, and it’s something that you should do regularly. You want to ensure the device is running with the very latest versions of all programs and security. Run the following two commands, typing “
y” and hitting Enter when prompted to continue:
$ sudo apt update $ sudo apt full-upgrade
Reboot your device to allow any changes to take effect:
$ sudo reboot
The first step is to create an account with Flightradar24 using your email address and a password of your choice:
If you haven’t already done so, you should connect your USB ADS-B receiver dongle to a USB port on your Raspberry Pi, while the device is powered off. The antenna should also be connected by plugging it into the side of the dongle. You will feel a slight reassuring click when you attach it correctly:
Power up your Raspberry Pi once more. Now you are logged in to Flightradar24 and your Raspberry Pi is powered on with the USB ADS-B receiver attached, it’s time to carry out the final steps in setting up your new aircraft tracking station. SSH back into your Raspberry Pi and run the following command:
$ sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
After a brief period of setup, a welcome screen and some instructions will appear, followed by the first in a series of configuration steps:
Welcome to the FR24 Decoder/Feeder sign up wizard! Before you continue please make sure that: 1 - Your ADS-B receiver is connected to this computer or is accessible over network 2 - You know your antenna's latitude/longitude up to 4 decimal points and the altitude in feet 3 - You have a working email address that will be used to contact you 4 - fr24feed service is stopped. If not, please run: sudo systemctl stop fr24feed To terminate - press Ctrl+C at any point Step 1.1 - Enter your email address (email@example.com)
As you can see, in order to continue we need three pieces of information that will uniquely specify the location of our equipment: we need coordinates of latitude and longitude, as well as altitude above sea level in feet. Fortunately there are a number of websites that can provide us with this information.
You can obtain your lat and long coordinates from LatLong.net, either by searching for a place name or by navigating your way around the interactive map. Note down your coordinates to four decimal places (for example, 52.2048, 0.1304 is close enough to get you to a cracking pub in Cambridge; you don’t need the extra decimal places that the website provides unless you need help to navigate between the bar and the snug, in which case it’s probably time to ask your friends to take you home):
You can obtain your altitude from whataltitude.com. If you’re using this site for the first time, you might be prompted to enable location services for your browser to access your geographical position:
Note down your altitude in feet and return to your SSH connection to continue the setup process, completing Step 1.1 by entering the email address that you used to register your Flightradar24 account.
Step 1.2 - If you used to feed FR24 with ADS-B data before, enter your sharing key. If you don't remember your sharing key, you can find it in your account on the website under "My data sharing". https://www.flightradar24.com/account/data-sharing Otherwise leave this field empty and continue. $:
We can leave Step 1.2 blank, as we have not used the service before, and move on.
Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)$:
MLAT, or multilateration, refers to the process of determining an aircraft’s position and heading by analysing the time difference between the arrival of radio signals from the aircraft. Since ADS-B transponders are not fitted on all aircraft, particularly older planes, Flightradar24 is able to calculate aircraft positions using data from three or more other community receivers. For this tutorial we will participate, so we will answer yes to proceed.
Step 3.A - Enter antenna's latitude (DD.DDDD) $:52.XXXX Step 3.B - Enter antenna's longitude (DDD.DDDD) $:0.XXXX Step 3.C - Enter antenna's altitude above the sea level (in feet) $:39 Using latitude: 52.XXXX, longitude: 0.XXXX, altitude: 39ft above sea level Validating email/location information...OK The closest airport found is ICAO:EGSC IATA:CBG near Cambridge. Latitude: 52.205002 Longitude: 0.175000 Country: United Kingdom Flightradar24 may, if needed, use your email address to contact you regarding your data feed. Would you like to continue using these settings? Enter your choice (yes/no)$:yes
After entering the location details you noted earlier, you will be presented with the details of the nearest airport to you, followed by a final request to confirm your settings (we’ve redacted our coordinates in the example above, but of course you will enter your latitude and longitude to four decimal places). Enter yes to continue.
Step 4.1 - Receiver selection (in order to run MLAT please use DVB-T stick with dump1090 utility bundled with fr24feed): 1 - DVBT Stick (USB) ----------------------------------------------------- 2 - SBS1/SBS1er (USB/Network) 3 - SBS3 (USB/Network) 4 - ModeS Beast (USB/Network) 5 - AVR Compatible (DVBT over network, etc) 6 - microADSB (USB/Network) Enter your receiver type (1-7)$
Next, you need to confirm what type of receiver hardware you are using. In this tutorial we need to select 1 – DVBT Stick (USB).
Enter your receiver type (1-7)$:1 Checking for dump1090...FOUND Step 4.3 - Enter your additional dump1090 arguments or leave empty $: Step 5.1 - Would you like to enable RAW data feed on port 30002 (yes/no)$:no Step 5.2 - Would you like to enable Basestation data feed on port 30003 (yes/no)$:no Step 6 - Please select desired logfile mode: 0 - Disabled 1 - 48 hour, 24h rotation 2 - 72 hour, 24h rotation Select logfile mode (0-2)$:0
The remaining setup steps relate to more advanced functionality, so we’ll skip over them in order to get up and running with a basic setup. In Step 4.3, you can provide additional
dump1090 arguments describing how the data received by your device is processed. This should be left empty. For Steps 5.1 and 5.2, which relate to exporting data from the device to another device or program, we will answer no. Finally, Step 6 allows the creation of log files, which we will disable by entering 0.
Submitting form data...OK Congratulations! You are now registered and ready to share ADS-B data with Flightradar24. + Your sharing key (00013e5bf0d25b8d) has been configured and emailed to you for backup purposes. + Your radar id is T-EGTC8, please include it in all email communication with us. + Please make sure to start sharing data within one month from now as otherwise your ID/KEY will be deleted. Thank you for supporting Flightradar24! We hope that you will enjoy our Premium services that will be available to you when you become an active feeder. To start sending data now please execute: sudo systemctl start fr24feed Saving settings to /etc/fr24feed.ini...OK Installation and configuration completed!
That’s the setup complete! Be sure to make a note of your sharing key and radar id, although this information will automatically be sent to your email address for reference. If you decide to come back and explore some of the features more deeply, then you can always re-run the setup script and change your settings. But before you do so, make sure to stop the service, as instructed at the beginning of the FR24 Decoder/Feeder signup wizard.
Some of the magic of this project is now happening behind the scenes: your receiver is now active and sending data along with thousands of others. For now, just make sure your antenna is near a window with a view of the sky. We’ll touch on antenna placement a little later in this tutorial.
The Flightradar24 operating system image for Raspberry Pi has a very convenient built-in web server; that is to say, it will host a small web page on your local network for you to see all the information your flight tracker is collecting. To access it, open a web browser on your usual computer and type the following into the address bar, replacing pi24 with the hostname you chose earlier:
Press Enter and you will be presented with a live view of the data being collected. Explore the page by clicking on individual aircraft for more information about each one:
So, that’s what your device is currently doing. Now let’s dive into the community to which we’ve begun contributing by visiting the flightradar.com home page, making sure you are still logged into your account. This will now show you information from all of the receivers and different data streams in your area:
There’s a lot to take in here, so we are going to simplify things and display only the aircraft that your device is currently picking up. To do this, click on the Filters icon (circled above) at the bottom of your screen. This will bring up a window with the option to ADD FILTER. Use the slide bar to scroll down and select Radar:
Type in the radar id of your receiver — the one you made a note of earlier — into the box beneath the filter type:
Finally, click on the blue New filter button. The page should show a lot fewer aircraft, but these aircraft will be the ones being tracked by your receiver:
Now’s the time to explore. Try clicking on individual aircraft to be amazed at how much information there is, including origin and destination details, type of aircraft, route taken, altitude, and much more. If it’s that time of year, keep an eye out for a certain bearded and red suit-wearing fella with his reindeer; he’ll be up there somewhere.
This tutorial explores the basics of setting up a Raspberry Pi aircraft tracker, and the next obvious step is to think about antenna placement for better reception. Try placing your antenna outside, or in an elevated position, to see how many more aircraft you can pick up. Building on this project might take you on a journey to more complex systems with better antennas, or perhaps a solar-powered receiving station. The sky’s the limit! Unless of course the sky isn’t your thing and you’re more interested in the sea, in which case you might want to look into receivers for Automatic Identification System (AIS) transponders capable of listening to position, identification, and other information about ocean-going vessels.