This is a submission for the MLH x DEV Writing Challenge
What I Built
Sometime after midnight at HackUMass, I held a phone up to a Raspberry Pi camera. The phone showed a picture of a red balloon. On the table, a 3D-printed flying wing twitched its elevons. When I moved the phone left, the wing banked left. When I moved it up, the nose pitched up. The plane couldn't see me or the phone, only the balloon, and it was trying to fly at it.
That was UAV Balloon Popper, a small autonomous plane that hunts down stray balloons.
Why balloons?
The idea started with drones. Watching the war in Ukraine, I kept seeing the same problem: cheap drones are cheap to build and expensive to stop. Interceptor missiles can cost far more than the drones they shoot down. Police in the Netherlands once trained eagles to snatch drones out of the air, and I loved that idea of a hunter that doesn't need a missile. My teammate Mohamed and I wanted to build our own eagle: a cheap plane with a camera and a computer that could find a target and chase it down by itself.
There was one problem. We didn't have any drones to hunt.
We did have balloons, and we grew up playing Bloons Tower Defense 6, a game that is entirely about popping balloons. So balloons became the target. The detector still recognizes drones, so the same pipeline works on both.
How it works
The plane is a flying wing with an INAV flight controller, a Raspberry Pi 5 and a Camera Module 3. The pilot flies it normally with a RadioMaster Zorro radio. When the pilot flips a switch, the Pi takes over:
- See. A YOLO11n model on the Pi looks for balloons and drones in every frame.
- Aim. The Pi turns the detection into an angle, then subtracts the plane's own roll and pitch so the target doesn't appear to swing around every time the plane banks.
- Lead. Proportional navigation, the guidance law interceptor missiles use, steers the plane onto a collision course instead of a curving chase.
- Steer. The Pi sends bank and pitch targets to the flight controller, while a 15 ft altitude floor keeps it out of the ground.
When the pilot flips the switch back, they get control again in under 100 ms. If the Pi crashes, control comes back in about half a second.
Claude Opus 5.5
I used Claude Opus 5.5 to help build the guidance system and the Pi-to-flight-controller link. It was strongest on the math: proportional navigation, the coordinated-turn equation that converts a turn rate into a bank angle, and the frame-of-reference work that removes the plane's own motion from the camera image. When we found out the board ran INAV instead of Betaflight, it helped me redesign the control path around logic conditions instead of starting over. It can't see the hardware, so every sign and direction still had to be checked on the bench, but it let a two-person team cover a lot more ground in one weekend.
What I learned (mostly the hard way)
Read the firmware before you design around it. We planned the whole control system around a Betaflight feature that lets a companion computer override the radio. On the bench we ran version and found out the board was running INAV, which doesn't have that feature. We rebuilt the link around INAV's logic conditions: a chain of 14 rules that apply the Pi's targets only while the switch is up and the Pi's heartbeat is fresh.
A dataset has to match the job. Our first balloon detector was great at finding balloons at birthday parties. Public balloon datasets are full of indoor party photos and hot-air balloons, and none of that looks like a small balloon against open sky. We filtered hard, retrained, and tested on real sky photos. The final model found a balloon in all 43 sky test images with zero false alarms.
Use the multimeter before you plug in the battery. Our 6S battery puts out around 25 V. We fried our buck converter because we connected it before checking the output. It took one second to break and a lot longer to fix.
SSH is a superpower. I'll come back to this one.
Demo
toyJig
/
UAV-Balloon-Popper
A repository logging the implementation of the an AI drone detection and auto-intercept/auto-pilot system (and balloons) onto a Raspberry 5 mounted in a real RC Plane.
Pi-Assisted Lock-On Autopilot for an INAV Mini-Plane
Flip a switch on the radio, and a Raspberry Pi takes the stick: it finds a balloon or drone in the camera feed and flies an intercept course straight at it.
🎯 What it does
A Raspberry Pi 5 + Camera Module 3 added to an existing SpeedyBee F405 Wing flying wing running INAV 6.1.1, so that flipping a transmitter switch hands bank and pitch to the Pi, which detects a flying object (balloon/drone) and flies an intercept course straight at it. The guidance removes the plane's own roll and pitch from the camera line of sight using the FC's attitude (gyro-extrapolated to the frame's exposure time) and leads the target with proportional navigation, so a fast pass stays a near-straight collision course instead of curving in late. Flipping…
Balloon detection on the Pi. The Pi streams its camera to a laptop with the detector's boxes drawn on top. Here it locks onto a red balloon at about 13 fps:
Drone detection. The same model, pointed at a screen full of drone photos:
The build. The bench, mid-chaos: the airframe, the Pi, the flight controller and a lot of wires.
Some numbers I'm proud of:
| Test | Result |
|---|---|
| 🛸 Drone detection | 96.6% mAP50 on held-out test images |
| 🎈 Balloons in open sky | 43 / 43 found, 0 false alarms |
| 🔁 Pi vs. laptop model | 392 / 392 detections matched |
| 🎯 Intercept simulator | median miss 0.5 to 1.1 m at 15 to 45 m/s |
Partner Technologies
GitHub
GitHub was the backbone of the project. The code ran on three machines: my laptop for training, the Pi on the plane, and Mohamed's laptop for flight controller setup. Git kept them in sync, so I could write and test guidance code on my laptop and pull it onto the Pi in seconds over SSH.
We wrote all the software so it could run without hardware. Every serial port, camera and ML backend gets swapped for a fake in tests. That gave us 175 tests that run anywhere, so I could keep building guidance code while Mohamed was still building the plane, and catch mistakes before they reached real servos.
The repo also became our project notebook. Each physical step, from wiring the Pi to configuring INAV to the props-on test, has a runbook in docs/ with exact commands and checklists, so either of us could pick up where the other left off at 3 a.m. One limit we hit was the 100 MB file cap. Our raw demo videos were far too big, so we compressed them before committing.
Hackathon Experience
I was at HackUMass at UMass Amherst, and most of my weekend happened in the makerspace.
Mohamed and I split the work cleanly. He owned the plane: designing the body in Onshape, printing it in PLA Aero, epoxying, soldering, and linking the flight controller to the radio. I owned the brain: training the detector, writing the guidance, and getting the Pi to talk to the flight controller. Every few hours we met in the middle and plugged our halves together. Sometimes that went fine and sometimes it smelled like burning electronics.
The moment I'll remember most is the Raspberry Pi 5 refusing to cooperate. It was my first time with one. It wouldn't drive a monitor, and it kept crashing. Eduroam is famously painful to set up on Linux, so I put the Pi on my phone's hotspot and SSH'd in. I'd been learning bash and Linux on my own for a while, and suddenly that was the only way forward. It turned out to be the best thing that happened all weekend. No more unplugging the Pi from the plane to plug it into a monitor, no more juggling keyboards. I just opened a terminal from wherever I was sitting. I went from "I've been learning Linux" to "I run my whole project over SSH" in about an hour.
By the end, every bench test passed. With the plane sitting on the table, the elevons followed the balloon exactly where it moved in the camera's view.
What's next
A test flight, and popping some balloons. 🎈💥
If you've ever wanted to build something that sees and moves on its own, my advice is to start with balloons. They're cheaper than drones, and they don't fight back.



Top comments (0)