Inspiration

One day on a hiking trip, the collective number of mosquito bites we ended up with was more than we could count. We never even noticed they were around until the red bumps started appearing. Every few minutes we'd stop whatever we were doing just to swat another one away.

The more we talked about it, the more we realized this wasn't just an annoyance.

Mosquitoes are the deadliest animals on Earth, responsible for transmitting diseases like malaria, dengue, Zika, and West Nile virus, resulting in hundreds of thousands of deaths every year, disproportionately affecting communities with the least access to prevention.

Unfortunately, the tools we rely on today haven't changed much in decades:

  • Chemical sprays that coat your skin
  • Electric zappers that indiscriminately kill beneficial insects like pollinators
  • Candles and coils that only work within a small radius

That sparked a simple question:

What if we could automate the swatting instead?

We wanted a system that could detect mosquitoes before you even noticed them, warn you they're nearby, and automatically deal with them—whether you're camping, hiking, sitting on your patio, or enjoying a picnic.


What it does

BuzzKill is an autonomous AI-powered mosquito detection and targeting system.

Instead of relying on chemicals or indiscriminate bug zappers, BuzzKill continuously monitors its surroundings using computer vision to identify mosquito-like movement in real time.

Once a mosquito is detected, BuzzKill:

  • Detects small, fast-moving targets
  • Tracks their trajectory
  • Predicts where they're headed
  • Aims the turret
  • Fires a foam dart before the mosquito reaches you

Our prototype demonstrates how intelligent robotics can replace broad, environmentally harmful pest-control methods with targeted, precise intervention.


How we built it

Hardware

At the heart of BuzzKill is a two-axis autonomous turret.

The system consists of:

  • Raspberry Pi 5 running QNX
  • ESP32-based turret controller
  • ESP32-CAM vision system
  • Pan and tilt servos
  • Flywheel-powered Nerf-style launcher

Unlike a traditional Nerf blaster, the launcher is mounted on a pan/tilt platform, allowing it to continuously track moving targets across the camera's field of view.

The flywheel motors and aiming servos operate independently so that spinning up the launcher never interferes with tracking performance.


Use of QNX

BuzzKill is designed as a real-time embedded perception and control system rather than a conventional computer-vision demo.

The Raspberry Pi 5 runs QNX and acts as the central brain of the system. Using OpenCV from the QNX open-source ecosystem, it processes the live camera stream locally, detects mosquito-like movement, tracks candidates across frames, predicts short-term motion, and converts the selected target into pan-and-tilt control commands.

QNX is essential because BuzzKill closes the loop between perception and physical action. A delayed detection, stale coordinate, blocked control thread, or missed safety check could cause the hardware to react incorrectly. To prevent this, the application separates its responsibilities into concurrent real-time tasks:

  • Vision task: receives and processes camera frames using OpenCV
  • Tracking task: maintains target identity and estimates its movement
  • Control task: calculates bounded pan-and-tilt corrections
  • Safety supervisor: rejects stale data, oversized targets, invalid movement, and out-of-zone detections
  • Telemetry task: reports system state without interrupting critical control

The safety supervisor has priority over movement and output control. If camera data stops arriving, communication is lost, the target leaves the calibrated region, or the emergency stop is activated, BuzzKill immediately transitions into a safe state.

All detection and decision-making run locally on the Raspberry Pi 5. The system does not depend on cloud inference or an external API, allowing it to remain responsive even without an internet connection.

BuzzKill demonstrates why real-time operating systems matter for AI-powered robotics: recognizing an object is only the beginning. The system must also respond predictably, safely, and within strict timing constraints.


Detection Pipeline

Detecting mosquitoes is surprisingly difficult.

At normal camera distances, a mosquito often occupies fewer than 10 pixels, making traditional object detectors like YOLO poorly suited for the task.

Instead, BuzzKill uses a lightweight motion-based pipeline:

  1. Background subtraction isolates moving objects.
  2. Candidate blobs are extracted.
  3. Blobs are filtered by:
    • Size
    • Aspect ratio
    • Motion characteristics
  4. Remaining candidates are classified as mosquito-like or discarded.

This allows the system to run completely on-device while maintaining real-time performance.


Target Tracking & Prediction

Each confirmed detection produces a location within the camera frame.

Using a calibrated mapping between camera coordinates and servo angles, BuzzKill converts image-space coordinates into physical pan/tilt movements.

Rather than aiming where the mosquito is, the system predicts where it will be a fraction of a second later, compensating for processing latency and servo travel time.


Real-Time Control

BuzzKill separates perception from actuation.

High-Level System

  • Vision processing
  • Motion analysis
  • Target prediction

Real-Time Controller

  • Servo positioning
  • Flywheel control
  • Firing sequence
  • Safety enforcement

This separation ensures the turret remains responsive even if vision processing momentarily slows down.


Safety

Safety was designed into the system from day one.

Before any firing command is issued, every detection must pass multiple filters that reject:

  • Human-sized objects
  • Large moving objects
  • Invalid trajectories
  • Low-confidence detections

If a target fails any safety check, the firing pipeline is immediately halted.


Challenges we ran into

Detecting Something This Small

Mosquitoes provide almost no visual texture for modern object detectors to learn from.

Instead of relying on appearance alone, we had to build a system that emphasized motion, trajectory, and temporal consistency.


Calibration

Mapping pixels to real-world servo angles sounds straightforward—but tiny calibration errors become significant near the edges of the camera's field of view.

Building a reliable multi-point calibration routine became essential for consistent aiming.


Latency

Vision, prediction, communication, and servo movement all introduce delay.

By the time the turret reaches where the mosquito was, it's already somewhere else.

To solve this, BuzzKill predicts short-term target motion before issuing movement commands.


Safety

Because BuzzKill controls a physical launcher, safety couldn't be an afterthought.

Every command passes through multiple validation layers before the launcher is ever allowed to fire.


Accomplishments that we're proud of

  • Built a complete end-to-end autonomous targeting pipeline
  • Combined computer vision, robotics, and real-time control into one integrated system
  • Achieved fully on-device detection without relying on cloud inference
  • Implemented trajectory prediction to compensate for real-world latency
  • Designed safety mechanisms directly into the core architecture rather than adding them afterward

What we learned

This project completely changed how we think about computer vision.

Most modern vision systems assume their targets occupy dozens—or even hundreds—of pixels. Mosquitoes don't.

We learned that sometimes the best solution isn't a larger neural network, but a smarter pipeline built around motion analysis, prediction, and careful system design.

We also gained a much deeper appreciation for how difficult it is to close the loop between perception and physical action in real time, where milliseconds can make the difference between a hit and a miss.


What's next for BuzzKill

  • Multi-turret coordination for full-room or outdoor coverage
  • Lightweight neural classifiers to improve detection in cluttered environments
  • Solar- and battery-powered deployments for remote outdoor use
  • Companion dashboard for detection analytics and long-term mosquito activity trends
  • Integration with public-health datasets to support mosquito population monitoring and early warning systems

Built With

Share this project:

Updates