Some flying animals use active sensing to perceive and avoid obstacles. Nocturnal mosquitoes exhibit a behavioral response to divert away from surfaces when vision is unavailable, indicating a short-range, mechanosensory collision-avoidance mechanism. We suggest that this behavior is mediated by perceiving modulations of their self-induced airflow patterns as they enter a ground or wall effect. We used computational fluid dynamics simulations of low-altitude and near-wall flights based on in vivo high-speed kinematic measurements to quantify changes in the self-generated pressure and velocity cues at the sensitive mechanosensory antennae. We validated the principle that encoding aerodynamic information can enable collision avoidance by developing a quadcopter with a sensory system inspired by the mosquito. Such low-power sensing systems have major potential for future use in safer rotorcraft control systems.