Health·Raspberry Pi·Uncategorized

Tracking planes using a Raspberry Pi

3 minutes to read this insight

Before attending the Air hack at ODI Leeds we thought about the different elements that could affect respiratory conditions, having investigated it before. In the past we’ve looked at different car emissions, and used air quality sensors dotted around Leeds. However, this time we wanted create our own data so we could create a new data visualisation.

PlanePiStep forward a Raspberry Pi, an RTL-SDR & ADS-B USB Receiver, some Open Source code, and within an hour we have a Plane Tracker! We’ve given the Pi a permanent home at Sherburn Aero Club so they can see what’s passing over them, whilst providing us with the data at the same time.

The plane tracker provides us with data about planes that operate a Mode S transponder. We set the Pi to record data every 20 seconds; it collects hex_ident, altitude, latitude, longitude, date, time, angle, distance, squawk, ground_speed, track, and callsign.

For example:
4065A8, 12100,53.37484, -1.67388, 2017/02/11, 00:00:00.287, 170.63, 25.32, 5466,288, 179, EXS014W

This translates to:
There is a plane with transponder id 4065A8, at an altitude of 12,100 feet, overhead the A57 (snake road) on 11th Feb 2017 at 11am, flying at an angle of 170 degrees, we’ve been tracking for 25 nautical miles, currently squarking 5466 on the transponder (air traffic controller use this ID to monitor the planes current details – note this may change as the plane travels over different locations eg Humberside, Leeds Bradford, Manchester Radar), travelling with a ground speed of 288 knots per hour, on a track of 179, with a call sign EXS014W (a Jet2 Boeing 737-3Q8QC which is 29 years old).


Every day we produce around 160,000 rows of plane tracking data. So, what can we do with the data…

Firstly, we can provide our daily data as Open Data to Data Mill North: so that other people can make different things with the data too.

Secondly, we need use the data to make an initial visualisation.  We wanted to visualise the route that each plane takes so we could see patterns in the sky. That meant that we had to group the GPS data by plane, ordered by time, and added to a map so we can see where it has travelled.

Initially the GPS tracks just form a big blob of colour. However, by tweaking the settings we can reduce the opacity of the tracks to 50%, and change the lines from 1px wide to 0.1px wide. This technique provides us with a clearer picture of where planes fly most frequently.

plane_detailsLooking at the map, we can see two distinct lines tracking to and from Ireland. We can pull their information out of the data to find that the flights are indeed travelling to Ireland, and are operated by Ryan Air.

One of the more interesting things that we noticed in the data was a squark of 7700 which is used to indicate there is an emergency on the plane. This was triggered at 4am on 15th February over Manchester on an Air Canada flight to Heathrow. The questions is – have we now turned into plane spotters?

Next steps:
Rather than using just a weeks worth of data, over time we’ll be able to make richer visualisations, and updates to this page…

We also hope other people will pick up the data on Data Mill North and use it for other interesting things too – let us know if you do!

read more: