loading

This is a moderately easy project which will help you to learn how to interface arduino and sensors with any multirotor flight controller.

Things you need:

  1. Sharp IR Sensors (GP2Y0A02YK0F) x4
  2. Arduino(Any) x1
  3. Jumper Wires
  4. A multirotor

Here’s how it works:

The IR sensor measures the distance between the sensor itself and the object and sends it to the arduino in the form of analog signal (value range: 0 to 1023). We should make a setpoint say 40cm from the IR sensor so if the setpoint reaches below 40cm the PID algorithm in the arduino will start its work by sending out the correction value to the stabilization board.

Most of you know what PPM and PWM signals are and how it is used in RC universe and this is how it is used in our project.

The normal range is 1000us to 2000us and 1500 us is the center or neutral value for roll pitch and yaw. We are going to use only range from 1200us to 1800us since we don’t want to flip the quad if the quad is a bit closer to the wall. You will be having the full control of the Quadcopter. So , When the quadcopter goes near any obstacle the arduino will takeover the controls and moves the quadcopter away from the obstacle .

Step 1: Step 1: Connecting the Arduino, Senors and the Flight Controller

Connect the Sensors, Arduino, Flight controller and RC receiver . Check and double check the connections.

Proceed to the next step where we will be uploading the sketch to the Arduino.

Step 2: Step 2: Uploading the Sketch

You need to add the RC library to your Arduino IDE . You can download the Library From HERE

https://sourceforge.net/projects/arduinorclib/

Download the Code from HERE

After uploading the Sketch open the serial monitor and check if all the sensors readings and the RC values are present

After this final check you are ready to Fly.

I am trying to make quad copter collision avoidance system using adriuno Uno, hc sr04 ultra sonic sensor and kk2 flight controller for my college project plz help me with sketch and connections plz ... Plzz contact me at harishf305@gmail.com
<p>and also another question. What if you connect a fifth sensor to it the up side. i mean if you fly your drone in doors, it will crash if it touches the ceiling.</p><p>if possible please tell us how to do it.</p><p>If it is OK please give us your Email address to be in touch with you.</p><p>mine is rashedsadeed2012@yahoo.co.uk</p><p>thanks in advance.</p>
<p>Hey there. I really like your system and i plan on making it. but since i am new to robotics and don't have any idea on how to write codes for the arduino i need some help and i hope you have the answer to my questions</p><p>1. is it OK to use (GP2Y0A21YK0F) sharp sensor, or do i have to modify the code for that?</p><p>2. As shown in the figure you used a flight controller in your schematics, but i am going to build a quadcopter and i am going to use an arduino uno as my flight controller (schematics are found below). So my question is how to connect the system to my arduino (flight controller) once i have made the quadcopter and what modifications do i have to make for the quad's code?</p><p></p><p>Your kind response is really appreciated</p><p>Thanks in advance</p>
<p>Good idea. If your quadcopter crashes into the wrong thing, it is finished. Something like this could greatly increase its life span.</p>

About This Instructable

1,724views

23favorites

License:

More by CyrilAnthony777:Quadcopter Collision Avoidance Using Sharp IR Sensors 
Add instructable to: