Quadcopter with Arduino Uno running MultiWii

IMG_8129

Here I will show you how to use Arduino Uno as a flight controller for your quadcopter. You will also need all other parts, described in Part I of How to build a  quadcopter.

Essential part of every flight controller is the gyroscope/accelerometer sensor. So you need this one too for your Arduino flight controller. I used a Chinese GY-86 IMU for my build. This one comes with additional barometer MS5611 and compass HMC5883L. The GY-87 IMU is almost the same, only the barometer is different. Of course you can use any Arduino board, as well as IMU with only a MPU6050 gyro/acc.

GY-86 IMU

First check how to connect all the quadcopter parts. If you have already mounted the propellers, please remove these for safety reasons. Fix the IMU to the frame. Then connect the receiver (RX) and the GY-86 IMU to the following pins of your Arduino Uno:

You also need to connect the servo cables from every ESC to the Arduino Uno. The cable from ESC Nr. 1 will provide power to the Arduino board. Connect not only the yellow signal cable, but also  the ground (brown) and 5V (red). Note that your ESC should have an integrated BEC in order to supply 5V to the Arduino.

Once you have done all these steps download the latest MultiWii firmware. Unzip and open the MultiWii.ino file from the MultiWii folder. In the config.h Tab define that you are using the GY-86 IMU. Check the MultiWii manual in order to define some other variables. Then upload the saved sketch to your Arduino (it must not be connected to the battery of your quadcopter).

Start the MultiWiiConf.exe from the MultiWiiConf folder. Select the right COM port, click “Connect” and then “Start”. If everything is connected right, you should see a graphic of your quadcopter moving, when you rotate it. To change some of the numbers, do following: move the mouse cursor over the number you want to change, click and slide. Disconnect from the USB port, turn on your transmitter and connect the battery. Perform some tests without the propellers to check if all motors spin in the right direction.

Here is a picture of my build. It doesn’t look very nice on my frame, but that is the only one I have.

If you need more information visit the official MultiWii website. Although it is great fun using 8bit Arduino with MultiWii as a flight controller, there are much better and cheaper 32bit flight controllers using the MultiWii firmware. Have a fun with your copter and if you liked my article, share it :).

Leave a Reply

84 Comments

  1. daniel

    The IMU, must be fixed just in the middle of frame? or it can be fixed in elsewhere?

    Thx.

    • Sergey

      Hi Daniel, it is better to be fixed somewhere in the middle.

  2. daniel

    In the picture, I can see arduino UNO, but on frame I see another board. Is it necesary?

    Thanks and I´m sorry for to repeat the question.

    • Sergey

      No, it is not. That is my MegaPirate AIO flight controller, which was unplugged but still mounted.

  3. daniel

    Sergey, sorry for the inconvenience. Could you help me please.
    I am following your post with Arduino UNO and GY-86.
    The GY-86 has two axes. “X” and “Y”.
    The quad has front area, back, left and right area. Where do you have to point the “X” GY-86, toward the front area?
    I tried the flight but did not take off. He turned in the air and crashed. I think I’ve placed the “X” GY-86 imu in the wrong direction.
    On the other hand, have you the code that you use in your quad with the GY-86? It would be possible to download it and compare it with mine?
    Again thank you very much for the inconvenience. I’ve broken several pieces and I don´t know what I’m doing wrong.

    • Sergey

      Hello Daniel,

      on mine Quadcopter “X” was pointing right, and “Y” forward. But I am pretty sure you can easily then change the directions through the MultiWii software.
      Sorry, but I don’t have this quad anymore. I am using the Arduino for other projects now.
      You mean that your Quadcopter flipped? This could be because the motors and/or propeller are spinning in the wrong direction. Always test first without propellers, to check if the motors are spinning according the MultiWii layout.
      Don’t worry, repair it and try again step by step before making a test flight. Have a fun!

  4. daniel

    Thank you very much for your kindness. I’ll try again with your instructions. Thanks again.

    • Sergey

      No problem, Daniel. Waiting to see it in the air 🙂

  5. Eze Charles

    Pls, Can You Help me with Your Code. Plsssss

    • Sergey

      Hi, whats exactly your problem with the code? Can you describe it?

  6. hi.
    umm.. can i ask somthing?
    i use arduino uno and multiwii.
    and i use controller(devo7), receiver (rx 701), MPU6050(GY-521), bldc motor,battery,esc.

    i did next course

    first. i go to multiwii.ino and setting next
    #define QUADX
    #define GY_521
    second. upload my arduino uno board

    this is all that i have to do?

    i find that if i want to use devo7 controller and receiver, i must do binding them. is it right?

    i don’t know exactly what should i do.
    my purpose is upload multiwii source to arduino uno board and control arduino uno copter using devo7 controller.

    • Sergey

      Hey Ken,

      I dont know if the Devo7 will work with the rx701 receiver. I have tested it only with my Turnigy 9x. But generally if they can work together you should bind them. As far as I can remember, you need only to define the quad frame type and MPU, so it should be fine.

      • wow. thank you!

        in Turnigy 9x case, do not need bind?
        i find that someone(http://blender.pe.kr/634) who use arudino uno and multiwii. that person define quad board #define HK_MultiWii_328P. is it wrong? arduino uno don’t need to choice quad board?

        • Sergey

          Every transmitter and receiver need to be bind once. In my case I have done this as I bought it. Yes, you define only the IMU, in your case the GY-521. I should say, that I have only used the Arduino on my quadcopter once for fun. The flight controllers nowadays are so good and easy to configure, so the Arduino is a bit outdated. For example CleanFlight is a 32bit version of MultiWii and works with dozens of flight controllers. I can absolutely recommend CC3D or Naze32. Cost is about 13$.

  7. Murat

    bro its not working everything is ok but my motors are not turning what do you think whats wrong ?

    • Sergey

      And Quadcopter is “Armed” ?

      • Murat

        what does armed mean ?
        i am using arduino uno and 6050 gyro. i edit everything that i should in config h. and i have seen it on multiwiiconfig.exe program. its working my receiver and gyro is working. after i calibrated my esc
        #define ESC_CALIB_CANNOT_FLY
        here and again i did it uncomment and i load to code to arduino. but when i connect my battery motors dont work.

        • Murat

          ok sergey i have found whats mean armed and i did it thank you for everything. its working just it needs calibration :)))

          • Sergey

            No problem 🙂

          • shine

            Hi Murat, I’m shine, I’m a beginner build quad. I’m facing a same problem like you. After I have calibrated, all motor still can’t spin. How do you solve your calibration, please help me!

        • shine

          Hi! I’m a beginner build quadcopter, I use arduino uno R3 and MPU GY-521. I use multiwi 2.4 to upload to arduino board, before I upload its code, I have edit as the instruction of multiwi. After that I run the TX devo7 with multiwiconfig. I saw that Throttle, rudder,aileron, elevator all fine on multiwiconfig test, but when i want to fly, I on the Tx and put the battery on quad that sound beep-beep-beep…. it shows that all motor already to spin, and i set the”arm”, stick the throttle down-right side and elevator down at the same time. I try to stick the throttle up slowly, the 4 motors no spin. Could you explain me how to solve it, sir!

  8. Murat

    hi again Sergey i have one more problem. my motors running at different speeds and my quadx doesnt fly. i have broken 2 propellers 🙂 do you have guess whats problem.Thank you.

    • Sergey

      Hey Murat, you need to calibrate your ESCs. I am not sure how it was with MultiWii, but typically first remove all propellers! Then with battery disconnected, put the throttle stick on your transmitter on 100%. Then plug the battery, the ESCs should beep, then reduce the throttle stick, that is it.

      • Murat

        i did it Sergey but not just one motor is working slower than others 🙂 really i dont know is there anyone who has problem like me.
        do you have advice to fix this problem ?

        • Sergey

          I am not very familiar with the MultiWii GUI, can you test the motors within the Application (always with removed propeller)? If possible they should start spinning at the same time. Overall it sounds like a calibration problem… What ESCs are you using?

  9. ken

    hi.. i come back here..
    um.. i did all. and i have some question

    my esc is bec and i want to power from esc to arduino uno.
    so i connect esc red bec pin to arduino 5v pin? or vin pin?
    a person said arduino 5v pin is output pin and esc bec red pin is output pin. so if i connect both that make some collision between esc red pin(output pin) and arduino 5v pin(output pin). is it right?

    b person said just one esc bec red pin connect arduino 5v pin. because if i connect 4 esc bec red pin to arduino 5v pin, that make problem. is it right??

    i’m very confused..

    i want to know your case.
    how to connect esc bec pin to arduino?

    • Sergey

      Hey Ken, will try to explain it as simple as possible: First look again the picture number 4 in the article. You will see that the red wire from your ESC (read more about the BEC) goes to Vin. Now you Arduino will be powered with 5V, so no need to connect the red wires from the other 3 ESC. The 5V pin on the Arduino is voltage OUT and you use this one to supply 5V for your receiver, look at picture number 3. I hope it is more clear now.

      • ken

        thanks a lot!

        your picture is perfect!

        if another problem occur, i read this article carefully before comment it

        thank you!

  10. Aditya Raj

    I am Android Developer, I am making a Quadcopter with Arduino Uno and uploaded MultiWii_2_4 in it. MultiWii GUI is also working I can see GY-521 MPU6050 response.

    I want to control my Quadcopter fly by Android App, I want to know where I can hook up my Bluetooth HC-06 to Arduino uno and which data should I send by Android app to Bluetooth module in order to control Quadcopter such as for Arming, forward, backward , yaw etc.

    I don’t want to use RC Transmitter and Receiver.
    Please HELP !

    • Sergey

      Hey Aditya, sorry but I am not sure if and how it will be possible to use it without RC transmitter. I have only used Bluetooth control for my Pixhawk flight controller with ArduCopter firmware.

      • Aditya Raj

        Hey Sergey , If I use Transmitter and Receiver then can you tell me which receiver channel pin goes into which Arduino Pin ?
        As you have specified
        Arduino pin 2 – Throttle Channel
        Pin 4 – Roll Channel
        Pin 5 – Pitch Channel
        Pin 6 – Yaw Channel
        But What for Receiver pins ?
        Image is little messy I can’t figure it out which Arduino pin is connected to which Receiver Channel.
        Please specify Receiver Channel pins.

        • Sergey

          Yes, the Arduino Pins are right. Sadly I dont have anymore this FrSky receiver, but I could try using the picture: RX Pin1 – Roll, Pin2 – Pitch, Pin3 – Throttle, Pin4 – Yaw. Note that on some receivers the channels could differ. Cheers, Sergey

  11. Ereyes

    Sup boss. Was wondering if you could give a schematic for the connections between the arduino uno and the multiwii. Thanks un advance,

    • Sergey

      Hey Ereyes, you can find all connections on the pictures, just zoom in. Sergey

  12. sai

    i want to fly this quad using my android phone. can you help me how to do it?

    • Sergey

      Hi Sai, I am not sure if this is possible using the MultiWii firmware. You normally needs a remote controller.

  13. sai

    i have all the parts arduino,frame ,motors ,mpu6050,escs,bluetooth module
    i found this app called ez-gui .i need the changes to be made in the multiwii code
    thanks

    • Sergey

      I suggest you put all the parts together first. Then you can upload the MultiWii firmware to the Arduino board and define the IMU you are using. But better check the MultiWii manual, on their website.

  14. Varun Kumthekar

    Hi Sergey,
    I am using Multiwii 2.4 on Arduino Mega 2560. I am unable to see the readings from the RC module on the GUI. Sensor output is ok, but the rc readings do not appear. I am using Avionics RCB 6i transmitter and 6 channel rz6 receiver. The RC module is working, i have tested it on a different arduino code. Can you help me out with this

    Thanks
    Varun

    • Sergey

      Hey Varun,

      Have you defined it right in the code. Are you sure the receiver is powered from the arduino?

      Cheers, Sergey

      • Varun Kumthekar

        Yes Sergey the receiver is powered using the 5v from arduino. I am not sure about the code though, do i need to make any changes there? I assume that this is a typical receiver.

        • Sergey

          Hey Varun, as far as I remember you need to define the receiver type, for example my FrSky receiver is a PPM receiver. Yours should be normal PWM, but maybe you need to define the channels configuration. You can check the MultiWii manual for that. But in general, it should work.

  15. Dimitri

    Hi Sergey,
    Every think is ok in multiwiiconf (IMU and RC), but my rotors dont spin !
    i tried to arm the motors with TX yaw as defind in the code, but nothing happend…

    what do you think, any idea ?
    Thankx

    • Sergey

      Hey Dimitri, make sure your YAW is not reversed. Is the connection to the battery ok? Check if there is any safety feature enabled, that prevents the board from arming, for example if the board is not leveled. These are my ideas for now. Cheers, Sergey

      • Dimitri

        Well, i verified all of this solutions before, but the issue was another thing:
        the constant “MINCHECK” in multiwii.ino was set by default to 1100, i set it to 1120…and ABRACADABRA it works.
        Thankx Bro

        • Sergey

          Great! I have forgot about that one 🙂 Best, Sergey

  16. Ankur Sharma

    Can we control quad with android and pc…?

    • Sergey

      In theory yes, but I cant help you anymore with the implementation.

    • Aditya Raj

      Hey Ankur, Are you using MultiWii or your own code ? I am also on the same project, I have written the Arduino code by my own using PID library and made Android app to control by Bluetooth, but due to weight unbalance i am still not able to hover. How far you have gone ? please share.

      • Sergey

        Hey Aditya, this is very interesting. Would love to see some pics or video of it working. Best wishes, Sergey

  17. stefano11

    Hello,
    I see the last photo attached a blue wire and an orange in the receiver, where they are connected?
    In d4 of Arduino the white wire where should be connected?

    • stefano11

      Hi,
      ok, the d4 you have connected to channel 1 of the receiver.
      Can you reply me for the first question.

      • Sergey

        Hey Stefano, the are not connected. It was my receiver that I have used with the MegaPirate NG flight controller and I forgot to remove these. For a basic control you only need 4CH. Best wishes, Sergey

  18. Rahul

    Hi Sergey,
    I have arduino uno and imu mpu6050 and all other components to build this quad. I have already connected all the hardwares.
    I am a beginner in all this. So will you please explain in steps what changes i have to make in the multiwii 2.4 code to make my quad in the air ?

    • Sergey

      Hey Rahul, as far as I remember you only need to define that you are using the MPU6050, the type of your receiver and the type of your quadcopter (quad X). Cheers, Sergey

      • Rahul

        Hi,
        I have slected option quad x, Now there are several options for selecting flight controller and receivers, could you please be more specific ?
        I am having arduino uno + mpu6050 + FS-CT6B Tx & Rx

        • Sergey

          Hi, not sure anymore Rahul, but you need to define the mpu6050 where you define the flight controller. I havent done this since 2… I decided to go for a 32bit flight controller and closed this Arduino project. Anyway, the receiver should be PWM, you need to play a bit with the right order of the channels, so left is left, right is right and so on. Best, Sergey

  19. Ali

    Is it possible that test it without connecting radio control in the first steps?

    • Sergey

      Hey, if you mean flying it, I guess – the answer is no. Best, Sergey

  20. Ali

    Hello, I try your hardware connections and imu worked truly but motors don’t start.Should we connect rc channels to analog pins of arduino uno?

    • Sergey

      Hey, I think you need the RC Channels in order to start the motors. Connect these as shown in the article. Best, Sergey

      • Ali

        No, I have connect rc channels but it does not work.I think maybe my multiwii code couldn’t support arduino uno.it is multiwii_2_4.What is your idea?

        • Sergey

          It should work. Do you arm the copter before trying to start the motors? Please always remove the propeller while testing.

  21. Ali

    And about my hardwares, I have checked them with a ready quadrotor with naza flight controller and its worked truly.my rc is devo 7 and motors are 2213/920kv(rctigermotors).speed control s are EMAX 35Aand imu is gy_87.

    • Sergey

      Hm, have you defined the IMU in the MultiWii code?

      • Ali

        Yes, I defined the IMU and copter type(quad x).Maybe the problem was the result of disconnection in wiring.I will check it and then report the result for you.thank you for your guides.

  22. Ali Fazli

    Hi again, I’ve checked my hardware connections and it’s true and we have result from IMU and RC channels on multiwiiconfig i.e for example throttle changes had be shown in it. The problem maybe is with arming, although I’ve define in my code arm-disarm part. what’s your opinion about it?

  23. Ali Fazli

    yes, it work. the problem was adjustment of RC transmitter and enabling of arm. It solved!

  24. Baran yeni

    Hi sergey.. I’m turkish people in turkey. Can you help me ? I want make a remote with nRF24L01 can I make or who do this project?

    • Sergey

      Hey Baran, sorry but cant help you with the nRF24L01, I have never used it. Best, Sergey

      • Baran yeni

        I want give you mine (-) hahaha I like you and your text good work

  25. Mikkel Bachmann

    hi.
    I wanted to hear if you have any experience during the same thing with an arduino 101

    • Sergey

      Hey Mikkel, sorry I havent used it. Best wishes, Sergey

  26. Hi,
    I have a problem. Once everything is connected and charge MultiWii of Arduino,the engines all turn and constant speed regardless of the throttle.
    If I try the esc and motors individually to the radio control function regularly.
    I also run the calibration procedure esc uncommenting the constant.
    My esc are mr.rcsimon series 30 A.

    Have you any suggestions?

    • Sergey

      Maybe for some reason the calibration goes wrong or the ESC forget the calibration.

  27. Baran yeni

    Hi sergey I’m baran. Do you remember me ? When I ask “Can I do these with Nrf24L01 LNA+PA” you say “I don’t know, I don’t use it” . So I bought rc remote on hobbyking (hobbyking 6 ch 2.4ghz mode 2 remote). I did everything all the connect is correct 🙂 but when I try fly QuadCopter is haven’t good returns. When I throtle stick pull to right it isn’t arming . But when I open or off right stick somehow it is arming and start spinning the motors. But its uncontrolled spinning. When I pull down the tgrottle stick they are not cut the spinnig. Huh what can I do..

    • Sergey

      Hey Baran, maybe your problem is that the channels of the transmitter are reversed. You need to check in the MultiWii GUI, that when you move the sticks they move corresponding to your movements. Spinning the motors when armed is an option in MultiWii, so when you arm the motors will start to rotate at a slow speed. You also maybe need to calibrate the ESCs. Cheers, Sergey

      • Baran yeni

        Thanks Sergey, How I can calibrate the ESC’s ? Your thing’s is sensible for me. Take care I like your works 🙂

        • Baran yeni

          And when I look at the pc’s monitor the remotes values is true but quadcopter is false

          • Sergey

            Then check you have the right orientation of the sensor board.

        • Sergey

          I dont know how to calibrate all the ESC at once in MultiWii, but you can calibrate these one after another by connecting every ESC to the transmitter (motor without prop!), put the throttle stick of your transmitter to max, connect battery to power ESC and when you hear the sound put throttle to min.