Introduction: DIY ARDUINO FLIGHT CONTROLLER

Picture of DIY ARDUINO FLIGHT CONTROLLER

Lets build an Arduino based flight controller that can do wireless PID tuning, Orientation lock and altitude hold and position lock with the help of A GPS. Ok So this DIY flight controller is an educational Arduino based module. It's simple to make, easy to program and is a great project for experienced hobbyist like me. The program is open source and easy to configure.

This Flight controller will have features like those of NAZA and APM the only difference here is the PID wherein you will need to be patient in getting your drone tuned. To make tuning easier I included a Bluetooth module to ease the tuning step with out the use of your computer.

NOTES ABOUT THE BUILD

You Will learn how to fabricate PCB's! Always check your connection.

Why make one?

Because, It is cheaper and you will understand how the flight controller works. And using your extra sensors you can make good use of it.

DIY vs Branded

The answer is Branded or at least the clone, because DIY will to a bulkier flight controller, compared to a 16$-32$ flight controller which is smaller and easier to use just like the Naze 32

Total cost?

I guess I'll cost this by the amount I've spent this week for this project only

1x pre-synthesized PCB 6x6cm almost 1.8$ here in the Philippines

3x 1mm Drill bit $1

1x Gizduino Mini $8.58 Or "Arduino Nanov3"

2x Pinheaders 1$

TOTAL 12.38$

--------------------------------------

Proceed to the next step for more price info

Step 1: Parts and Materials

Picture of Parts and Materials

As I started arduino 3 years ago I guess I've piled up some extra sensors such as the MPU6050 , BMP180, and the HMC5883L now getting frustrated of my old Flight controller for my quadcopter I decided to make my own similar to those of MULTIWII "CRIUS SE"

So here are the main parts

An Arduino mini.... or something similar like mine from our local electronics shop exclusive on in the Philippines

I got these sensors for 22.31$ only! 03/15/16 update~ "It is way cheaper nowadays"

1x MPU6050

1xBMP180 or 085

1x HMC5883L

--- 10 DOF IMUMPU6050 + HMC5883L + MS5611----- best price~

_______________________________

1x Bluetooth module HC 05 or HC02

1x TTL converter such as the FTDI programmer module

2x Pin headers 1x40

1x pre synthesized PCB 6x6cm

A lot of female to female wires~

TOOLS and Chemicals FOR PCB fabcrication

Mini Drill

1mm Drill bit

Ferric Chloride

Developer Solution

BABY OIL

Exposure lamp or 10W florescent lamp

2x small Glass Plates "see through"

2x Containers big enough for the PCB and chemicals


Step 2: Understand the Connection

Picture of Understand the Connection

Important pins to enable Sensor communication the I2C pins "A4 asSDA" and A5 as "SCL"

As you connect your sensors you will need to connect each pin to the same pin on the arduino mini

Example "Sensor SDA" to "ARduino SDA A4" ... then Sensor SCL to Arduino SCL

Easy right? Just remember All sensors must connect all of their SDA and SCL pins to the proper terminals on the arduino mini

______________________________________________________________________________________________

To enable Motors~

D3 for the 1st motor

D10 for the 2nd motor

D9 for the 3rd Motor

and D11 for the 4th motor

______________________________________________________________________________________________

To enable controller inputs

THR D2

(ROLL) AIL D4

(PITCH) ELE D5

(YAW) RUD D6

AUX1 D7

AUX2 D12 (optional)

______________________________________________________________________________________________

POWER~

Do not use 7805 regulators USE a 5V UBEC

UBEC is an efficient Voltage regulator that can handle more than 7805

Connect the + and - to the respective terminals on the arduino board.

Step 3: Redesign the PCB If You'd Like

Picture of Redesign the PCB If You'd Like

Download the RaR file and open up your eagle CAD if you are using a Legit Arduino mini cuz you will need to redesign the connection

If you live in the Philippines and you have the same parts just like mine feel free to skip this step.

NOTE for your MPU6050

Y AXIS is your forward direction!

Step 4: PCB Fabrication First

Picture of PCB Fabrication First

To Tell you the truth this is not the hard part of this build its actually easy as long as you follow the steps.

Prepare the following

Print out the PDF in HIGH Quality

Prepare the baby OIL

Prepare pre synthesized PCB 6x6cm

Prepare a container filled with ferric Chloride

Prepare a container with developer powder ... 3 tsp developer 1cup tap water (agitate until the powder dissolved)

Prepare 10 Florescent lamps

______________________________________________________________________________________________

Lets start!

1.Cut out the PCB layout and apply a small amount of baby oil and gently spread the fluid around the paper.next gently remove any excess baby oil by wiping it with any cloth

2.Get your pre synthesized PCB 6x6cm, Remove the film and place the print side of the paper facing the green side of the PCB "that is important". Get your glass plate and stack the PCB and paper in between.

3.Get your florescent lamp and Elevate by at least 3 inch

4.Get your Phone-> clock and then Timer... Set it to 5 minutes

5. Place the GLass plate with the PCB under the Florescent lamp and immediately turn on the time and the lamp..Turn the lamp of as your phone rings.

6. Remove the glass and the paper go to the sink and run the exposed PCB with running water make sure the oil is removed.

7. Get your container with the developer solution dip the whole PCB "Copper side facing you" and agitate untill the ink is removed

8. Rinse the PCB again with water to remove the developer solution on it

9. Get your Container with Ferric Chloride and dip the PCB until unwanted copper is removed.

10. DONE!! all you have to do now is to drill the holes.

Step 5: PCB Done Whats Next?

Picture of PCB Done Whats Next?

Get your soldering Iron and start assembling duhh....

Step 6: Casing

Picture of Casing

Now printing a casing is highly suggested because your barometer sensor is sensitive to external factors like air and temperature.

1 Print a casing

2 Cut a small sponge and glue it near the Barometer sensor "do not glue the barometer sensor as is" apply hot glue on the sides only just to make the sponge act as a filter.

Step 7: Lets Start Testing!

Picture of Lets Start Testing!

Connect the following onto the flight controller. The HMC5883L, TTL converter, and might as well connect the wire to the receiver module.

To start initial testing connect your FC to your computer.... the Arduino mini should light up as well as the MPU 6050 after that its time download some stuff over the internet.

Multiwii arduino program and and Multiwii Config

And the latest ARDUINO IDE which you probably have.

1. Open the Multiwii.ino inside the Multiwii Folder once done go to the tabs within the arduino program and go to "config.h" this is where you will start

2. Scroll down and follow through from //#define QUADX to "#define QUADX only" removing the "//" uncomments the line

3. scroll down and uncomment #define MINTHROTTLE 1064 if you are using SimonK ESC and add // to the default setting which is #define MINTHROTTLE 1150 // (*) (**)

4. scroll down a little #define MAXTHROTTLE 2000

5. #define I2C_SPEED 400000L

6. Combined IMU Boards -> uncomment //#define GY_521 to #define GY_521

7 sroll down I2C barometer and uncomment //#define BMP085 to #define BMP085

8. I2C magnetometer uncomment //#define HMC5883 to #define HMC5883

9. Once done Go to Arduino Tools on the upper left -> Board -> Duemilanove or UNO depends on your arduino MCU.

10. Tools and then set your port where the Flight controller is connected.

11. UPLOAD!

Step 8: MULTIWII

Picture of MULTIWII

Now that you are done uploading its time to use the Multiwii GUI

Open the MultiwiiConf folder

application.windows32 for Windows 64bit or 32bit do not use the application.windows64 since it is not working

Open MultiWiiConf.exe

1.select com port where the flight controller is connected and click on "start"

after that it should now have readings .

2. To make the dashboard move calibrate the Acc first by putting your FLight controller on a flat surface and hit the calibrate ACC leave it for 10 seconds or so and then calibrate your Magnetometers, After clicking CALIB_MAG you are given 30 sec to rotate your Flight controller in all axis make sure it reaches 360 rotation.

3. Once done explore the GUI and proceed to the next step.

Step 9: Replace That Old Flight Controller

Picture of Replace That Old Flight Controller

Let lessen the detail and just get to the point here

Replace your old flight controller in my case CC3D

Install your DIY Flight controller

Position your Magnetometer somewhere on the frame wherein its not affected by the motors or battery.

For Bluetooth Programming replace the FTDI programmer with an HC 05 or HC 02 Bluetooth module Note that some BLuetooth modules need to be reconfigured to 115K baud for it to work

Step 10: Program Your Drone With Your Phone!

Picture of Program Your Drone With Your Phone!

Wireless programming~

Programming with a Wire sucks lets go to the next level which is a lot better

Download this on your android phone

For apple devices try looking for some multiwii programs because I have no idea about apple~

This app is very useful, It eliminates all the drag of bringing a laptop and tuning it on the field and then testing the values all over and over again through a "cable and a laptop" ..that sucks. So here I wish you a safe flight and have nice day!

BTW For me the hardest part to tune here is the barometer or ALT HOLD PID nonetheless everything can be search through Youtube and Google for PID tuning tips and tutorials.

Step 11: Go FLY!

Fly safe guys dont fly your drones on streets or crowded areas, Tune your drone on an open area like a soccer field or something.

Step 12: Video~

commin right up

Comments

payammm (author)2017-08-14

:||||||||| hi

I did all of this but I don't know how to start (run) the motors

I'm using bluetooth and android

SandyS39 made it! (author)2017-04-14

hi, can you help me fly this thing? FC's ready, i don't know what to do after mag's calibration. I 've tried hitting "write" in GUI, unplugged the usb (i used nano v3) powered with Li-Po and tried stupid stick combinations (since i don't know how to arm ;D) and the escs never responded.

Please reply ASAP......

SandyS39 (author)SandyS392017-04-15

figured how to arm, the motors are responding good with respective to the sticks (channels), but i don't know how to tun pid etc, the motors are not responding at same time (at same throttle stick position) one motor starts at a point and the i keep increasing the throttle the rest of the motors start one by one

SamannoyG (author)SandyS392017-08-01

Try to calibrate the escs together with your throttle.Research on esc calibration and it might help.

PhongP10 (author)SandyS392017-06-16

The reason your motors don't start at the same time is that you haven't calibrate your throttle properly, do a research about this and you'll know how to fix it.

Hope I helped!

Phong T. Phan

ReedN2 (author)2017-01-28

Hi everyone,

Please give me the schematic of connector from Arduino to MPU6050,
BMP180, HMC5883L

OmarC76 (author)2017-01-20

What ttl do you use? I am following your guide and is the last piece that I have to buy

VIPIN T (author)2017-01-17

sir, here where u used the hc-05 bluetooth module in the connection diagram

VIPIN T (author)2017-01-16

sir is it possible in arduino Atmega 328

finalfighter (author)2016-12-12

Hi, is it possible to use a breadboard in place of the pcb for prototyping (assuming the drone is super powerful can carry the breadboard)?

treyes4 (author)finalfighter2016-12-14

it is possible, just make sure everything is secured "absolutely secured"

tejas07 (author)2016-12-04

Sir can this have altitude hold function

ThiênT13 (author)2016-10-13

here is air remote control with your smart phone right?

TrungN49 (author)ThiênT132016-10-24

Mail lại cho mình dc k bạn curly.saigonese@gmail.com

ShawnT44 (author)2016-10-22

Hey treyes4, thanks for the instructable, this is a very cool build and I think I may try and do something similar. I noticed the 3D printed case, have you provided the STL file for that design anywhere? If so I would be very interested in printing that out myself. Thanks

HasanY13 (author)2016-10-18

Hi, I have arduino based apm 2.8 flight controller.Onboard MPU6000 Gyro sensor not work.how can I use external Gyro board mpu6050 or others?

ThiênT13 (author)2016-10-13

Who did, then please give me specific guidance

ThiênT13 (author)ThiênT132016-10-15

ducthien20021995@gmail.com

help me in detail with

HamzaM32 (author)2016-09-15

hey guys can I use GSM module for wideing its range for its flight. As I need to make the quadcopter autonomous so we can give coordinates from phone and it goes there and makes the video of the area below it.

treyes4 (author)HamzaM322016-09-21

It is possible but I don't suggest you trying that since you are going to use this for Autonomous flight. Which is risky and might cause harm to the hobby if something goes wrong. With that you will probably need an APM flight controller.

HamzaM32 (author)treyes42016-09-21

So can you guide as from where I should start and which micro controller I should use as I am really new to this thing and its basically my final year project at university.

VikramS61 (author)2016-09-19

hey please can you help me whether i can use the bmp180 instead of bmp085

WahW1 (author)2016-04-04

if i m using Arduino Nano/Uno, how to connect the Bluetooth?

Smith John (author)WahW12016-05-19

pls how to made arduino uno for drone with bluetooth ; all file and arduino program.pls show me.

I think u jst need to figure out the pin confic as pro mini n uno uses same 328P

YashasR3 (author)2016-09-02

Can i add the GPS L80 to it?

ErSergio (author)2016-05-09

So, come on guys, if I am here, is because I don't have cash and I don't can pay for wiew your pdf! Are you bad, guys?

I am registered for download the pdf, and after the registration I have read that I must pay 50 dollars?!?!?! but guys?!?!?!?!?

For the little part that I can see, seems a good work but.... It's a bad and wrong thinks (free already pdf, please).......

pmurp1988 (author)ErSergio2016-08-08

just click the link for ether the rar or the pdf just a bit down the page from the picture of it its free no need to pay anything

tankapotamus (author)ErSergio2016-05-11

WTF are you talking about? The pdf is just a copy of the webpage you are already looking at. everything is already available for free, the pdf is just to download the instructable for offline viewing. Just screenshot it if you are that poor!

Kt6 (author)2016-02-12

Hi treyes4, I wonder that can I use 10 DOF IMU Sensor in order to replace the all of the sensors you indicate.If I can, could you plase tell me what to add or change in the multiwii code configuration and where to connect pins on the arduino mega/uno

Regards,

Here is the link of 10DOF-IMU http://www.waveshare.com/10-dof-imu-sensor-b.htm

a1m918 (author)Kt62016-07-24

Hi Kt6 !

I have the same sensor too. Do you have library of this sensor for Arduino ? I searched a lot but did not find anywhere. I have its stock library but unfortunately I dont know how to compile that with Arduino.

Kindly can you help me ?.

wswu (author)2016-04-24

I want to develop an App to test each motor through bluetooth, how can I start only one of the four motors each time?

MehmetE3 (author)2016-04-24

Did you use ESC( elektronik speed controller)?

denarubiyana24 (author)2016-04-22

Hey dude,

can u share to me source code flight controlller using a mpu6050?

JohnbryanO (author)2016-04-18

Pareng Treyes4, taga pilipinas din ako. salamat dito sa post mo ang laki ng tulong. Pero ask ko lang yung about sa Position hold (GPS) kelan kaya lalabas yon ? :) thanks bro.

FikriY2 (author)2016-04-11

hay sir can use TTL converter PL2303 ?

damu619 (author)2016-04-09

the following is the error I am getting when I try to upload

please help me with it treyes4

Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\damu\AppData\Local\Temp\build18491610cf751e556b2ffeb7956fae43.tmp/core\core.a(main.cpp.o): In function `main':

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:37: undefined reference to `setup'

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:47: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

Danielx2 (author)2016-04-07

thank you

MikeeM4 (author)2016-03-07

If I'm to use the ARDUINO UNO ATMEGA328, do I still need the TTL converter?

tobimai (author)MikeeM42016-03-17

If your Arduino has a USB port you don't need the TLL converter

MikeeM4 (author)tobimai2016-03-18

Noted. Thanks.

ThắngP7 (author)2016-03-11

why you don't use wifi module ?

RyanB138 (author)2016-02-21

Thanks for a good starting off point. I will try to get something in the air.

jootieno (author)2016-02-13

when is the video coming out

1anton23 (author)2016-02-03

Hi im having trouble hooking up the sensors to the arduino. All three sensors has to be hooked up to 3 different SDAs and SCLs corrrect? Could I use the the Arduino mini 328 for this project?

Destiny_Child (author)2016-01-24

Hi, I'm having trouble editing the PCB layout to make it fit the Arduino Pro Mini. Please could someone help. (I have eagle cad and I have opened the file but I don't know what I need to do to it)

treyes4 (author)Destiny_Child2016-01-25

Hard to explain... better do some youtube tutorial for eagleCad ;)

Steezceres (author)2016-01-18

Can i use the GY-87 board that has all three sensor built into it or do i have to get all three separately ?

MasterYi (author)2015-09-30

Dear treyes4, your project is really cool and i like it,but i have some questions.I dont understand 7. step i mean the picture is not clear,so can you explain me the picture.Is the red cicruti board TTL converter? What is the small blue box next to big blue box?

What is the Black Cable on the left edge of the blue box? Can you help me how to put Bluetooth?

Vasuchhabra made it! (author)MasterYi2016-01-13

See the image.

About This Instructable

572,102views

710favorites

License:

Bio: Hello There! My name is Timothy and I am 18 years old and I love biking, Rc, arduino ,gadget hacking and 3D designing. I'm ... More »
More by treyes4:DIY Jigsaw Lamp 3D Printed Xiaomi FPV Camera saver [ExoYi] Indoor FPV Drone [Setup,Design and 3D Printing]
Add instructable to: