Quadcopter with Arduino Uno running MultiWii
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.
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.
Thank you for reading! Follow DroneHiTech on Facebook and stay tuned for more drone news, reviews and tutorials.
The IMU, must be fixed just in the middle of frame? or it can be fixed in elsewhere?
Hi Daniel, it is better to be fixed somewhere in the middle.
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.
No, it is not. That is my MegaPirate AIO flight controller, which was unplugged but still mounted.
Thanks too much Sergey.
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.
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!
Thank you very much for your kindness. I’ll try again with your instructions. Thanks again.
No problem, Daniel. Waiting to see it in the air 🙂
Pls, Can You Help me with Your Code. Plsssss
Hi, whats exactly your problem with the code? Can you describe it?
Syed Ragibul Haque
What’s the matter with the source code ? There are few variables which were not declared. During compiling it shows errors. I sent the picture to the messneger of your facebook page.
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
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.
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?
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$.
bro its not working everything is ok but my motors are not turning what do you think whats wrong ?
And Quadcopter is “Armed” ?
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
here and again i did it uncomment and i load to code to arduino. but when i connect my battery motors dont work.
ok sergey i have found whats mean armed and i did it thank you for everything. its working just it needs calibration :)))
No problem 🙂
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!
Bro how did u calibrate the esc’s..plz help
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!
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.
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.
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 ?
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?
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?
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.
thanks a lot!
your picture is perfect!
if another problem occur, i read this article carefully before comment it
No problem, Ken 😉
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 !
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.
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.
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
Sup boss. Was wondering if you could give a schematic for the connections between the arduino uno and the multiwii. Thanks un advance,
Hey Ereyes, you can find all connections on the pictures, just zoom in. Sergey
i want to fly this quad using my android phone. can you help me how to do it?
Hi Sai, I am not sure if this is possible using the MultiWii firmware. You normally needs a remote controller.
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
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.
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
Have you defined it right in the code. Are you sure the receiver is powered from the arduino?
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.
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.
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 ?
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
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.
Great! I have forgot about that one 🙂 Best, Sergey
Can we control quad with android and pc…?
In theory yes, but I cant help you anymore with the implementation.
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.
Hey Aditya, this is very interesting. Would love to see some pics or video of it working. Best wishes, Sergey
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?
ok, the d4 you have connected to channel 1 of the receiver.
Can you reply me for the first question.
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
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 ?
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
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
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
Is it possible that test it without connecting radio control in the first steps?
Hey, if you mean flying it, I guess – the answer is no. Best, Sergey
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?
Hey, I think you need the RC Channels in order to start the motors. Connect these as shown in the article. Best, Sergey
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?
It should work. Do you arm the copter before trying to start the motors? Please always remove the propeller while testing.
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.
Hm, have you defined the IMU in the MultiWii code?
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.
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?
yes, it work. the problem was adjustment of RC transmitter and enabling of arm. It solved!
Great! Happy flying.
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?
Hey Baran, sorry but cant help you with the nRF24L01, I have never used it. Best, Sergey
I want give you mine (-) hahaha I like you and your text good work
I wanted to hear if you have any experience during the same thing with an arduino 101
Hey Mikkel, sorry I havent used it. Best wishes, Sergey
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?
Maybe for some reason the calibration goes wrong or the ESC forget the calibration.
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..
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
Thanks Sergey, How I can calibrate the ESC’s ? Your thing’s is sensible for me. Take care I like your works 🙂
And when I look at the pc’s monitor the remotes values is true but quadcopter is false
Then check you have the right orientation of the sensor board.
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.
I am having problem compiling the program. Need your help..
Hi Kedean, can you please be more specific, so someone can find how to solve your problem. Best, Sergey
I have been trying to upload the code to my Arduino board and it continuously saying that there is a error within the code. I have tried everything that I know about programming but it just wont work.
Arduino: 1.6.8 (Windows 10), Board:
WARNING: Spurious .github folder in ‘Adafruit Motor Shield library’ library
In file included from sketch\Alarms.cpp:3:0:
def.h:1960: error: #error “NUMBER_MOTOR is not set, most likely you have not defined any type of multicopter”
#error “NUMBER_MOTOR is not set, most likely you have not defined any type of multicopter”
exit status 1
#error “NUMBER_MOTOR is not set, most likely you have not defined any type of multicopter”
Hi Kedean, you may need to define the type of the multicopter: quad, hexa, octo etc. Best
Hi can anyone plz guide me in starting my quadcopter
Assembling of quad and connections is done as shown in above picture
There is no response of the motors with futaba tx 2.4 ghz, even after flashing the multiwii code
Im using arduino uno board, GY 521
Hey Rishab, are you sure you have configured the transmitter and the respective channels, so you can “ARM” your copter. Please always test without propellers first! Safety, safety, safety! Cheers, Sergey
How to config the transmitter and with what?
Read the manual file and check in the config file of MultiWii, cant remember anymore exactly. Best
Hi sir, a receiver with aux port should be used or normal 4ch receiver can be used?
And im using FM radio
Now the motors are starting, but the problem is all 4 motors dont spin simultaneously plz help me
Hi Rishab, normal 4CH receiver should be ok. You need to do perform an “ESC calibration” for the motors to spin simultaneously. Remove all propellers!!!, disconnect your drone battery, turn your transmitter, put the throttle stick to max, connect the battery to your quadcopter, wait a second to hear the specific sound of the ESC and put the throttle to minimum. Disconnect and reconnect your battery and you should be good to go 😉 Best, Sergey
Sir can u plz help in.libary and the code sir send me this in.my mail email@example.com please sir
Hi Sourav, you can download everything from the MultiWii respository/website.
Vu Duy Dat
please send me a circuit of quadcopter with arduino and mpu6050
Hello Vu Duy Dat, nowadays there are much better and easier options to make a DIY quadcopter. Check out this guide on some of the best flight controllers: http://dronehitech.com/en/cleanflight-best-flight-controllers/ Cheers, Sergey
Hello I’m am very new. How exactly can I arm the motor if in the multuwii 2.4.
It should be the throttle stick down + right for about 3sec.
hi sergey i have a doubt about esc’s you have given GND and 5v to esc 1 only and others esc’s are not linked with Gn and 5v. please help me about this. thank you
Hi, you need only one 5V from one of the ESCs, as you only need one to power the flight controller/arduino with 5V. GND is also not 100% needed. Cheers
I’m building same quadricopter with arduino uno rev 3, imu gy 86 but after programming my arduino uno with all configuration in multiwii conf the motor not arming.
can you help me?
Hello Paolo, have you setup your transmitter corrctly, so once you put the throttle stick down and right, the motors will be armed? Also is the copter leveled once trying to arm?
Can u please post codes for this connection
Hello Karthick, I am sorry but I don´t have the code anymore for this copter configuration. Please check some of the other MultiWii based flight controllers, which are way easy to configure. Best wishes, Sergey
hey there , i m looking for a video for complete connection of arduino uno, 30A esc board ,gyro, kk2 board and reciever. can you send me the video at my email id.
Syed Ragibul Haque
I have downloaded your multiwii and it has been unzipped. When I have compiled, it has shown that some variables are not declared. There is no multiwii manual. How can I solve this problem? Please help me and reply as soon as possible. I’m waiting for your help.
Syed Ragibul Haque
naseef Ali PV
The code need to install any other libraries like gyro or multiwii to arduino? When I click start on multiwii then the multiwii window is closed.what the problem.?
What is the way for esc.
Where is esc 1 (front left, front right,back right,back left)
can you write me all ways?
Hello Soner, on a standard X-configuration usually ESC1 & 2 are on the right and 3 & 4 on the left. Depends on the MultiWii code if ESC1 is right front or right back. The info should be available on the MultiWii website. Best, Sergey