Turn your Raspberry Pi into an aircraft tracker
Ever wondered what’s flying overhead? Here’s how to turn the tiny Raspberry Pi into a fully fledged sky-scanner
The Raspberry Pi is compact, cheap, and silent – which makes it ideal for the sort of always-on background jobs that wouldn’t usually justify the space or electricity consumed by a full-sized computer. Popular roles range from Wi-Fi hotspot to home surveillance centre, but a possibility you may not have considered is using the Pi to track nearby aircraft.
That might sound like a job that requires expensive specialist hardware, but it can be achieved using an inexpensive USB TV receiver, and the software is free. That means the entire package will set you back around £30, including a Pi Zero W. If you already have a Raspberry Pi knocking about, most models will be powerful enough to receive and analyse transmissions.
Choosing your Pi
If you don’t have a Raspberry Pi, we recommend you opt for a Raspberry Pi 3 Model B or later. You may not need to invest in a power supply: the most recent Raspberry Pi 4 uses a USB-C connector, while older models use a micro-USB connection, so either way there’s a good chance you have a suitable power supply already. Check your specs, though: it’s recommended that you use at least a 2A supply or your Pi might slow down or even switch off under load.
The cheapest and most lightweight option is the Pi Zero. You’ll want to go for the £9.30 W model with built-in wireless networking, rather than the barebones £4.80 Zero. You could optionally splash out on the £12.90 WH model, which also includes the standard Raspberry Pi 40-pin expansion block. However, we won’t be using those connections for this project, and you can add the pins to a standard W at a later date: they’re easily sourced from third-party suppliers, and Pimoroni has an excellent no-solder option that just requires a few light taps from a hammer (we can vouch for this as we’ve done it ourselves).
If you go for the Zero W or WH, you’ll also need a USB adapter cable as the digital TV receiver we’ll be using has a full-size USB plug, while the Zero’s svelte proportions only allow space for a micro-USB socket.
8 Raspberry Pi projects to try in 2023 How to turn the Raspberry Pi Zero W into a coat bot A complete guide to Raspberry Pi OS
Whichever Pi you settle on, you will also need a microSD card to store the operating system. If you have an old card knocking around, this is a good excuse to donate the aged card to your Pi and buy a larger, faster one for your phone or camera.
The receiver
Most commercial and private aircraft continuously transmit their identity and position in the form of a standardised data stream called an automatic dependent surveillance–broadcast (ADS-B). This is primarily intended to be picked up by other nearby planes, ground stations and air traffic control towers – but it’s unencrypted and uses a standard frequency of 1,090MHz, so with the right equipment you can easily listen in yourself. And as luck would have it, that equipment is simple and inexpensive, as the transmissions can be picked up by a standard DVB-T receiver, which is more commonly used for tuning into free-to-air digital TV and radio.
Get the ITPro. daily newsletter
Receive our latest news, industry updates, featured resources and more. Sign up today to receive our FREE report on AI cyber crime & security - newly updated for 2024.
It’s possible to buy FlightAware-branded ADS-B receivers that have been designed specifically for aircraft tracking, but there’s no need: we’ve had great success with a regular DVB-T adapter. Needless to say, you can’t pick up transmissions from thousands of miles away, but the range is better than you might imagine: from our test location, roughly equidistant between Stansted and Southend Airports, we’re able to track all aircraft operating out of those two sites, as well as those coming into Gatwick and Heathrow. On good days, we can even spot planes crossing above Lincolnshire, around 100 miles to the north.
Setup is about as simple as plugging your DVB-T adapter into a USB socket, but there’s one trick to be aware of: although the telescopic antenna extends to around 35cm, it’s recommended to not pull it out all the way. As Pimoroni explains, “the antenna works best when its length is a multiple of a quarter of the ADS-B transmission wavelength, which is 69mm”. We’ve found that we get good results with the antenna extended to 14cm, 21cm or 28cm; experiment yourself, and use a ruler when setting it up.
Installing FlightAware
There are two apps for the Pi for flight tracking: FlightAware and Flightradar24. You can run them both together, but we’re going to start by installing FlightAware, as it’s easy to set up and includes a preconfigured ADS-B service that can then also be used by Flightradar24.
When we say that FlightAware is easy to set up, that may be an understatement: it comes in the form of a customised version of the Raspberry Pi OS called PiAware, so it’s up and running as soon as you boot up the computer. Like the standard Raspbian installation, it’s distributed as an image, which you can download on a PC and write to your microSD card. You’ll find the software at flightaware.com/adsb/piaware/build, and FlightAware recommends using balenaEtcher to write the image to your card. Note that any data that’s currently on the card will be wiped, so make sure you’ve backed up any contents you need to keep.
Once you’ve created your card, there are just a few configuration tasks to do on your PC before using it to boot the Pi. First, locate a file on the card called piaware-config.txt and open it in Notepad (or your preferred plain text editor). Search this file for the term “wireless-ssid” and replace “MyWifiNetwork” with the name of your Wi-Fi network. On the line below, you’ll see a dummy wireless password (“s3cr3t99”); replace this with your real password, then save and close the file.
Next, we need to create an empty file on the card called “ssh”; this acts as a marker to tell the Pi to enable the ssh service so you can log in remotely. This could wait until you’re using the Pi itself, but doing it now saves you a job later on. To create the file, simply open a command prompt and enter “copy nul d:\ssh” – changing the drive letter as needed to refer to your microSD card.
You can now eject the card and put it in your Pi. Check that your DVB-T receiver is plugged in, then connect the power.
Set up your FlightAware account
Once the Pi has finished booting, the FlightAware web portal should be ready and waiting for you to connect from your PC. To do this, you’ll need to know your Pi’s IP address. You can find it by typing “hostname -i” into a terminal window, or by opening your router’s configuration page and looking for a device called “piaware” in the list of attached clients. Once you’ve found the address, open a web browser on your PC and type it in.
You should see the FlightAware welcome page. If all you want to do is view nearby planes on your own network, click “Go to 1090 SkyAware Map” to see a map of detected aircraft. The positions update in real-time, and clicking the aircraft call signs in the table to the right opens up more information about each one.
The data you can pick up is fascinating, and it’s up to you what you do with it. But, as the information is public, and there’s nothing to identify you in the stream beyond your location, there’s little reason to keep it to yourself. Uploading it to FlightAware contributes to global understanding of flight patterns, and also entitles you to a complimentary Enterprise subscription, which usually costs $90 a month. This gives you unlimited flight alerts and aircraft tracking, plus premium map layers, fleet tracking, an ad-free environment and more. To sign up, just click “Claim this feeder to associate it with your FlightAware account” and complete the application process.
Add Flightradar24
Once FlightAware is receiving and processing ADS-B data, the same data feed can also be used by the more advanced Flightradar24 app. You can install Flightradar24 on the Pi itself, if it’s connected to a keyboard and monitor: to get started, press Alt+F2, and log in with the username “pi” and the password “flightaware”.
Alternatively, you can log in over SSH from a Windows machine. To do this, open a command prompt and enter “ssh pi@piaware.local”. If this doesn’t work, replace “piaware.local” with the IP address you discovered earlier. If you’ve not connected remotely before, you’ll be asked to authorise the action by typing “yes”. Enter “flightaware” as the password.
When you arrive at the Raspbian command prompt, type the following command as a single line and press Return (the -O is a hyphen followed by the letter O, not a zero):
sudo bash -c “$(wget -O - https://repo-feed.Flightradar24.com/install_fr24_rpi.sh)”
This will download and install Flightradar24. When the process completes, the software will run and ask you for your email address and sharing key (you can leave this part blank if this is the first time you’ve set up a receiver). It will also ask whether you would like to participate in MLAT calculations, which can provide additional data for planes that don’t have ADS-B transponders.
Fine-tune Flightradar24
The next step is to tell Flightradar24 where your antenna is located. Although the app asks you for the code of your nearest airport, you’ll get the best accuracy if you use precise geographical coordinates, so we suggest you leave the airport code field empty (press Return to skip it) and instead provide the latitude and longitude of your home. If you don’t know this information, you can find it by opening Google Maps on your smartphone and holding down on the blue spot marking your location: your coordinates will appear in a panel at the bottom of the screen (you may need to scroll up to reveal them).
Finally, the app needs to know your altitude, so it can accurately triangulate aircraft. If you don’t know it, enter your coordinates at whatismyelevation.com, then add on an estimate of however many feet off the ground your antenna is. Once you’ve provided these details, enter “yes” to confirm.
At this point, Flightradar24 will detect that you’re already running the 1,090MHz receiver software that comes with FlightAware, and will ask if you’d like to use the same data with Flightradar24. When asked if you’d like to use autoconfig, type “yes”.
The last question is what kind of log files you want to keep. Press 2 for a 72-hour log with 24-hour rotation. After this step, the software saves all of your settings and completes its installation, and all that’s left to do is set the process to run in the background. To do this, enter:
sudo systemctl start fr24feed
To check that Flightradar24 is now running, open a browser on your Pi and point it at localhost:8754 – or use the browser on your PC to visit the same address as before, but tack on “:8754” at the end. You should see the Flightradar24 logo and, below it, details of the number of aircraft spotted. Click “Show tracked aircraft list” to see which planes are within range of your receiver.
As with FlightAware, there’s a fascinating range of data, and you don’t have to keep it to yourself. Anyone who contributes ADS-B data to Flightradar24 is rewarded with a Business Plan subscription, which otherwise costs $500 per year. You can do this at the same time as sharing data with FlightAware. As well as removing ads from the site and associated apps, the upgraded account lets you track back through 365 days of past flights, enjoy enhanced 3D views, overlay the map with weather and aeronautical charts and more. To check what kind of data you’re uploading to Flightradar24, point your browser at flightradar24.com/account/data-sharing.
Nik Rawlinson is a journalist with over 20 years of experience writing for and editing some of the UK’s biggest technology magazines. He spent seven years as editor of MacUser magazine and has written for titles as diverse as Good Housekeeping, Men's Fitness, and PC Pro.
Over the years Nik has written numerous reviews and guides for ITPro, particularly on Linux distros, Windows, and other operating systems. His expertise also includes best practices for cloud apps, communications systems, and migrating between software and services.