What’s that plane I hear? Telegram1090

on

Living near a busy airport – and especially directly under one of the major flight paths – means regularly dealing with the noise of planes taking off and landing. In attempt to overcome the frustration of having calls and Netflix binges interrupted every few minutes during the nice months of the year when the windows are open, I set out to make the best of it. Inspired by a post on Hacker News earlier this year about how easy (and cheap!) it is to set up your own ADS-B monitoring station I realized I could build a program that automatically sends me information about the planes I hear flying over my home.

With the idea in mind I purchased an RTL-SDR starter kit and dug up my Raspberry Pi Zero W from the depths of my desk drawers. I was honestly amazed at how easy it was to start playing around with the SDR. Within 30 minutes of opening up the kit, I had everything I needed on my computer to listen to FM radio. A little more fiddling and research and I was listening to the airport radios, followed by eventually getting dump1090 set up on my RasPi and plotting the live data on a map. Once I had dump1090 setup and was able to access the processed ADS-B packets over my network it only took a couple weekends of spare time to put together the Node.js app that runs the Telegram notification bot. So without further ado, here’s a quick little demo:

The Hardware

Parts

The project cost totaling up to just under US$70 (excluding shipping fees and the USB power adapter).

Setup

Antenna – For this setup I have mounted the smaller dipole antenna in an airport-facing window using the suction mount from the antenna kit. I’ve adjusted the antenna so that each side is about 1/2 the wavelength of the 1090MHz signal I’m listening for – roughly 13.8cm – and aligned to form a 90° angle. Conveniently enough, this is about the same as the maximum length for this antenna. While I could probably be more scientific about tuning the length of the antenna and setting its position, the current setup works great for my relatively short-range needs, and the indoor location of the antenna is probably a bigger problem than the length and angle.

RasPi & SDR – These two parts are twist-tied to the window shutters. While originally they were resting on the window sill, I quickly found that opening the shutters would usually result in everything falling to the floor.

The Software

The Raspberry Pi has been setup with a standard headless Raspbian Stretch installation. Since the Pi is a fairly popular tool of choice for airplane tracking, everything that was needed for the SDR can be installed with prebuilt packages. For ease of setup, I chose to use the dump1090 fork maintained by FlightAware. Their package provides both a web UI for viewing the live data in human readable formats as well as the standard dump1090 network endpoints for fetching the data in SBS1 and BEAST formats.

A screenshot of the message sent by the Telegram1090 bot.
A Screenshot of the Telegram Bot’s messages

As for the bot, I used Node.js and TypeScript since I’m relatively comfortable with both. Plus there’s the added benefit that there are already libraries for handling SBS1 data, geographical calculations, and the Telegram bot APIs. The Node.js app I put together handles everything from receiving the SBS1 data from dump1090 to sending the the messages to the Telegram bot API. I’ve created a systemd service to automatically run the Node.js app when the Raspberry Pi boots up so no need to remember to restart everything manually.

Check out the Telegram bot code and setup instructions on GitHub

https://github.com/flakeparadigm/telegram1090

What’s next?

  • Visualizing or analyzing the data that’s being collected and saved. There’s something really cool about collecting this data myself that makes me really want to create a 2D heat map or a 3D flight path model. While FlightAware and Plane Finder’s tools can make live maps, there aren’t any built in tools for visualizing historical data.
  • Analysis of airplane size when determining if I should be notified. Large planes like A380s and B747s can be heard from much further away than smaller turboprops. Since some planes broadcast their size or model it might be possible to fine-tune the radius for notifications based on this information.
  • Altitude checking before sending notifications. Occasionally planes will pass over at altitudes high enough that they cannot be heard. It’s a bit pointless to receive these notifications because I’d never notice them if it weren’t for the message from the bot.
  • Telegram live location tracking. Telegram allows displaying live locations within messages, so the bot could share the actual location of planes as they fly within range of the base station.