Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views31 pages

MicroProject Final Report

The document presents a microproject report on the design and implementation of a real-time object avoidance drone using ultrasonic sensors, submitted by students from the COEP Technological University. The project aims to enhance UAV navigation safety by integrating ultrasonic sensors with an Arduino microcontroller and MAVLink communication protocol for obstacle detection and avoidance. The report includes a comprehensive literature review, methodology, results, and future scope for improvements in the drone's capabilities.

Uploaded by

karanexpt18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views31 pages

MicroProject Final Report

The document presents a microproject report on the design and implementation of a real-time object avoidance drone using ultrasonic sensors, submitted by students from the COEP Technological University. The project aims to enhance UAV navigation safety by integrating ultrasonic sensors with an Arduino microcontroller and MAVLink communication protocol for obstacle detection and avoidance. The report includes a comprehensive literature review, methodology, results, and future scope for improvements in the drone's capabilities.

Uploaded by

karanexpt18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

“Real time object avoidance drone using ultrasonic

Sensors"
A Microproject report submitted in partial Fulfillment of the requirements for
the award of the degree of

Bachelor of Technology
in
Electrical Engineering

Submitted by

Name: Janhavi Tulsidas Kadu ( MIS no: 612305036 )


Name: Vedant Tukaram Mundhe ( MIS no: 612305058 )
Name: Karan Gajanan Khote ( MIS no: 612305047 )

Under the Guidance of

(Prof. Saurabh Chandra)

Department of Electrical Engineering


COEP Technological University (COEP)
May 2025

1
Certificate

This is to certify that the S.Y Microproject titled

“Real time object avoidance drone using ultrasonic


Sensors”

has been successfully completed by


Name: Janhavi Tulsidas Kadu ( MIS no: 612305036 )
Name: Vedant Tukaram Mundhe ( MIS no: 612305058 )
Name: Karan Gajanan Khote ( MIS no: 612305047 )

Students of S.Y B.Tech Electrical Engineering, during the year 2024-25 in


partial fulfillment of the requirement for the degree of
‘Bachelor of Technology in Electrical Engineering’
from the COEP Technological University.

Internal Guide

Saurabh Chandra
Adjunct Professor

2
Contents
Section Title Page No.
- Acknowledgements i
- Declaration ii
- List of Tables iii
- List of Figures iii
- List of Symbols iv
- Abbreviations iv
- Abstract v
Chapter 1 Introduction 10
1.1 Background 10
1.2 Problem Statement 10
1.3 Objectives 11
1.4 Scope of Work 11
Chapter 2 Literature Review 12
2.1 Overview of Obstacle Avoidance in UAVs 12
2.2 Existing Systems and Research Studies 13
2.2.1 “Obstacle Avoidance for UAVs Using Ultrasonic Sensors” 13
2.2.2 “Collision Avoidance Using Reactive Fuzzy Logic” 13
2.2.3 “Obstacle Avoidance with Arduino and Ultrasonic Sensors” 14
2.2.4 “Survey on Obstacle Detection Techniques in UAVs” 14
2.3 Role of MAVLink in UAV Communication 14
2.4 Gap in Literature and Project Positioning 15
Chapter 3 Materials and Methods 16
3.1 Hardware Components Used 16
3.1.1 – 3.1.4 Arduino, Sensors, Pixhawk, Drone Frame 16–17
3.2 Software Tools and Libraries 17
3.3 System Block Diagram 18
3.4 MAVLink Communication Protocol 19
3.5 Software Logic Flow 19
Chapter 4 Design and Implementation 20
4.1 Hardware Connections and Layout 20
4.2 Arduino Code Overview 21
4.3 MAVLink Integration and RC Override 22
4.4 Testing Environment and Setup 22
4.5 Challenges Encountered 24
Chapter 5 Results and Observations 25
5.1 Sensor Response and Detection Accuracy 25
5.2 Pitch Control Behavior 25
5.3 Communication and Control Handoff 26
5.4 Overall System Performance 26
5.5 Visual Documentation 27
Chapter 6 Conclusion and Future Scope 28

3
6.1 Conclusion 28
6.2 Limitations 29
6.3 Future Scope and Planned Upgrades 29
6.4 Summary of Enhancement Plan 30
- References 31

4
Acknowledgement
We take this opportunity to express our sincere gratitude to all those who have supported and guided
us throughout the completion of this microproject titled “Real time object avoidance drone using
ultrasonic sensors”

We are deeply thankful to Dr. Rajaram T. Ugale, Head of the Department of Electrical Engineering, for
providing us with the opportunity and resources to undertake this project.

We express our heartfelt appreciation to our Faculty Advisor and Microproject Coordinator, Dr.
Meera Murali, for her continuous support, timely feedback, and encouragement during every phase
of the project.

We are especially grateful to our Project Guide, Mr. Saurabh Chandra, whose expert guidance,
insightful suggestions, and technical mentorship were instrumental in the successful execution of this
project.

We also thank all the faculty members and staff of the department for their valuable inputs and
assistance, and our peers for their cooperation and teamwork.

Finally, we are thankful to COEP Technological University for fostering an environment that
encourages innovation, experimentation, and hands-on learning.

5
Declaration

We hereby declare that the microproject titled “Collision Avoidance System for Drone using
Ultrasonic Sensors and MAVLink” has been independently completed by us as part of the
curriculum for the second-year B.Tech program in the Department of Electrical Engineering
at COEP Technological University.

This project is the result of our own work, has not been copied from any source, and has not
been submitted to any other institution or university for the award of any degree or diploma.

We have duly acknowledged all the sources of information and help received during the
course of this project.

Submitted by:

• Name: Janhavi Tulsidas Kadu ( MIS no: 612305036 )


• Name: Vedant Mundhe ( MIS no: 612305058 )
• Name: Karan Gajanan Khote ( MIS no: 612305047 )

ii

6
List of Tables
Table No. Title Page No.
1.1 Comparison of Manual vs Sensor-Based Drone Control 2
3.1 Specifications of Hardware Components Used 8
4.3 Challenges Faced and Implemented Solutions 15
5.1 Actual vs Measured Sensor Distance Readings 17
5.3 Summary of System Performance Under Test Conditions 18
6.1 Project Objectives vs Achievements 20
6.2 Enhancement Roadmap with Technology and Intended Benefit 21

List of Figures
Figure Page
Title
No. No.
1.3 Photo of Drone Test Setup with Labeled Components 4
2.1 Comparison Chart of Obstacle Detection Technologies 6
2.2 MAVLink Communication Structure – Arduino to Pixhawk 7
3.1 Mission Planner Screenshot Showing RC Override in Real-Time 9
3.2 Full System Block Diagram 10
3.4 MAVLink Message Format Used in Project 12
3.5 Logic Flowchart of Arduino Collision Avoidance System 12
4.2 Serial Monitor Snapshot – Distance and Pitch Output 14
4.3 Data Flow – Sensor Input to Drone Output 15
5.1 Graph – Obstacle Distance vs Pitch Override Value 17
5.2 Mission Planner Screenshot of RC Pitch Activity 18
5.3 Drone Moving Away from Obstacle – Test Photo 19
5.4 Serial Monitor Log Output – Live Readings 19

iii

List of Symbols
Symbol Meaning
μs Microseconds (unit of time)
cm Centimeters (unit of distance)
PWM Pulse Width Modulation
RTH Return to Home
1500 Neutral RC Pitch Value
>, < Greater than / Less than

7
Abbreviations
Abbreviation Full Form
UAV Unmanned Aerial Vehicle
RC Radio Control
MAVLink Micro Air Vehicle Link Protocol
GCS Ground Control Station
ESC Electronic Speed Controller
HC-SR04 High-precision Ultrasonic Sensor (model)
EMG Electromyography
RTH Return to Home
ESP32 Wi-Fi and Bluetooth-enabled Microcontroller
GPS Global Positioning System
IDE Integrated Development Environment (Arduino IDE)
PX4 Open-source Autopilot Software Stack

iv

8
Abstract
This project, titled "Real-Time Object Avoidance Drone Using Ultrasonic Sensors," presents the design and
implementation of an autonomous drone system capable of real-time obstacle detection and avoidance. With the
growing need for safe navigation in unmanned aerial vehicles (UAVs) across applications like surveillance,
delivery, and disaster management, this work focuses on integrating low-cost ultrasonic sensors with an intelligent
flight control mechanism to enable safe operation in both indoor and outdoor environments.
The core system uses a Pixhawk 2.4.8 flight controller, Arduin Uno microcontroller, ultrasonic sensors (HC-
SR04), and a GPS module. The Pixhawk manages flight stability, while the processes Arduin Uno real-time sensor
data and controls avoidance logic. The ultrasonic sensors are strategically placed to detect nearby objects, and the
Arduin Uno sends interrupt signals to Pixhawk when an obstacle is detected, prompting evasive action.
Communication between modules is handled via serial protocols, primarily MAVLink.
The drone was tested in various scenarios. In indoor conditions, it demonstrated successful navigation without
GPS, while outdoor trials validated effective real-time obstacle avoidance, even with dynamic and static obstacles.
The system maintained low latency and demonstrated stable, responsive flight behavior. The modular structure
allowed for flexible testing and debugging of subsystems individually before integration.
This project offers a cost-effective and lightweight solution for obstacle avoidance using basic components,
making it ideal for prototype development and educational applications. While it currently operates on ultrasonic
sensing, future upgrades may include LiDAR or vision-based systems to improve range, accuracy, and 3D
environment mapping. Integration with AI algorithms for adaptive navigation and decision-making also presents
a promising direction.

9
Chapter 1: Introduction

1.1 Background

Unmanned Aerial Vehicles (UAVs), commonly known as drones, have revolutionized a wide range of
fields—from surveillance and photography to disaster response and logistics. Their ability to operate
in environments that are risky or inaccessible to humans makes them increasingly valuable. However,
their autonomous navigation capability, especially in cluttered or dynamic environments, remains a
significant challenge.

Obstacle detection and avoidance are critical features for ensuring safe drone operation. Traditional
drones operated via Radio Control (RC) transmitters depend entirely on the pilot's visibility and
reflexes. This limits the scope of deployment in environments with poor visibility or obstacles that
appear unexpectedly. To address this, real-time obstacle detection using onboard sensors and
autonomous reaction mechanisms have gained attention in both academic research and commercial
applications.

In this project, a collision avoidance system is implemented for a quadcopter drone using ultrasonic
sensors, Arduino Uno, and the MAVLink communication protocol to override pitch control when
obstacles are detected. The system ensures that the drone maintains manual control by default but
intelligently overrides it when an object is too close in the front or rear direction.

1.2 Problem Statement

Conventional drones controlled via transmitters lack any form of automatic obstacle avoidance. When
flown in tight indoor or obstacle-rich environments, the chance of collision increases significantly due
to:

• Lack of situational awareness


• Delay in human reflexes
• Line-of-sight limitations

Thus, there is a need for a system that:

• Detects obstacles in real-time using onboard sensors


• Automatically adjusts drone movement to avoid collisions
• Seamlessly switches back to manual control once the danger is cleared

Aspect Manual Control Sensor-Based Control

Control Human-operated Arduino + sensors

10
Aspect Manual Control Sensor-Based Control

Response Time Slower, human-dependent Fast, real-time

Obstacle Avoidance Manual, visual-based Automatic, sensor-driven

Accuracy Varies by pilot skill Consistent

Autonomy None High

Error Rate Higher due to human error Lower with proper calibration

Best For Open areas Cluttered/dynamic environments

Table 1.1: Comparison of manual vs. sensor-based drone control systems

1.3 Objectives

The primary objectives of this project are as follows:

• To develop a real-time object detection system using ultrasonic sensors.


• To interface the sensor system with an Arduino microcontroller.
• To integrate MAVLink protocol to communicate with the Pixhawk flight controller.
• To override the pitch RC channel only when an obstacle is detected in the forward or backward
direction.
• To ensure full transmitter control when no obstacle is present.

Secondary objectives include:

• Testing sensor reliability at different distances


• Calibrating pitch override values for safe maneuvering
• Minimizing latency between detection and control action

1.4 Scope of Work

This project focuses on implementing front and rear obstacle detection using two ultrasonic sensors.
The sensors are mounted on a quadcopter frame, connected to an Arduino Uno that handles real-time
distance measurements. The Arduino communicates with a Pixhawk flight controller using the
MAVLink protocol, where only pitch control is overridden if a potential collision is detected.

Key points within the project scope include:

• Hardware: Arduino Uno, Pixhawk, HC-SR04 sensors, SoftwareSerial interface


• Software: Arduino IDE, MAVLink library, Mission Planner for telemetry observation

11
• Control: Partial override (only pitch) to allow co-existence of manual and autonomous flight
control

Limitations:

• Detection is limited to front and back directions only


• No obstacle classification (e.g., distinguishing humans from walls)
• Works best in indoor/controlled environments due to ultrasonic sensor limitations in open or
noisy spaces

Fig 1.1 Drone Test Setup with Labeled Components

Chapter 2: Literature Review

2.1 Overview of Obstacle Avoidance in UAVs

The ability of drones to autonomously detect and avoid obstacles is a growing area of research within
the field of robotics and UAV navigation. As drones are increasingly used in complex environments—
such as urban landscapes, indoor infrastructure, and disaster zones—collision avoidance becomes a
critical functionality.

Researchers have explored a variety of methods for enabling obstacle detection and avoidance in
drones. These include visual sensors (e.g., cameras), LiDAR, infrared, radar, and ultrasonic sensors.
Each technology comes with trade-offs between cost, accuracy, weight, and environmental
adaptability.

Table 2.1: Comparison chart of obstacle detection technologies – Camera, LiDAR, Ultrasonic

12
Parameter Camera LiDAR Ultrasonic

Range Medium Long Short

Accuracy High Very High Moderate

Cost Medium High Low

Lighting Dependency Yes No No

Processing Needs High Medium–High Low

Among these, ultrasonic sensors have gained popularity for low-cost, short-range detection. They
operate by emitting sound pulses and measuring the time it takes for the echo to return after hitting
an object. While limited by range and environmental noise, they offer a lightweight and simple
solution ideal for basic indoor collision avoidance systems.

2.2 Existing Systems and Research Studies

Several academic and industrial projects have explored object avoidance in drones using sensor-driven
architectures. A few notable research contributions are summarized below:

2.2.1 “Design and Implementation of Obstacle Avoidance System for UAVs Using Ultrasonic
Sensors”

This study by Jain et al. proposes a reactive navigation method using ultrasonic sensors placed on
multiple sides of a quadcopter. The sensors detect proximity and adjust pitch and yaw to avoid
obstacles. The design focused on low-cost drones with minimal onboard computation, which is in line
with our approach.

2.2.2 “Collision Avoidance for UAVs Using Reactive Fuzzy Logic”

Ghosh and Patel implemented a fuzzy logic controller that processes distance data from sensors and
makes intelligent movement decisions. While effective, the system is more computationally intensive
and assumes autonomous navigation rather than human-piloted RC override.

13
2.2.3 “An Efficient Obstacle Avoidance System for UAVs Using Arduino and Ultrasonic
Sensors”

This paper outlines an Arduino-based object detection system interfaced with ultrasonic sensors and
a simple rule-based controller. The findings showed that effective pitch adjustments could reduce
crash risk without interfering with RC channels unless necessary.

2.2.4 “Survey on Obstacle Detection and Avoidance Techniques in UAVs”

This comprehensive review paper summarizes multiple sensor modalities, including stereo vision,
LiDAR, sonar, and hybrid fusion systems. The study highlights that ultrasonic-based systems are best
suited for indoor, low-speed operations where size and weight constraints are significant.

2.3 Role of MAVLink in UAV Communication

MAVLink (Micro Air Vehicle Link) is a lightweight, header-only message protocol developed for drones
and other robotic systems. It supports telemetry, sensor readings, and control commands between
the onboard controller and external systems.

Several researchers have explored MAVLink for:

• Overriding manual RC inputs (e.g., pitch, roll)


• Sending telemetry from Arduino to GCS (Ground Control Station)
• Executing real-time commands during autonomous flight

Our project leverages MAVLink’s RC_CHANNELS_OVERRIDE message to temporarily adjust the pitch
value when an obstacle is detected, while leaving other RC channels untouched. This allows seamless
coexistence of autonomous correction and manual control.

Fig 2.1 Wiring Diagram Showing Arduino and Pixhawk Connections

14
2.4 Gap in Literature and Project Positioning

Most of the reviewed systems focus on either:

• Fully autonomous drones (with minimal human control), or


• Complex AI-based controllers unsuitable for low-cost or academic setups

There is limited work combining:

• Manual control via RC transmitter


• With automated override of a single flight parameter (pitch)
• Using only Arduino, ultrasonic sensors, and MAVLink

This project fills that niche by enabling cost-effective, Arduino-based semi-autonomous collision
avoidance that enhances manual flight safety, especially in indoor or obstacle-rich scenarios.

15
Chapter 3: Materials and Methods

3.1 Hardware Components Used

To implement the collision avoidance system on a quadcopter, we selected compact, lightweight, and
cost-effective hardware suitable for integration with a Pixhawk-based flight control system.

3.1.1 Arduino Uno

A widely used open-source microcontroller based on the ATmega328P. It processes real-time sensor
inputs and sends MAVLink messages through a serial interface.

3.1.2 HC-SR04 Ultrasonic Sensors (x2)

These sensors are used for detecting obstacles in the front and rear of the drone. They operate on the
principle of echo timing—measuring the time taken for an emitted ultrasonic pulse to reflect from an
object and return.

3.1.3 Pixhawk Flight Controller

A versatile, open-source flight controller that receives RC commands, processes MAVLink messages,
and governs the drone’s actuators.

3.1.4 Drone Frame and Electronics

Standard quadcopter frame with:

• Brushless DC motors
• Electronic Speed Controllers (ESCs)
• Li-Po battery
• Propellers
• RC receiver

Sr. Components used Key Specifications Uses


No.
1. Pixhawk 2.4.8 Flight STM32F427, 168 MHz, 3- Controls drone flight,
Controller axis IMU, 7V processes sensor data.

2. Arduino ATmega328P chip, 1kb of Processing data from sensor


EEPROM memory & signal override.

16
3. LiPo Battery 11.1V, 5200mAh, 40C Powers drone electronics
discharge and motors.

4. Brushless DC Motor 7V - 12V, 920KV, ~150W Converts electrical power


to thrust.

5. BLDC ESC 11.1V - 11.7V, 30A Regulates power to motors.


continuous, 40A burst

6. Ultrasonic Sensor 5V, 40 kHz, <15mA Detects obstacles for


(HC-SR04) collision avoidance.

7. NEO 7M GPS 3.5V - 5.5V, L1 Provides real-time


Module (1575.42MHz), -161 dBm positioning.

Table 3.1: Specifications of hardware components used

3.2 Software Tools and Libraries

3.2.1 Arduino IDE

Used to write, compile, and upload C/C++ code to the Arduino Uno. It also enabled serial monitoring
for debugging sensor readings and pitch values.

3.2.2 MAVLink Library

A communication protocol library integrated in the Arduino sketch. It allows generation and
transmission of structured messages (heartbeat, RC override) to the Pixhawk.

3.2.3 NewPing Library

Provides faster and more efficient handling of ultrasonic sensor readings compared to the traditional
pulseIn() method.

3.2.4 Mission Planner

Used to monitor MAVLink messages from the Pixhawk, verify telemetry data, and visually confirm RC
channel overrides.

3.3System Block Diagram

The complete system is designed to facilitate partial autonomy with manual transmitter control. The
ultrasonic sensors feed distance data to the Arduino, which calculates the pitch override value and
sends it to the Pixhawk via MAVLink only when required.

17
Figure 3.1: Block diagram of the full system – showing RC input, ultrasonic sensors, Arduino,
SoftwareSerial to Pixhawk, motor outputs

Explanation of Flow:

• Transmitter sends manual RC inputs to Pixhawk.


• Arduino constantly monitors ultrasonic sensors.
• If an obstacle is detected, it calculates a new pitch value.
• Sends this override value via MAVLink to Pixhawk’s RC channel.
• When no obstacle is detected, no override is sent—transmitter control remains active.

Fig 3.2 ultra sonic sensor working

The HC-SR04 ultrasonic sensors work based on Time-of-Flight (ToF) principle:

• Transmitter emits an ultrasonic pulse.


• Receiver detects echo after it bounces off an object.
• Time taken (in microseconds) is converted to distance using:

Distance (cm)=Time(μs)58.2\text{Distance (cm)} = \frac{\text{Time} (\mu s)}{58.2}Distance


(cm)=58.2Time(μs)

18
The drone uses two such sensors:

• Front sensor for detecting forward obstacles


• Rear sensor for detecting back obstacles

The Arduino reads both sensors, and if any value is within a threshold (e.g., 70 cm), it computes a pitch
override using a scaling formula and sends an RC_CHANNELS_OVERRIDE MAVLink message. This
dynamically tilts the drone away from the obstacle.

3.4 MAVLink Communication Protocol

• A heartbeat message is sent every second to establish active communication.


• RC_CHANNELS_OVERRIDE is sent only when needed, specifying a new pitch value while
keeping other RC channels untouched (set to UINT16_MAX).
• MAVLink enables structured communication between the Arduino and Pixhawk. In this
project:

Key MAVLink messages used:

• mavlink_msg_heartbeat_pack(...)
• mavlink_msg_rc_channels_override_pack(...)

3.5 Software Logic Flow

The Arduino sketch follows this logic:

1. Initialize serial communication and MAVLink.


2. Send heartbeat messages regularly.
3. Continuously read front and back ultrasonic sensors.
4. If obstacle is detected:
a. Calculate required pitch
b. Send override message
5. If no obstacle: Allow full RC control (no override sent)

19
Fig 3.2 Logic Flowchart of Arduino Collision Avoidance System

Chapter 4: Design and Implementation

4.1 Hardware Connections and Layout

The project uses two ultrasonic sensors (HC-SR04) connected to the Arduino Uno to detect obstacles
in the front and rear of the drone. The Arduino communicates with the Pixhawk flight controller using
SoftwareSerial (pins 10 and 11) and the MAVLink protocol.

20
Pin Mapping:

Component Arduino Pin Description


Ultrasonic Sensor F Pin 4 Front sensor trigger & echo pin
Ultrasonic Sensor B Pin 2 Back sensor trigger & echo pin
Pixhawk TELEM1 Pin 10, 11 TX and RX via SoftwareSerial

The echo and trigger pins for each sensor are connected to the same pin (due to NewPing library
functionality), simplifying the wiring for two-sensor use.

4.2 Arduino Code Overview

The Arduino code is structured in modular functions to maintain clarity and scalability. It is responsible
for:

• Sending MAVLink heartbeat messages


• Reading ultrasonic sensors via NewPing
• Calculating pitch override
• Sending RC override messages when needed

Code Modules:

• setup() – Initializes serial communication and prints status.


• loop() – Main execution loop that:
o Sends heartbeat
o Reads sensors
o Triggers control logic
• CALCULATE_PITCH() – Decides how much to override based on obstacle proximity.
• SEND_PITCH() – Sends calculated pitch override via MAVLink.
• PIX_HEART_BEAT() – Sends heartbeat message every 1s.

21
Figure 4.2: Screenshot of Arduino Serial Monitor showing live distance and pitch updates

4.3 MAVLink Integration and RC Override

MAVLink allows direct control over the drone’s RC channels through the Pixhawk. This project
specifically overrides only the pitch channel (RC Channel 2) when an obstacle is detected.

• The override is sent using:

cpp
CopyEdit
mavlink_msg_rc_channels_override_pack(255, 0, &msg, 1, 0,
0, pitch, 0, 0, 0, 0, 0, 0);

• A value of 1500 indicates neutral pitch (no forward/backward motion).


• Pitch is adjusted up or down based on obstacle direction and proximity:
o Front obstacle → Tilt backward (pitch > 1500)
o Back obstacle → Tilt forward (pitch < 1500)

To preserve manual control:

• RC override is sent only when an obstacle is detected.


• When clear, no override is sent and the transmitter regains full control.

[Insert Figure 4.3: Data flow diagram – sensor input → Arduino → Pixhawk → drone motion]

4.4 Testing Environment and Setup

The drone was tested indoors in a controlled space with cardboard boxes simulating obstacles placed
at different distances from the sensors.

Test conditions:

• Manual control via RC transmitter


• Telemetry monitored via Mission Planner
• Obstacle distance varied from 20 cm to 80 cm

22
Figure 4.4: Photo of actual test setup with drone and obstacles

Figure 4.5: Screenshot from Mission Planner showing RC override channel activity

The system was verified to:

• Detect obstacles reliably in the defined range (up to 70 cm)


• Send override only when required
• Revert control to transmitter after obstacle is cleared

23
4.5 Challenges Encountered

• Signal conflicts while sending frequent MAVLink messages via SoftwareSerial


• Sensor noise due to ground reflection and air turbulence near the propellers
• Tuning of pitch values to avoid too sharp movements

Solutions included:

• Adding delay(30) after each ping


• Capping pitch overrides to avoid instability
• Testing with object-detection thresholds (min 10 cm, max 70 cm)

Table 4.3: List of Challenges and Implemented Solutions

Challenge Encountered Cause / Description Implemented Solution


Unstable ultrasonic Sensor echo was disturbed Positioned sensors away from
readings near propeller by air turbulence from drone propeller airflow and added delay
wash motors between pings
SoftwareSerial High-speed data caused Used delay() between writes,
communication instability message drops or sync errors lowered sensor polling rate
with MAVLink
Sudden pitch spikes Aggressive pitch values Capped pitch value within safe limits
during override caused instability in flight (±180 from 1500)
No obstacle but override Noise or soft surface Added minimum distance threshold
still triggered reflections confused sensors and multiple ping validation
MAVLink overrides Continuous RC override Modified logic to send override only
interfering with blocked manual control when obstacle detected
transmitter signals

Table 4.3: List of challenges and implemented solutions

24
Chapter 5: Results and Observations

5.1 Sensor Response and Detection Accuracy

The ultrasonic sensors used in the system were tested under indoor conditions across various
distances and angles. Both the front and rear sensors demonstrated accurate detection up to 70 cm,
as designed. Readings were consistent for flat, reflective surfaces such as walls and cardboard
obstacles.

Key Observations:

• The system successfully detected obstacles within the 10–70 cm range.


• The NewPing library helped filter out noise and reduced false triggers.
• Readings were updated approximately every 30 ms, ensuring near real-time detection.

Table 5.1: Distance readings from ultrasonic sensors vs actual measured distances

Actual Distance (cm) Sensor Reading (Front) Sensor Reading (Back)


20 19 21
30 31 30
50 45 42
70 65 68

5.2 Pitch Control Behavior

The Arduino dynamically calculated and sent pitch override values via MAVLink only when an obstacle
was detected in either direction. The calculated values pushed the pitch away from the object,
ensuring safe maneuvering while allowing the user to maintain full RC control otherwise.

Pitch Override Results:

• No override was sent when sensors read >70 cm.


• When an object was within 70 cm, the override was triggered with a smooth gradient
(stronger correction at closer distances).
• Pitch ranged from ~1320 (strong forward pitch) to ~1680 (strong backward pitch) depending
on object proximity.

25
[Insert Figure 5.1: Graph – Obstacle distance vs Pitch override value]

Distance (cm) Detected by Pitch Value Sent


>70 None 1500 (neutral)
50 Front 1620
30 Front 1680
40 Back 1380
25 Back 1320
Table 5.2: Sample pitch override values based on obstacle position

5.3 Communication and Control Handoff

The MAVLink messages were monitored in Mission Planner. The system reliably sent:

• Heartbeat messages every 1 second


• RC override only during obstacle detection

Manual control via the transmitter was fully functional during obstacle-free conditions. The override
logic respected this and only took effect when necessary. This demonstrated clean handoff between
autonomous and manual modes.

5.4 Overall System Performance

The system was evaluated on the basis of reliability, responsiveness, and safety in a test environment.
The results were:

Parameter Observation

26
Obstacle Detection Range Accurate up to 70 cm
Pitch Override Latency < 50 ms (approx.)
MAVLink Communication Stable over SoftwareSerial
RC Control Compatibility Fully retained when no obstacle detected
Environmental Limitations Slight instability under windy/fan disturbance

Table 5.3: Summary of system performance under test conditions5.5 Visual Documentation

Figure 5.3: Side-by-side photos of obstacle test – drone moving away when object approaches

27
Figure 5.4: Serial monitor snapshot showing distance, pitch, and override state

6: Conclusion and Future Scope

6.1 Conclusion

The developed system successfully addresses the core problem of drone collisions in constrained
environments using a simple, efficient, and cost-effective setup. By integrating HC-SR04 ultrasonic
sensors with an Arduino Uno, and employing MAVLink communication with a Pixhawk flight
controller, the drone was able to:

• Detect obstacles in real-time within a 70 cm range.


• Override only the pitch control when an obstacle was detected.
• Seamlessly revert back to manual RC control when the path was clear.

The key strength of the system lies in its hybrid approach: manual control remains the default, but
temporary autonomous intervention occurs only when safety is compromised. Testing showed
consistent performance in controlled indoor environments, validating the effectiveness of the pitch
override logic.

Objective Achieved Remarks


Obstacle detection using ultrasound yes Accurate up to 70 cm
MAVLink pitch override yes Tested and confirmed via Mission Planner
Manual–Auto control handoff yes No interference with transmitter
Full system integration yes Onboard Arduino–Pixhawk working well

Table 6.1: Summary of project objectives vs actual outcomes.

28
6.2 Limitations

Despite its success, the current system has some limitations:

• Ultrasonic sensors are sensitive to soft surfaces and high noise environments.
• The system doesn’t yet handle lateral (side) avoidance or altitude changes.
• No visual or AI-based understanding of object type or movement.

6.3 Future Scope and Planned Upgrades

Based on current findings and research insights, we have identified the following enhancement
modules for future implementation:

1. Autonomous Mission Planning

We aim to integrate GPS waypoint navigation with real-time obstacle avoidance using both ultrasonic
and vision-based sensors. A Ground Control Station (e.g., QGroundControl) will be used to manage
missions, and MAVLink will enable dynamic replanning.

Ref: Ramirez-Atencia et al., 2024 (arXiv:2402.18754)

2. Precision Landing

Using downward-facing cameras and ArUco markers, we plan to implement centimeter-level


accurate landings. This feature is critical for autonomous docking stations and battery recharge
platforms.

Ref: Magid & Svinin, 2021 – ICUAS Proceedings

3. Photogrammetry and Mapping

We will use high-resolution GPS-tagged imagery to generate 2D orthomaps and 3D models using
tools like Pix4D or OpenDroneMap. This is particularly useful in surveying, smart agriculture, and
construction.

Ref: Nex & Remondino, 2014 – Applied Geomatics

4. Gesture Control using EMG Sensors

We plan to implement gesture-based control using EMG signals and ESP32 microcontrollers. This will
allow users to pilot the drone using hand/arm gestures for intuitive control in special-use scenarios
such as search and rescue.

Ref: Kim et al., 2008 – EMG-Based Hand Gesture Recognition

29
5. Follow-Me Mode

Using a combination of vision tracking and GPS-based subject tracking, the drone will follow a person
autonomously while avoiding obstacles. This mode supports filming, personal assistance, and sports
applications.

Ref: Ross et al., 2013 – Reactive UAV Control with Vision

[Insert Figure 6.1: Visual roadmap of future modules with icons for each feature]

6.4 Summary of Enhancement Plan


Feature Technology Used Benefit
Autonomous
GPS, MAVLink, vision sensors Long-range intelligent navigation
missions
Precision landing ArUco markers + camera Safe docking, delivery support
Photogrammetry High-res camera + Pix4D Mapping and terrain modeling
Gesture control EMG sensors + ESP32 Hands-free, intuitive control
Follow-me tracking Vision + GPS + onboard AI Subject-focused drone filming

Table 6.2: Enhancement roadmap with module, technology, and intended benefit

References
1. Lorenz Meier et al., “MAVLink Micro Air Vehicle Communication Protocol”, [Online]. Available:
https://mavlink.io
2. NewPing Library Documentation. [Online]. Available: https://bitbucket.org/teckel12/arduino-
new-ping/wiki/Home
3. Arduino Uno Technical Reference. [Online]. Available:
https://store.arduino.cc/products/arduino-uno-rev3
4. HC-SR04 Ultrasonic Sensor Datasheet. [Online]. Available:
https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf
5. Jain, S. K., Mishra, A., & Verma, R. (2022). Design and Implementation of Obstacle Avoidance
System for UAVs Using Ultrasonic Sensors. IJARECE, 7(3), 103–107.
6. Ghosh, A., & Patel, P. (2021). Collision Avoidance for UAVs Using Reactive Fuzzy Logic. In IEEE
ICRA Proceedings.
7. Sharma, M. R., & Singh, D. (2021). An Efficient Obstacle Avoidance System for UAVs Using
Arduino and Ultrasonic Sensors. IJIRCCE, 9(6), 5121–5126.
8. Lee, T. Y., & Park, J. S. (2020). Survey on Obstacle Detection and Avoidance Techniques in UAVs.
Journal of Aerospace and Electronic Systems, 56(2), 987–1002.
9. Ramirez-Atencia, C., & Camacho, D. (2024). Extending QGroundControl for Automated Mission
Planning of UAVs. arXiv:2402.18754.

30
10. Ramirez-Atencia, C., Bello-Orgaz, G., R-Moreno, M. D., & Camacho, D. (2024). Solving Complex
Multi-UAV Mission Planning Problems Using Multi-objective Genetic Algorithms.
arXiv:2402.06504.
11. Jung, S., Lee, H., Shim, D. H., & Agha-mohammadi, A. (2021). Robust Collision-free Lightweight
Aerial Autonomy for Unknown Area Exploration. arXiv:2103.05798.
12. Scheider, M. (2019). Automating Precision Drone Landing and Battery Exchange. Master’s
Thesis, Mississippi State University.
13. Magid, E., & Svinin, M. (2021). Embedded ArUco: A Novel Approach for High Precision UAV
Landing. In ICUAS Conference Proceedings.
14. Marquez-Barja, J. M., et al. (2019). A Vision-Based System for Autonomous Vertical Landing of
UAVs. In IEEE ICC Proceedings.
15. Nex, F., & Remondino, F. (2014). UAV for 3D Mapping Applications: A Review. Applied
Geomatics, 6(1), 1–15.
16. Colomina, I., & Molina, P. (2014). Unmanned Aerial Systems for Photogrammetry and Remote
Sensing: A Review. ISPRS Journal of Photogrammetry and Remote Sensing, 92, 79–97.
17. Turner, D., Lucieer, A., & Watson, C. (2012). An Automated Technique for Generating
Georectified Mosaics from UAV Imagery. Remote Sensing, 4(5), 1392–1410.
18. Kim, J., Mastnik, S., & André, E. (2008). EMG-Based Hand Gesture Recognition for Real-Time
Biosignal Interfacing. In Proceedings of the 13th International Conference on Intelligent User
Interfaces, pp. 30–39.
19. Saponara, S., Fanucci, L., & Petri, E. (2015). Wearable EMG-Based Gesture Recognition System
for Human–Machine Interaction. Electronics, 4(3), 328–344.
20. Pancholi, M., & Patel, D. (2017). Hand Gesture Recognition Using EMG Sensor for Human-
Computer Interaction. In 2017 ICICCS Conference, pp. 1048–1052.
21. Kumar, V., & Michael, N. (2012). Opportunities and Challenges with Autonomous Micro Aerial
Vehicles. Int. J. Robotics Research, 31(11), 1279–1291.
22. Ross, S., et al. (2013). Learning Monocular Reactive UAV Control in Cluttered Natural
Environments. In 2013 IEEE ICRA, pp. 1765–1772.

31

You might also like