Introduction: Quadrotor

This summer's Edgerton Center Engineering Design class produced four awesome projects in four weeks. One of the projects was a functional RC quadrotor built with commonly-available RC equipment and an Arduino microcontroller board. Here is the instructions on how to make the quadrotor. The video of the four projects can be found here.

Parts List:

- 1/32” aluminum sheet
- 2 of 8 x 3.8 slow flyer propeller
- 2 of 8 x 3.8 slow flyer pusher propeller
- 4 of Turnigy C2028 Micro brushless outrunner 1400kV motor
- 4 of Turnigy Plush 18 amp speed controller
- Turnigy nano-tech 1800mah 4S 35-70C Lipo Pack
- 1/2” 4-40 plastic machine screws
- 4-40 plastic nuts
- 1/2” 4-40 aluminum machine screws
- 5/8” 4-40 aluminum machine screws
- 3/8” 4-40 aluminum machine screws
- 2” threaded 4-40 plastic spacers
- Accelerometer + Gyros chip: Sparkfun 6DOF razor IMU
- Microcontroller: arduino mini
- Hobbyking 2.4 GHz transmitter and receiver + Controller
- 1.5” hex threaded 4-40 aluminum spacers
- 2 of Carbon Fiber square tube .25” x .25” (.180 ID) x 48”
- Strings
- Zip-ties
- Super glue
- Velcro
- Protoboard
- Female header pins
- 3.3 volt regulator
- Jumper Wires

Where to get parts:

Propellers- http://www.apcprop.com/pindex.asp?Page=2


Carbon Fiber square tube - http://www.dragonplate.com/



Step 1:

Cut 2 of 14”, 4 of 6.125”, 4 of 8” carbon fiber square tubes

Drill 7/64” holes 3/8” away from each ends of the cut carbon fiber tubes.

Drill 7/64” holes 1 and 5/8” from both ends of 14” long carbon fiber tubes. Drill 7/64” holes 1 and 5/8” from only one end of 6.125” and 8” long carbon fiber tubes.

When drilling through the carbon fiber tubes, drill very slowly with caution. Carbon fiber tubes can split if you don't pay attention. Also use a drill press instead of a hand drill.

Step 2:

Cut 4 of 2”x2” square from 1/32” aluminum sheet. File the sides and corners of the square

Mark the center lines of the square so that it forms a cross. Drill a 1/8” hole on the center of the aluminum square. Place the center of the motor on the 1/8” hole and mark the motor leg holes on the aluminum square. Line one of the motor leg holes on one of the center lines.

Drill 9/64” holes on the aluminum for the motor legs.

Step 3:

Place 2 of the 6.125” carbon tubes on each end of a 2x2 square aluminum sheet. The carbon tube should be parallel to each other. The two carbon fiber tubes should be parallel to the center line drawn on the 2x2 aluminum sheet where one of the motor leg holes are. 

On the 2x2 aluminum sheet, mark where the holes on the carbon tubes are by placing a center punch through the holes on the tube.

Repeat this step for the other two 6.125" carbon tubes and 2x2 square aluminum sheet. 

Step 4:

Repeat the previous step for the 14” carbon tubes. The 2x2 aluminum sheets should be on both ends of the 14” carbon tubes.

Step 5:

Place one end of the 8” tubes with two holes along the center line drawn on the 2x2 aluminum sheet with the motor leg hole. One of the holes on the 8” carbon tube should line up with the motor leg hole. Place the 8” carbon tube so that the longer side points the opposite direction from the other carbon tubes. Mark the remaining hole on the 8” carbon tube on the aluminum sheet with a center punch. 

Drill 7/64” holes on the 2x2 aluminum sheets where the center punch left marks.

Step 6:

Attach the carbon tubes using 4-40 plastic machine screws and nuts. Do not place any screws through the hole on the 8” carbon tube that is lined up with the motor leg hole.

Step 7:

Super glue .188” locating ring into the propellers

When the super glue is dry, use a 1/4” drill bit to slightly enlarge the locating ring hole until the motor shaft slips on.

Drill holes on the side of the propellers corresponding to the holes on the motor shaft and attach the propellers to the motor using the screws that were on the motor shaft.  

Step 8:

Attach the motors on the 2x2 aluminum sheets by placing a nut between the motor leg and the aluminum sheet so that the motor is not flush against the aluminum sheet. Same pitched propellers should be across to each other, so attach the slow flyer propellers on the 2x2 aluminum sheets with 6.125” carbon tubes. Use 5/8” aluminum machine screws for the holes that are lined up with the 8” carbon tubes.

Step 9:

Cut two sheets of 5”x5” aluminum sheets. Mark 2” on the center of each sides of the 5x5 aluminum sheets. Connect the ends of 2” sides so that the drawn lines form an octagon.

Cut out the corners of the 5x5 aluminum sheets along the drawn line to make octagons.

File the corners and the edges of the octagon.

Step 10:

Draw center lines of the 2” sides on one of the octagons. Define x and y axis. With a center punch, mark at points (.875,2.125), (1.375,.875), (2.125,.875), (2.125,0), (1.5, 1.5) from the origin or the point where the center lines intersect. Reflect the marked points over the center lines so that each quadrant has the same points.

Drill 7/64” holes on the marked spots on the octagon.

Step 11:

Place the octagon on the center of the 14” carbon tube assembly. The holes on the points (.875,2.125) and (.875, -2.125) have to lie on one of the 14” carbon tubes. The holes on the points (-.875, 2.125) and (-.875, -2.125) have to lie on the other 14” carbon tubes. Make sure the aluminum octagon is on top of the carbon tubes. Mark the holes on the carbon tubes through the holes on the aluminum octagon using a center punch. DO NOT use a spring loaded center punch on the carbon tube. GENTLY tap the center punch with a rubber mallet.

Step 12:

Place the 6.125” carbon tube assemblies on the other two sides to create a cross like shape with the carbon tubes. The holes on the points (2.125, .875) and (1.375, .875) on one of the carbon tubes of one of the 6.125” assemblies. The holes on the points (1.375, -.875) and (2.125, -.875) should lie on the other carbon tube. Make sure the motors are facing the same direction. The holes on the points (-2.125, .875) and (-1.375, .875) on one of the carbon tubes of the other 6.125” assemblies. The holes on the points (-1.375, -.875) and (-2.125, -.875) should lie on the other carbon tube. Mark the holes using a center punch.

Step 13:

Drill 7/64” holes on the marked spots on the carbon tubes. The carbon tubes break easily when drilling, so drill very slowly.

Attach the carbon tube assemblies to the corresponding spots on the aluminum octagon.

Step 14:

On the second aluminum octagon, draw center lines from the 2” sides. Define x and y axis. On the protoboard, there are four holes in each corner. Aline the long side of the protoboard along the y axis and mark the four corner holes on the octagon. Drill using 7/64” drill bit for the four holes.

Duct tape top of the octagon where the protoboard is being attached to prevent short circuiting.

Step 15:

With a center punch, mark points at (1.5,1.5), (2.125, 0) and (1.7, .86). Reflect the point over the center lines so that each quadrant have the same points. 

Drill 7/64” holes on the marked spots.

Step 16:

Attach the protoboard on to the second octagon using plastic machine screws with nuts between the board and the octagon so that the bottom of the protoboard does not touch the octagon.

Step 17:

Cut 2”x4” rectangle from the 1/32” aluminum sheet. File down the corners and sides.

Draw center lines on the rectangle and define the center line from the 4” side as the y axis so that when the y axises from the octagons and the rectangle are lined up, the long sides of the protoboard and the aluminum rectangle would be perpendicular to each other.

With a center punch, mark points at (1.7, .86) and the reflected points over the center lines in each quadrant.

Drill 7/64” holes on the marked spots

Step 18:

Place a strip of Velcro on the aluminum rectangle and the on one of the 123mm x 29mm sides of the battery. Attach the battery and the aluminum rectangle.

Place the 1.5” aluminum hex spacers on (1.7,.86) and the corresponding points between the aluminum rectangle with the battery and the octagon with the protoboard. The battery should be under the protoboard. Bolt the rectangle, octagon and hex spacers using 4-40 plastic machine screws.

Step 19:

Solder the speed controllers to the motors so that the propellers spin the right direction. 

Refer to the wiring diagram for electrical connections.

Notes on diagram wiring :

-We used additional header pins to all connected to VCC to create additional 5V pins. We did the same for ground.
-1 speed controller’s 5V power from the 3-wire-connector must go to VCC on the Arduino. This connection supplies the power for the entire board.
-All 4 speed controllers’ ground wires must connect to the Arduino’s ground pin(s).

Step 20:

Cut the 2” plastic spacers in half. Place the 1” spacers between the two octagons on the holes at points (1.5,1.5) and (2.125,0) and the corresponding points in the other quadrants. The center line axis on both octagons should line up. Also the protoboard should lie between the 14” carbon tubes

Bolt the two octagons with the 1” plastic spacers with 4-40 plastic screws.

Step 21:

Use 1/2” aluminum machine screws to attach 2” plastic spacers at the end of the 8” carbon tubes. Tie a string around the frame by placing the string between the plastic spacers and the carbon tubes.

Step 22:

Screw on 3/8” aluminum machine screws on top of the 2” plastic spacers. Tie a string around the frame similar to step 41, except the second string has to go between the plastic spacers and the 3/8” aluminum machine screws so that the string is tied on top.

Step 23: Code

Our code was written in a modified form of C++ that is described on the Arduino website.

Our code represents a feedback control system known as PID (proportional integral derivative). Currently, it only employs use of the proportional and derivative components. With our current code, the quadrotor self-stabilizes quite well in the air, but is a little unstable on takeoff. However, this instability can be mitigated by taking off quickly.

To find the current amounts of tilt on the X and Y axis from accelerometer and gyro data, we used an algorithm that would average previous accelerometer data and combine it with gyro data to reach an angle measurement that was fairly resilient to linear acceleration.

We only do 2 Pulsin commands per loop (instead of 4) to cut the loop time in half, which makes the quadrotor control system much more responsive.

//neutral accelerometer/gyro positions
#define X_ZERO 332
#define Y_ZERO 324
#define Z_ZERO 396
#define PITCH_ZERO 249
#define ROLL_ZERO 249
#define YAW_ZERO 248

#define GYRO_CON 1.47
#define ACCEL_CON 0.93

#define TIME_CON 0.02
#define SEN_CON 0.95

//motor speed vars
int speeds[4];

//gyro inputs - current tilt vars
float pitch, roll, yaw;
int pitchzero, rollzero;
//accelerometer inputs - current acceleration vars
float xin, yin, zin;

//human inputs - control info vars
float pitchin, rollin, yawin, zhuman;

//random other vars
float xaverage=0, yaverage=0;
int y=0;
int blah;

//proportionality constants
float p=2.5; // P proportionality constant
float d=0.5; // D proportionality constant

void setup() {
for(int x=6; x<10; x++) {
pinMode(x, OUTPUT);

//send upper bound for human inputs to the motor speed controllers
for(int x=6; x<10; x++) {

//get zeros for pitch and roll human inputs
for(int x=0; x<10; x++) {
for(int x=0; x<10; x++) {

void loop () {
//accelerometer and gyro inputs ranged -232 to 232?

//get human inputs through radio here range of -30 to 30 except for zhuman which has an ideal range of 1000-2000, only 2 pulses per loop
if(blah==0) {
yawin=0.06*((signed int) pulseIn(2,HIGH)-1500);
pitchin=0.06*((signed int) pulseIn(3,HIGH)-1500);
else {
zhuman=(signed int) pulseIn(4,HIGH);
rollin=0.06*((signed int) pulseIn(5,HIGH)-1400); //1400 instead of 1500 is to correct for the underpowered motor #4 by trimming it in code

//averaging, etc.
xaverage= SEN_CON *( xaverage + TIME_CON * pitch) + ( 1 - SEN_CON ) * xin;
yaverage= SEN_CON *( yaverage + TIME_CON * roll) + ( 1 - SEN_CON ) * yin;

//calculate the motor speeds
if(zhuman<1150) {
for(int x=0; x<4; x++) {
else {
if(zhuman > 1450) {
zhuman = 1450;
speeds[0] = zhuman - p*(xaverage - pitchin) - p*(yawin) - d*pitch;
speeds[1] = zhuman - p*(pitchin - xaverage) - p*(yawin) + d*pitch;
speeds[2] = zhuman - p*(yaverage - rollin) + p*(yawin) - d*roll;
speeds[3] = zhuman - p*(rollin - yaverage) + p*(yawin) + d*roll;
//set the upper and lower bounds for motor speeds (1000=no speed, 1600=upper speed limit, 2000=maximum possible speed)
for(int x=0; x<4; x++) {
//speed limit between 1000 and 1600
if(speeds[x]<1000) {
if(speeds[x]>1600) {

//pulsouts to motor speed controllers
for(int x=0; x<4; x++) {
void pulsout (int pin, int duration) {
digitalWrite(pin, HIGH);
digitalWrite(pin, LOW);

Step 24: Tuning

Due to variance in the individual motors / frame, you may need to alter the p and d values in the code above. The variable p controls how much the quadrotor will alter motor speeds to correct for an offset from the desired tilt. The variable d controls how much the quadrotor will resist sudden rotation. An incorrect ratio of p to d could cause the quadrotor to be unstable either by being less responsive than desired or by causing oscillations of increasing magnitude. Scaling up both p and d by the same value would increase the magnitude of the current effects.

Our tuning method involved a lot of trial and error. We would support 2 opposite corners of the quadrotor leaving the other 2 free to rotate. Then we would check for stability by first observing if the quadrotor was keeping itself level, then secondly by injecting disturbances to observe if it would return to a level position. If the p and d values permitted the quadrotor to pass both of these tests, we would repeat the procedure and on the other axis. When the quadrotor was stable on both axis, we then were ready to fly!

Be the First to Share


    • Meatless Challenge

      Meatless Challenge
    • First Time Author Contest

      First Time Author Contest
    • Eggs Challenge

      Eggs Challenge



    Question 4 years ago

    Hi. I am a student of electricity and I have a question. I want to make changes to the control system of the basic code of the quadcopter (I mean the code for making the quadcopter with Ardino) but I don't know which section should be changed. Can you help me?Please send an answer to my email. Thank you


    4 years ago

    I was looking for this post and now found it, Bookmarked.


    5 years ago

    I've seen the video. Great job on your projects. Congrats


    11 years ago on Step 19

    I'm buying an Arduino Uno. I'm not sure if you know, but would you connect the same pins on the uno? Or do they have numbers and voltage correlations?


    Reply 11 years ago on Step 19

    The Arduino Uno has a lightly different layout then the Pro Mini being used here. One plus is that you can skip that 3.3v regulator because there is one on the board already. You'll notice that there is a pin labelled "3.3v" to which you can connect the corresponding 3.3v port on your sensor board.

    So the pins for the sensor board the line up as such;
    3.3v = 3.3v
    GND = GND
    Gx4 Y = Analogue5
    Gx4 X = Analogue4
    Gx4 Z = Analogue3
    A Z = Analogue2
    A Y = Analogue1
    A X = Analogue0

    The rest of the pins should correspond plainly to the ones on your UNO
    Digital pins 6,7,8,9 to the control pin on your ESCs. Human controls are on pins 2,3,4,5 to your receiver. Personally I am using an Xbee module instead so I will not be using that last set.

    Bam Boy
    Bam Boy

    Reply 8 years ago on Introduction

    Hi, I came across your project and I am doing almost the same. However, I am using and arduino UNO and an MPU6050. The Pin alignment that you mentioned above; I am a little confuse about it.

    I can not find the Gx4 Y, Gx4 X, Gx4 Z or the A Z - X pins on my MPU6050 board. THe only way I connect it to it is by connecting SCL - Analog 5 and SDA - Analog 4. So can you please explain how can I implement it?


    Reply 7 years ago on Introduction

    Hi, I am also using the same equipments : arduino uno and mpu 6050.

    I have just interfaced mpu6050 with arduino and could read the yaw pitch roll values on serial monitor.

    Instead of using RC Radio Controller, I want to use a bluetooth module and android app to control the flight controller.

    Can you help me about how to use the onboaard sensors to give values and correspondingly how to make arduino give instructions to ESC and motors?

    Really need help, reply asap.


    Reply 7 years ago on Introduction

    Hi SarveshT1,

    I'm too using an Arduino Uno R3 for making a quadcopter. I however use a MPU-9150 instead of an MPU-6050. But I do use the library called "MPU6050.h". You can download this library from github. It's part of the I2Cdev repo. Download this library and run some tests.

    Like you've probably already guessed the MPU6050 runs on I2C. This protocol runs on digital signals, not on analog signals as described in this tutorial. For my quadcopter, I want to know the angle the drone's flying in, and from there calculate what to do with the motors. I think this is better because it makes the drone possible to fly on its own. I'm also planning to build an android app, and calculating the exact angle is needed for that too.

    But let's not talk too much about dreams. I use the gyroscope and the accelerometer to calculate this angle. I use a 'Complementary Filter' to calculate this angle as good as possible. This filter picks the best of both worlds. The gyroscope can drift, and the accelerometer is unsteady. How I've implemented it is like this:

    #include <Wire.h>

    #include <I2Cdev.h>

    #include <MPU6050.h>

    //This one is the same for MPU9150 and MPU6050


    #define RADIANS_TO_DEGREES 57.29577951

    MPU6050 mpu = MPU6050();

    //The timer which is needed for the Complementary Filter

    long timer;

    //The variables where the data from the imu is stored in

    int16_t ax, ay, az, gx, gy, gz;

    //Variables to store the calculated pitch and roll in

    double pitch = 0;

    double roll = 0;

    void setup() {

    Serial.begin(115200); //Personal favor

    Wire.begin(); //The library doesn't do this by itself



    //Check if the MPU-6050 is connected, and wait one second before checking again

    while (!mpu.testConnection()) {

    Serial.println("MPU not found!");



    mpu.setFIFOEnabled(false); //Make sure you always get the newest messages

    Serial.println("Setup executed!");


    void loop() {

    long begin = micros();

    //Get the accel and gyro data from the mpu6050

    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

    //First calculating the angle of the accelerometer for the pitch.

    //More information google 'Accelerometers and gyroscopes on a chip'

    long squareSum = (long) ay*ay + (long) az*az;

    double accelAngle = atan(ax / sqrt(squareSum)) * RADIANS_TO_DEGREES; //I want my angle in degrees

    pitch += (-gy / GYROSCOPE_SENSITIVITY) * ((micros() - begin) / 1000000.0);

    pitch = 0.98 * pitch + 0.02 * accelAngle;

    //And all the same for the roll but different formula

    squareSum = (long) ax*ax + (long) az*az;

    accelAngle = atan(ay / sqrt(squareSum)) * RADIANS_TO_DEGREES;

    roll += (-gx / GYROSCOPE_SENSITIVITY) * ((micros() - begin) / 1000000.0);

    roll = 0.98 * roll + 0.02 * accelAngle;

    //And print the values to the terminal

    Serial.print("Pitch: ");


    Serial.print(" Roll: ");



    Upload this to your Arduino and it will print the angle of your mpu to the screen. Check the baudrate!

    About the ESC's I can't tell you very much now, I'm still figuring this one out. I've found out how to get angle, but now translating that angle to a pulse is the difficulty. I wish you good luck with your project!


    Reply 5 years ago

    can you send me full code . my email-manojkumarmajhi97@gmail.com


    Reply 7 years ago

    Can you send me all the code? I'm using arduino uno and mpu6050.. Please send all code and the Diagram wires esc to arduino and arduino to receiver... My email is rvalent86@gmail.com


    Reply 5 years ago

    did u got the code?


    Reply 5 years ago

    What code do you want?


    Reply 5 years ago

    thank u so much for responding me. i'm making project on quadcopter and that should be controlled by using hand gestures. If u send me your email,I can tell u the details. Please help me on this. I want complete arduino code for quadcopter. I'm using arduino mega.


    Reply 5 years ago

    This is al the code...


    Reply 7 years ago on Introduction

    Can you send me all the code? I'm using arduino uno and mpu6050.. Please send all code and the Diagram wires esc to arduino and arduino to receiver... My email is rvalent86@gmail.com


    Reply 7 years ago on Introduction

    1. This is all the code for reading an MPU6050, which was the question. Download the MPU6050 library from http://www.varesano.net/files/FreeIMU-20121122_112... .

    2. MPU:

    Arduino 3.3v - MPU6050 Vcc

    Arduino GND - MPU6050 GND

    Arduino A5 - MPU6050 SCL

    Arduino A4 - MPU6050 SDA

    3. ESC

    ESC-Signal wire - Arduino uno random programmed output port

    ESC-Signal wire - Arduino uno random programmed output port

    ESC-Signal wire - Arduino uno random programmed output port

    ESC-Signal wire - Arduino uno random programmed output port

    ESC-Ground wire - Arduino GND (Only do this with one ESC)

    (Check if your ESC is a BEC or you have a 2nd battery)

    ESC 5v (Only do this with one ESC!) - Arduino 5v (This ESC will power the Arduino and the Receiver)

    4: Remote

    Remote GND - Arduino GND

    Remote 5v - Arduino 5v

    Remote CH1 - Arduino input port

    Remote CH2 - Arduino input port

    Remote CH3 - Arduino input port

    Remote CH4 - Arduino input port

    I wish you good luck finding better sources with such an ungrateful attitude.


    Reply 5 years ago

    I2C bus son


    Reply 7 years ago on Introduction

    I am also using xbee...can you please share the code with me...please

    my email id is dhrvjsh102189@gmail.com

    Ben Mighall
    Ben Mighall

    Reply 9 years ago on Introduction

    What is a good way to get started with learning the Arduino?


    Reply 9 years ago on Introduction

    Getting your hands dirty. Personally, I got myself the starter kit from Adafruit; and they also have an excellent set of tutorials .

    I had some programing experience at the time already, so for me it was an exercise in learning how to bring code into the physical realm. The Adafruit tutorial were good for me to shore up on the electronics side of things.

    Did you have a project in mind already? I find that having a specific goal when learning something new greatly increases your chances of success and I'm more than happy to take a stab at it if you have any specific questions.