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
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
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
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.
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.
- CD4017 simple doorbell
- Audio Adapter Cable - Upgrading Car Audio with MP3 Player
- How to use MFRC522 to create an RFID card reader security system
- Interpretation of CAN bus driving recorder system circuit
- What components and functions does the battery management system consist of?
- Motorcycle anti-theft alarm circuit-a
- Catillac luggage compartment closing circuit diagram
- Blind electronic cane circuit
- JS13 type transistor time relay circuit
- Cadillac reversing light circuit diagram
- Humidity detection circuit schematic diagram
- Low temperature temperature sensor
- Intelligent fire alarm system circuit module design
- strain sensor
- Color sensor amplification circuit
- Digital pressure measurement circuit
- 3 and 1/2 digit digital thermometer using triode as degree sensor
- Thermocouple Thermometer Circuit
- Blocking sensor
- Bridge sensor transmit/receive circuit