Home > Industry Application >Security Aviation Circuits > How to build a self-driving drone

How to build a self-driving drone

Source: InternetPublisher:newrudeman Keywords: sensors drones autonomous driving Updated: 2024/02/02

Arduino Uno autonomous drone with multiple sensors and a wireless camera controlled by two microcontrollers.

Usually we see drones controlled using RF remote controllers or autopilots that use a GPS module to automatically control the drone by giving the correct direction. But in my project, I use Arduino Uno to handle things in another way.

The main goal of the project is to collect data and 2D video information from a specific known area. In order to get the information, we have to program using Arduino to assign the length and width values ​​that the drone can travel.

As the name suggests, autopilot means that the drone will be controlled by itself, and the control actions of the drone will be handled by a flight controller with built-in sensors to balance the drone. The Arduino Uno is the brains of the system and provides the correct signals to the flight controller. To maintain stability and continuous operation, I use an OpenPilot CC3D microcontroller (or any flight controller) along with a camera to capture real-time data via weather monitoring sensors. Finally, the system includes a Bluetooth module for turning off/off the drone and displaying real-time data using an Android mobile device.

Supplies

Bluetooth low energy (BLE) module (general) × 1

Arduino UNO×1

Flight controller (CC3D) × 1

DHT11 temperature and humidity sensor (4-pin) × 1

Drone frame, ESC, battery 11.1V, brushless DC motor × 1

We know that arduino Uno is an Atmega Micro controller. Here, I generated PWM signal to control the drone.

We know that arduino Uno is an Atmega Micro controller. Here, I generated PWM signal to control the drone.

CC3D flight controller:

As we can see in the image above, it shows the flight controller with built-in gyro and accelerometer controllers as well as auto-leveling capabilities.

But these microcontroller companies provide their own software to program them and are user friendly.

These microcontrollers require a PWM signal as input to control each BLDC motor. These signals will be generated by arduino uno.

Drone design type

As you can see above there are two types of drone designs available for quad format drones depending on the direction you place the flight controllers you can choose quad format

The direction indication will be printed according to the selected flight controller, for the selected format the propeller direction is also most important, CW (Clockwise) and CCW (Counter Clockwise).

ESC connection

clockwise

Clockwise we need to connect the wires as shown in the picture above

Counterclockwise

For the counterclockwise direction we need to swap any two wires in order to apply the phase of the voltage to the motor and thus change the direction of the motor

Motor-ESC-Flight controller connection

ESC control connection

ESC control connection

The ESC also has 3 wires and 2 power cords,

These 3 wires have VCC, GROUND and INPUT SIGNAL pins and get data from the FLIGHT CONTROLLER to rotate the BLDC motor.

The other 2 wires are higher current rated power wires so use thicker wires, these are common to batteries.

Final wiring diagram using ARDUINO UNO

Final wiring diagram using ARDUINO UNO

Here, I used UART protocol but no data is converted from parallel to serial. In terms of delay, direct PWM signal is applied from arduino to CC3d.

Mobile Applications

The above snapshot shows an android application built using the open source website mentioned below. Using this app we can turn the drone on and off. And there's another feature that allows us to get sensor data in a serial window, and that's the phone.

buttons

Start: This button will start the microcontroller (CC3D flight control)

mov : This makes the drone fly and perform the actions programmed inside the arduino Uno

Stop: This is the emergency stop button to shut down the drone (since autonomous drones do not have a remote control, an extra button is provided)

Start sensor: When pressed, sensor data will be displayed on a white screen, as shown below

sensor data

We can see in the picture that when the start sensor button is pressed the values ​​will be displayed for temperature and humidity.

Schematic diagram

1. Bluetooth module interface

Here we use a Bluetooth module (HC-05) for two-way communication to turn on the drone and receive sensor data.

The two resistors act as a voltage divider, reducing the 5 volts to 3.3 volts so that the Bluetooth can receive data from the Arduino Uno.

The circuit is so simple and small, requiring only a few connections

Arduino Pins Bluetooth Pins

RX (Pin 0) ———-》 TX

TX (Pin 1) ———-》 RX

5V————-》VCC

GND ————-》Ground

2. Sensor interface

DHT11 measures relative humidity. Relative humidity is the ratio of the amount of water vapor in the air to the saturation point of water vapor in the air. At the saturation point, water vapor begins to condense and accumulate on the surface to form dew. DHT11 uses only one signal line to transmit data to the Arduino interface diagram as shown above. Use the DHTLib library. It has all the features required to get humidity and temperature readings from sensors as shown below.

sensor interface

Interface between Arduino Uno and flight control

The flight controller (Cc3d) will provide 5 input control pins to provide 4 motion actions for the drone, which are throttle, roll, yaw and pitch. These pins require a PWM signal to work, so we will use an Arduino Uno to generate the PWM signal. With proper planning and specific sketches, we can program Arduino by delaying function calls.

Interface between Arduino Uno and flight control

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号