Chances are that there are planes flying over your house right now. Using a Raspberry Pi, a device known as an ADS-B receiver, and a standard projector, we can create our very own “radar” that shows the real time location of these aircraft and, if we have a projector, we can project it on the ceiling. Otherwise, we can track it on a regular screen.
About ADS-B Technology
Lots of aircraft are outfitted with a device known as an ADS-B. Standing for “Automatic Dependant Surveillance-Broadcast”, it’s a technology that allows aircraft to transmit positional information about themselves to other aircraft, ground-based stations, and even satellite-based stations. For smaller planes where it isn’t feasible to install more complicated collision-avoidance technologies, an ADS-B transmitter and receiver can do a lot to increase flight safety.
Aircraft outfitted with ADS-B transmitters (which is becoming law in more and more countries), transmit a variety of positional data like altitude, GPS coordinates, and ground speed data. Fortunately for us, all the data is transmitted on a standard frequency and it’s unencrypted. This means with a small USB dongle and a Raspberry Pi, we can listen in to the positional information of aircraft nearby
What You’ll Need For This Project
- Raspberry Pi 4 or Raspberry Pi 3 with power adapter
- 8 GB (or larger) microSD card withRaspberry Pi OS. See our list of best microSD cards for Raspberry Pi.
- ADS-B Receiver Kit (Antenna and USB dongle) like this one.
- Monitor or Projector with HDMI and power cables. If you want to project on the ceiling, you’ll need a projector.
How to Track Local Airplanes with Raspberry Pi
Before you get started, make sure that you have your Raspberry Pi OS set up. If you haven’t done this before see our article on how to set up a Raspberry Pi for the first time or how to do a headless Raspberry Pi install (without the keyboard and screen).
1. Update Raspberry Pi OS by entering the commands below at the command prompt. This almost goes without saying, but is a good practice.
sudo apt-get update -y
sudo apt-get upgrade -y
2. Install the base components we’ll need to communicate with the ADS-B receiver and display aircraft positions using Python.
sudo apt-get install build-essential debhelper librtlsdr-dev pkg-config dh-systemd libncurses5-dev libbladerf-dev libhackrf-dev liblimesuite-dev libsdl2-ttf-2.0-0
sudo pip3 install virtualenv
3. Clone the dump1090 repository into your home directory. Dump1090 is a decoder that will let us decode ADS-B messages into readable JSON.
cd ~/
git clone https://github.com/flightaware/dump1090.git
4. Build dump1090. This may take a bit of time depending on your type of raspberry pi.
cd dump1090
make
5. Connect your ADS-B receiver to the Raspberry Pi’s USB port.
6. Run dump1090 from within its directory.
./dump1090 --interactive
You should see a table appear in your console with various rows filled with data for overhead airplanes, including their altitude and flight number.
Now that we’ve got our ADS-B decoder installed, we can download the projection code. I wrote a simple program using python and the pygame library that displays the real-time location of aircraft, as well as their flight number and altitude (all from dump1090) on your display. You’re more than welcome to modify it or build your own.
7. Clone the Raspberry Pi Flight Tracker git.
cd ~/
git clone https://github.com/rydercalmdown/raspberry_pi_flight_tracker.git
8. Set up a virtual environment with python3 for the flight tracker.
cd raspberry_pi_flight_tracker
virtualenv -p python3 env
9. Activate the virtual environment, and install python requirements.
source env/bin/activate
pip install -r src/requirements.txt
10. Rename the environment.sample.sh to environment.sh and open the new file for editing.
mv environment.sample.sh environment.sh
# edit the file with nano
nano environment.sh
11. Edit the file to set the values for your current latitude and longitude, along with maximum latitude and longitude. The maximums will determine how much of the area around your location to display. An easy way to get your latitude and longitude values is to use Google Maps. First, find your location and right click it to display a menu – click the latitude and longitude values to copy them to your clipboard.
Next, zoom out from your current location. Pick a spot north of your current location and copy the value to your clipboard. Then copy the first value (latitude) into your environment.sh file as LAT_MAX (shown below as 43.680222). Do the same with a spot south of your current location, and fill in the first value in your environment.sh file as LAT_MIN. These values represent how far tracking extends north and south of your location.
Next, pick a spot west of your current location, and copy the coordinates to the clipboard. Use the second value (viewed above as -79.49174) to fill in the LON_MAX value. Do the same with a spot east of your location, and LON_MIN. These values represent how far tracking extends east-west from your current location.
When completed, your environment.sh file should look something like this (with your coordinates).
export LAT_MAX=43.680222
export LAT_MIN=43.63501
export LON_MAX=-79.49174
export LON_MIN=-79.37080
export CURRENT_LAT=43.64611
export CURRENT_LON=-79.37929
12. Start the dump1090 server and the projection code using the same command:
bash entrypoint.sh
If all goes well, after a moment you’ll be greeted with a blank screen with a dot in the center indicating your current position, and aircraft around you will show up as moving dots across the screen as their signal appears.
If you’re having trouble getting a signal, try moving your antenna to where it has a clear view of the sky, like an upstairs window.
13. If you’re using a projector, point it at the ceiling and line up the top of the screen with your magnetic north.
And there you have it. Your own personal aircraft “radar” system.