I have a constant reminder of how I got here. In late May 2012, I flew to LaGuardia Airport to start my career in New York City. Every day, especially when it’s cloudy, airplanes descending into LaGuardia fly directly over my apartment. Sometimes I wonder who’s moving to New York, hoping to make it beneath the lights of Broadway, but I know most folks are just coming for a meeting.
So instead, I just wonder where they’re coming from.
I built a little display in my living room to tell me.
This contraption uses a Raspberry Pi and a Software-Defined Radio antenna, along with some neat software and databases, to display on a 16×8 LED display the departure airport of the airplane that’s flying overhead. The software that runs it, which I’ve dubbed Flyover, is open-source.
So how does this work? Let’s start from the beginning.
Passenger jets reportedly collect one terabyte of data about themselves per flight. Of that terabyte, most airliners broadcast a tiny portion, unecrypted, over the air, via radio systems called ADS-B and Mode S. Every few seconds, they announce their location, altitude, registration number and – usually – the flight number.
Dump1090 is a program that listens to those broadcasts. Its web interface shows each plane’s precise location and path. I can pick up just about any plane within line of sight of my north-facing window in Prospect Heights. I can “see” planes well into Connecticut or Rockland County, but if the plane shows up even over Prospect Park, I often can’t detect it.
But I don’t want a map on the web. I want a display on my windowsill.
We extract the data on each plane from Dump1090’s JSON feeds, the ones that feed that map. So, we have an always-up-to-date JSON feed of airplanes by their flight number.
But which one to display? New York’s airspace is crowded. Cops, rich dudes and sightseers fly around in their helicopters; we have three major airports nearby. The nearest airplane to my apartment is usually the LaGuardia-bound one, but sometimes a transatlantic flight, or maybe one headed north to Boston, flies over, at a much higher altitude. We have to exclude those. I’ve eyeballed the rough corridor that flights to LaGuardia arrive in and exclude anything outside of there; I also exclude anything higher than 10,000 feet. If it matches those heuristics, the plane is the one I’m curious about.
With that plane’s flight number, we can figure out what route it flies. Virtual Radar Server compiles – and offers, free – a database of routes. It’s not always right, but it’s pretty close, and frequently updated. Suppose the flight number is DAL935 (that is, Delta Air Lines flight 935). We get the route, in the format of “KMCO-KLGA”, since it’s a flight from Orlando, but have to figure out which airport to display.
Sometimes a flight number is only used for, for instance, a once-daily flight from Orlando to LaGuardia. That’s easy – display Orlando’s airport code, MCO (lopping off the K from KMCO; the K just means it’s an airport in the United States). Sometimes, it’s a little harder, because some airlines designate several segments with the same flight number: maybe a flight from Orlando, to LaGuardia, then to Chicago. In that case, if the plane is descending, display Orlando; if it’s ascending, then Chicago.
For More Details: Raspberry Pi Clever airplane tracker