Tracking airplanes in real time with ADS-B

Tracking Flights

Airplanes continuously broadcast signals that identify the aircraft and its current flight path. With a moderately priced receiver and a Raspberry Pi, users can receive ADS-B transponder data in real time.

During flight time, airliners continuously broadcast signals to identify themselves and their flight route. Countless websites utilize this data to track jets online and display their location on a map [1]. Similar programs run on mobile phones [2]. Given that a smart phone understands information about location and direction, you can use the device to create a virtual experience of receiving flight data in real time. However, these data are actually drawn from a database which the mobile phone queries via the Internet. The Raspberry Pi lets you create a low cost receiver for capturing and analyzing location data in real time, without depending on the Internet.

The receiver for this kind of set-up consists of a DVT-T stick, which is a device that was originally designed for receiving television signals via radio waves (Figure 1). The best candidate among all of the available sticks are those using the Realtek RTL2832 chip. This chip can communicate with the reception and analysis program. Well known vendors advertise suitable receivers with descriptions such as "USB DVB-T RTL-SDR Realtek RTL2832U" for a price of under 10 Euro. The antenna included with these sticks is usually sufficient for this project. If it is not, you can build a directional antenna [3] by yourself to operate at a frequency of 1090 MHz and then connect it to the stick via the MCX plug contact.

Figure 1: A simple DVB-T stick serves as the SDR receiver for the Raspberry Pi.

The receiver is based on a software defined radio or SDR The ideal SDR receiver consists of an antenna, an ADC or Analog Digital Converter to digitalize the analog voltage of the antenna, and also a computer for processing incoming data. Actual SDRs work with analog boosters and intermediate frequencies because the sensitivity of customary ADC chips is usually inadequate for direct reception.

Software

In this article we take a look at the readout of flight signals based on the Dump1090 program. In comparison to other programs like RTL 1090 or BaseStation [4] that are designed to perform a similar function, Dump1090 distinguishes itself with excellent reception capabilities. The first version of the program was written by Salvatore Sanfilippo in 2012 [5]. For the Raspberry Pi, it is a good idea to use the updated version written by Malcom Robb[6], in particular because the newer version supports OpenStreetMap. The program can be downloaded as a ZIP archive (Listing 1, first line). However, it is easier to clone it directly via Git (Listing 1, second line).

Listing 1

master.zip

$ wget https://github.com/MalcolmRobb/dump1090/archive/master.zip
$ git clone git://github.com/MalcolmRobb/dump1090.git

Next,switch to the directory using the command from the first line in Listing 2. The directory contains the downloaded files. The second line displays the first attempt at compiling the program. Most of the time, the system interrupts compilation and produces an error message that references support programs that have not been found.

Listing 2

Output of make

01 $ cd <ßßI>Dump1090-Folder<ßßI>
02 $ make # probably interrupt with error messages
03 $ sudo apt-get install libusb-1.0-0-dev
04 $ sudo apt-get install build-essential
05 $ sudo apt-get install pkg-config
06 $ sudo apt-get install rtl-sdr
07 $ sudo apt-get install librtlsdr-dev
08 $ make # in case of errors: additional libraries necessary

Typically, the user will have to follow the developer's version of Libusb. This C library manages communication with the USB port. Also, basic things like a C compiler are sometimes missing. Lines 4 and 5 install a compiler retroactively. You will need the libraries from lines 6 and 7 in order to program and analyze the SDR chip. Depending on the software you have, you may have to install additional libraries before the make call in Line 8 runs without any error messages.

After completing installation according to Listing 2, the user should check the connection to the DVB-T stick via the call rtl_test -t. Once the result looks similar to the one in Listing 3, this means that the computer has successfully recognized the RTL2832U SDR chip. If instead, you see a notification that the stick is already integrated, Linux will identify it as a DVB-TV receiver. If this occurs, you should add the file /etc/modprobe.d/blacklist.conf to the line blacklist dvb_usb_rtl28xxu. Occasionally you will need to add the remaining lines from Listing 4. This will prevent the system from loading the DVB T driver after a restart and consequently, the computer will not receive DVB-T television.

Listing 3

Output of rtl_test -t

01 $ rtl_test -t
02   Found 1 device(s):
03   0:  Generic, RTL2832U, SN: 77771111153705700
04
05   Using device 0: Generic RTL2832U
06   Found Rafael Micro R820T tuner
07   Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 ...
08   [R82XX] PLL not locked!
09   Sampling at 2048000 S/s.
10   No E4000 tuner found, aborting.

Listing 4

blacklist

blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist rtl_2830
blacklist rtl_2832
blacklist r820t

ADS-B-Reception

The process referred to as ADS-B (see info box) exists so that aircraft can continuously broadcast status information as a means of increasing flight safety. The so-called ADS-B mode extended squitter is required for all airliners found inside European air space. Small transmission pulse sequences, each 0.5 µs in length, sent out over a frequency of 1090 MHz are used to code each bit. The logical one is represented when the pulse occurs at the beginning of the reference frequency. When it occurs at the end, the logical zero results. There are short squitters lasting 64 µs which code 56 bits. Of these, 27 represent data bits. Extended squitters lasting 120 µs contain an additional 56 bits of data.

The SDR libraries assume the task of decoding the 1090 MHz signals. Listing 5 records the first tests with the program Dump1090. Once the program has been compiled without any errors, the help menu will appear via the --help switch. When you receive a response consisting of short and long hexadecimal numbers, this means that you have started to receive the first ADS-B data telegrams. All that remains to be done is the decoding work on the character chains. These consist either of 14 or 28 bytes. Note that 14 characters x 4 bits = 56 bits and that 28 characters x4 bits =112 bits.

ADS-B

The abbreviation ADS-B stands for "Automatic Dependent Surveillance --Broadcast*. ADS-B lets an aircraft independently determine its own location, for instance via GPS, and then continuously emit omnidirectional broadcasts of position and other information including flight number, type of aircraft, speed, flight altitude and direction. Typically, the broadcasts are transmitted once per second. They go out over the 1090 MHz frequency. The range for ADS-B signals is about 200 nautical miles, therefore about 370 kilometers. ADS-B is used today to increase flight safety by acting as a quasi substitute for radar, particularly in areas with poor coverage for transmission signals such as sparsely populated areas and air space located over the ocean.. Associated costs are much lower than the price of an active flight surveillance facility. ADS-B also increases flight safety in zones that are already well monitored by radar due to significantly faster update rates when compared with classic flight tracking methods.

Listing 5

Output of dump1090 --help

$ ./dump1090 --help
-----------------------------------------------------------------
|                dump1090 ModeS Receiver     Ver : 1.10.3010.14 |
-----------------------------------------------------------------
--device-index <index>   Select RTL device (default: 0)
[...]
$ ./dump1090 --raw
0: Generic, RTL2832U, SN: 77771111153705700 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60
*8d4408d758c3758d7d6b59c39614;
*5d4408d752975c;
*5d3c5eea681552;
*a000053900000000000000f1c42d;
[...]

Buy this article as PDF

Express-Checkout as PDF

Pages: 7

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Taking the Raspberry Pi over hill and dale

    The Raspberry Pi is the heart of many different projects, be they navigation devices or flight scanners. When equipped with a suitable keyboard and simple monitor, the little computer can also be put to use for tasks in the great outdoors.