How can I make a quadcopter avoid obstacles using infrared?

I have a quadcopter built, and I need to be able to make it to autonomously follow a route and avoid obstacles where possible.

My general plan is to have an array of sensors on a pre-defined "front". The quadcopter will only go forward. Generally I'd like to make it so that if the sensors pointing at a higher angle detect something getting closer as the bot moves forward, the quadcopter will stop, descend until the distance to that detected object decreases, and then continues forward. Similarly, I'd like the opposite event to happen if the sensors pointing at a lower angle detect something getting closer to the quadcopter.

I'm thinking of having something like 9 small infrared distance detectors (pointing up, forward, down || left, forward, right), basically a 3x3 matrix.

Would anyone have any ideas of the feasibility of this? I'd like to use a raspberry pi, but it will probably also need an additional board to read in the values from its sensors. In addition, I have no idea which sensors to use, or if infrared can even work. Any suggestions are more than welcome.

I was also thinking about ultrasonic sensors, but having 9 of them could get cluttered, and I'd worry about their short range when a crash means death for the quadcopter. I also fear they would cause interference with each other.

Answers 1

  • Ultrasonic sensors will in my experience give you better range and accuracy than infrared, unless specifically dealing with many smooth, or sound dampening surfaces. You can poll them one at a time in order to not cause interference, and use some that use I2C (like these), then you could directly attach them to the raspberry pi to poll the values. What flight controller are you using? for most you could simply send direction data over the GPIO.

Related Questions