How I track airplanes using a RaspberryPi and a DVB-T stick via #PiAware

Back in the early 1990s, picking someone up from Nairobi JKIAirport sometimes also included tuning into 119.700 MHz on the beloved Standard C168. A VHF radio, tuned to the frequency of Nairobi approach that tells you whether the expected plane would be landing soon. Unable to understand any aircraft radio communication back in the days, I never really had a benefit from this service, even though it was still cool.

Flightradar24-AugRealThe view from my balcony via Flightradar24 (pro) on my iPhone 4S.

Fast forward now in 2014, websites like flightradar24.com or flightaware.com provide anyone with a quick update on the position of almost any commercial airplane. Apps like flightradar24 even provide an augmented reality view, which is very sweet and also practical, as you won’t have to decode any cryptic audible communication and just identify your target aircraft on a map and can track it up to the airport. They do this via the ADS-B signal (Automatic dependent surveillance-broadcast) that anyone with the right equipment can easily pick up. Companies like FlightAware get their data from “different government air traffic control and private datalink sources” and also “operate a worldwide network of ADS-B receivers that track ADS-B-equipped aircraft flying around the globe”. Obviously, there’s a demand for this data.

Tracking hardware has been available for some time now and often only made sense for enthusiasts or real professionals who knew what they were doing and who also had a need for that data, as parts were still somewhat expensive. The Mode-S Beast is one such example where a German radio ham had created an FPGA based decoder some years ago (the FPGA component alone is just damn cool).

My setup
With the availability of cheap DVB-T sticks that can be turned into broadband radio scanners (I also presented this method during BarCamp RheinMain in 2013), private individuals can now also receive and decode ADS-B signals and feed them into a worldwide network.
You probably won’t run your desktop or laptop computer 24h/7d, but credit-card sized computers like the Raspberry Pi do provide just enough computing power to do the job. All you’ll need is a stable internet connection and a power supply that delivers 5V for the RaspberryPi. I do have the hardware, I have broadband internet connectivity, electricity and haven’t really made use of my RaspberryPi lately (only used it as a TOR server for guest wifi access), so when FlightAware announced this PiAware project that allows you to turn any RaspberryPi with such a DVB-T stick into an ADS-B receiver, I quickly agreed to install it on mine.

jke-piaware
Everything in a box: RaspberryPi (with a cooling kit in a neat VESA box), passive USB extension (saves space and has two more ports for e.g. a keyboard), RTL2832U / R820T DVB-T stick, Edimax EW-7811Un 150 Mbit/s Wireless IEEE802.11b/g/n nano USB Adapter, 8GB SD card, microUSB power supply.

The good part is that you don’t have to do any crazy geek shit, so it is very much idiot-proof for people like me. Just install the PiAware image on an SD-card, plug in all hardware components and start the RaspPi. Then visit their website and claim your ID. It’s really just as simple as that.

jke-flightaware-map

Once the system is up and running, you can quickly view live data by opening the local IP address in your browser which then loads a map and all available data. It’s 5:25am on this screenshot, and you can already see incoming cargo planes that want to land on Frankfurt airport. These are all signals that have been broadcasted from these planes and were then picked up by a small device on my balcony. And all of this just because some smart people had created a piece of software that reads data from a 10€ cheapo DVB-T stick and then forwards it to another server around the globe. It still amazes me and I love it.

Since I do live on the top floor of a four-storey building, in the vicinity of EDDF (Frankfurt Airport) and have a nice view from the balcony, I quickly figured that I should move my little project outside and place the magnetic foot of the antenna on the metal gate of the balcony, while all components are hidded in a plastic box. Something that also reminded me of my WiFi mod for the Water Resources Management Office in Embu in 2006: put everything in a plastic box and install it as high as possible.

Antenna
Antennae or antennas. I love them. I guess the thing that attracts me the most in radio technology are antennas. My geek level on this topic is that whenever I climb a mountain or visit a tall building, the first thing I think of is the Rx/Tx-ratio and how the spot would qualify for an outdoor antenna. While others enjoy the view, I just wonder about field strength. So when the need arose to replace the stock antenna that comes with most DVB-T dongles with something better, I realized that they aren’t that bad and that I would just need to install a new antenna stick (because, also, I didn’t want to mess with the tiny MCX-connector on the cable).

DVB-T antenna fix

The distance screw is from an old mainboard on a desktop computer and I just soldered a piece of wire onto this screw, then later on covered the brass with heat shrink tubes to waterproof it a bit. It’s a collinear antenna according to this manual and with a wavelength of about 1090 MHz or 275mm (= 300000 m/s / 1090000 1/s), the first part is 1/2 Λ the second 3/4 Λ long and the third one is supposed to be a little less than 3/4 Λ, but my piece of wire wasn’t long enough, so let’s just test it this way. The beauty about this setup is that I can easily upgrade it by just soldering more wire on a cheap, old screw.

My ADS-B antenna on the balconyThe finished antenna on the balcony.

Results
my PiAware feed statsGoing by this chart (generated via the PiAware backend), moving the antenna outdoor probably wasn’t such a bad idea. :-)

Africa?
FlightAware’s coverage map displays the typical gap, or lack of data from the African continent…

ADS B Coverage Map FlightAware

…and Flightradar24 isn’t that much better:

ADS B Coverage Map Flightradar24

Let’s hope that someone will be able to close this huge gap in future, even though it may require some investments into hardware and connectivity (internet & electricity). I’d love to see someone from Nairobi setting this up in an office – maybe someone at the iHub Nairobi? I understand that it just requires little bandwidth and is small enough not to accidentally “walk away”.

Update:
What I really like about this project is that FlightAware created an approach that allows newbies like me to get this thing going within minutes. It just takes the hardware and the downloaded image, and I won’t have to configure anything unless I want to. Just connect it to your network and FlightAware will automatically attribute your PiAware setup to your user account (based on the same external IP). After all it’s just a collection of scripts that combine some smart software here and there, but this also lowers the barrier for people like me who just want to contribute data to a network that is based on crowdsourced information.

Author: jke

Hi, I am an engineer who freelances in water & sanitation-related IT projects at Saniblog.org. You'll also find me on Twitter @jke and Instagram.

14 thoughts on “How I track airplanes using a RaspberryPi and a DVB-T stick via #PiAware”

  1. RT @bankelele: @tellmemo @ClanSewe @mmnjug @Le_Butter_Fly @KenyanAviation @RwandAnFlyer @whthome More Africa #avgeek techies needed https:/…

Comments are closed.