so many machines

Mapping Nearby Aircraft Using AWS and a Raspberry Pi

Planes in much of the airspace over the US are now broadcasting vital information over radio in plain text. Using some JavaScript glue code and EC2, let's use that data to visualize nearby aircraft.

Rare Historical Photos

Around the turn of the century, increased air travel had started to strain the air traffic control system causing frequent travel delays and threatening adverse safety impact. In the United States, the FAA initiatied a program called NextGen to modernize the entire air traffic control system for increased safety, predictability, and efficiency.

A core component of the program is the creation of an ad-hoc radio network of planes and ground stations called Automatic Dependent Surveillance - Broadcast (ADS-B). ADS-B periodically broadcasts details acquired from an aircraft’s systems about its position, heading, altitude, speed, and identity over radio. This allows other aircraft to monitor this data so pilots can visualize nearby aircraft for self-separation, and allows more data to be fed to air traffic controllers since ground stations are easier and cheaper to build than radar.

How cheap? Well, anyone can build an ADS-B ground station and receive these broadcasts from nearby aircraft. FlightAware offers instructions and a software defined radio that can be used with a Mode-S decoder such as dump1090. You can get up and running for around $20. A couple of months ago I hacked together a quick map of traffic near my home:

Using a Raspberry Pi with a FlightAware Pro Stick, I’m repeating any ADS-B broadcast I receive to a WebSockets server I have running on an EC2 Spot instance1. With a small amount of JavaScript hosted on Amazon S3 and the help of Leaflet, and Mapbox, I’m able to plot where aicraft are in real-time:

You can find the little bits of glue code powering it in my aircraft_map repo.

  1. EC2 Spot instances are a mechanism to acquire spare EC2 capacity for a significantly discounted rate with the trade-off that the capacity could be reclaimed if demand characteristics change. For anything stateless or low priority, you should prefer Spot over on-demand instances. For around $1 a month, Spot gives me an instance where I can run random processes like this one. The box running this web service has been up in us-east-2 for over three months without interruption. [return]