The brief was simple from the wrong direction: cities know they have a pollution problem, but the sensors are stuck on lampposts ten meters above traffic and they can't tell you which cars are causing the spike. So they treat all traffic as equally dirty when really it's a few diesel trucks and twenty Teslas behaving very differently.
Project AirGuard is a drone payload that pairs an air-quality sensor stack with a vision model that classifies vehicles as fuel or EV in real time. The output is a stream of geotagged readings annotated with the actual emitters in frame.
The hardware sandwich
The drone itself is a stock quad with a payload bay big enough for a Pi 4, a small lipo, and a sensor breakout. The stack from top to bottom: MQ-7 (CO), SDS011 (PM2.5/PM10), BME680 (VOC + temp/humidity/pressure), and a Pi camera v2 staring straight down. The Pi runs a YOLOv5n model trained on a re-labelled subset of UA-DETRAC plus my own footage from car parks tagged for fuel-vs-EV.
[ DRONE PAYLOAD ] ├── PI 4 # compute ├── PICAM v2 # downward vision ├── MQ-7 # CO ppm ├── SDS011 # PM2.5 / PM10 ├── BME680 # VOC / T / RH └── 4G HAT (LTE) # uplink
Telling EVs from fuel from the air
The classifier is the part everyone asks about. From above, the visual signal is subtle — there's no exhaust pipe to see, the body shapes are converging across categories. What works is brand context (Tesla / Polestar / Rivian / specific BMW i-series) plus a few hard-coded heuristics like the absence of a grille and the presence of a charging port flap.
I built a hybrid: YOLOv5n detects vehicle bounding boxes, then a lightweight classifier head trained on top crops outputs three classes — fuel, ev, uncertain. The "uncertain" bucket is critical. About 18% of vehicles in test footage land there, and they're excluded from the AQI attribution math instead of being guessed at.
Drone airflow contaminates the sensor readings if the intake is too close to the props. Took two crashes and a redesign before I moved the gas sensors to a small extended boom 30cm forward of the body. Calibration data taken on the ground is meaningless until you also calibrate in flight.
What it does well, what it doesn't
What works: spotting localised pollution spikes and correlating them with vehicle density. What doesn't: anything that depends on knowing the absolute concentration. The MQ-7 is great for relative deltas but the calibration drifts hourly with temperature and humidity. I treat the sensor stack as good for "is it worse here than 100m back" — not "this intersection has 12 ppm CO."
The drone gave the data a shape no fixed sensor could. Pollution lives in pockets, drifts with wind, and is dominated by individual vehicles in ways that hourly averages just hide.
Where it's headed
Next iteration is autonomy — right now I fly it manually along a transect. With a known route and waypoint stack, the drone could repeat the same path daily and build a longitudinal heatmap. The model can also get better — I'd like to add a third class for "diesel truck" because their emission signature is so different from petrol passenger cars that lumping them together loses information.