Tutorial 6 — Airplane Tracker with AI and ADS-B on Jetson

Point your camera at the sky and watch the Jetson automatically spot, track, and photograph every aircraft that passes overhead — then cross-reference a $20 ADS-B dongle to identify the flight number, airline, and destination.

What you will learn

  • How to detect aircraft in sky images using a custom YOLOv8 model
  • How to auto-track a moving object with the camera mount
  • How ADS-B signals work and how to receive them with dump1090
  • How to match a visual detection to a flight number from ADS-B
  • How to save annotated aircraft photos with metadata

Step 1 — Start the ADS-B receiver

# Start dump1090 — reads ADS-B signals from USB dongle
cd ~/tutorials/06-airplane-tracker
./start_adsb.sh   # launches dump1090 in background on port 30003

Step 2 — Run the airplane tracker

python3 airplane_tracker.py --source 0 --show --save-photos

The AI watches the sky. When it detects an aircraft shape, it locks on, takes the sharpest photo, and overlays the flight number from ADS-B data.

Step 3 — Read ADS-B data in Python

import socket, json

def get_nearby_flights():
    """Read flight data from dump1090 local server"""
    with socket.socket() as s:
        s.connect(('localhost', 30003))
        data = s.recv(4096).decode()
    flights = []
    for line in data.strip().split('
'):
        parts = line.split(',')
        if len(parts) > 10 and parts[4]:   # has callsign
            flights.append({
                'callsign': parts[4].strip(),
                'altitude': parts[11],
                'speed':    parts[12],
                'lat':      parts[14],
                'lon':      parts[15]
            })
    return flights

Step 4 — Detect aircraft in the sky

def is_aircraft(frame, prev_frame):
    diff = cv2.absdiff(frame, prev_frame)
    grey = cv2.cvtColor(diff, cv2.COLOR_BGR2GRAY)
    _, thresh = cv2.threshold(grey, 25, 255, cv2.THRESH_BINARY)
    contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    for c in contours:
        if cv2.contourArea(c) > 150:
            x,y,w,h = cv2.boundingRect(c)
            if 1.5 < w/h < 6:   # wider than tall = aircraft shape
                return True, (x,y,w,h)
    return False, None

Next: Tutorial 7 — Automated Moon & Sky Imaging | Back to Jetson Kit

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
0

Subtotal