Self-Leveling Arduino Quadcopter

by 747564 in Circuits > Arduino

1193 Views, 7 Favorites, 0 Comments

Self-Leveling Arduino Quadcopter

20220131_174808.jpg

This is an Arduino-based drone tutorial that covers the hardware details, construction, and software. Please read the whole tutorial before attempting this project.

Supplies

Screenshot 2022-02-01 005347.png

Brushless Motor 920kv+ (4)

20A ESC (4)

Propellers (4)

Quadcomputer Frame

Radio Transmitter and Receiver

2200mAh 3S 11.1V Battery

ITG/MPU6050

Arduino Uno

Red LED

330Ω resistor

D1 diode 1N4001

1.5kΩ resistor

1kΩ resistor

Main Body

20211230_173342.jpg

Just assemble your chosen frame and make sure that everything is symmetrical. The frame should be in either a cross or plus shape also this ensures equal distance from each motor so the propellors do not interfere with each other.

When the motors and ESCs have been mounted on the frame, connect all the negative and positive wires using a soldering iron.

Mounting Components for the Circuit

20220112_004614.jpg

Now we can start with mounting some important components to the frame. The radio receiver (the green and black box) can be placed anywhere, making sure its antennas are taped down. The MPU-6050 (blue circuited board) should be placed on 3M double-sided tape or a spongey material to help absorb vibrations so the gyro is more reliable. Placing these components like this gives us space to mount the Arduino Uno in the middle of the board which makes all the connections shorter.

Completing the Circuit

20220111_215118.jpg

Using the semantic above, complete the circuit making sure all the digital pins are connected accordingly in the right order. When wiring the Arduino, make sure the Arduino's "Vin" only comes from the lipo battery and the battery eliminator cruciate found on the ESCs.

Check Motor Directions

prop-x.jpg

Depending on what type of shape you decided to use, config your motors to spin in that direction. To change the direction of the motors you simply have to change the position of ANY 2 of the 3 connectors of the motor to the ESC.

Calibrate Your ESCs

Calibration is important because without this step your ESC's will not start as the time with the given same throttle signal. First, upload the flowing code to the Arduino so that the Arduino knows what is the total input and what the are ESC outputs. To program your ESCs you first need to turn on your transmitter and set the throttle to max, then connect the battery to the quadcopter after which you will hear beeping. After the beeping has stopped put the throttle to the lowest position which will set the same "endpoints" for the motors.

Downloads

Just Upload the Code

I've worked on the code for weeks and after doing a bunch of testing everything works as intended, I didn't write all of the code as a lot of it was new to me. I used Joop Brokking's Code (YMFC-AL) as a reference when making mine which I'll add here.

Next Steps

Instead of using the cheap MPU 6050, you should heavily consider using the L3G4200D gyro instead as it doesn't suffer from the same gyro drift problems. you should also get 30A ESCs from DJI as they offer quicker response times.