0% found this document useful (0 votes)
34 views40 pages

Virtual Mouse 1

The project report details the design and implementation of an IoT-based obstacle detection system for vehicles, utilizing ultrasonic sensors to enhance safety in navigation and robotics. The system processes data through an Arduino microcontroller to detect obstacles and activate warnings, demonstrating high accuracy and reliability across various test scenarios. The report also discusses future recommendations for system improvements and integration with existing vehicle safety technologies.

Uploaded by

nishagarghnd825
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)
34 views40 pages

Virtual Mouse 1

The project report details the design and implementation of an IoT-based obstacle detection system for vehicles, utilizing ultrasonic sensors to enhance safety in navigation and robotics. The system processes data through an Arduino microcontroller to detect obstacles and activate warnings, demonstrating high accuracy and reliability across various test scenarios. The report also discusses future recommendations for system improvements and integration with existing vehicle safety technologies.

Uploaded by

nishagarghnd825
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/ 40

A

Project Report

On

Obstacle Detection in Vehicles using IOT


Submitted

In Partial Fulfillment

For the requirements for the award of the degree of

Bachelor of Technology
in
Computer Science & Engineering

Project Coordinator: Submitted By:


Dr. C.P. Gupta (Professor) Aditi Shankhwal (21EUCCS006)
Prof. Dinesh Soni (Assistant Professor) Avirat Tak(21EUCCS026)
Chelsi Kherwal (21EUCCS033)
Nisha Garg (21EUCCS079)

Department of Computer Science & Engineering

Rajasthan Technical University

Kota - 324010, Rajasthan, India

November 2024
Candidate’s Declaration

I hereby declare that the project work, which is being presented to the Department of Computer
Science and Engineering, Rajasthan Technical University Kota, entitled as “OBSTACLE
DETECTION IN VEHICLES USING IOT” was carried out and written by us with our
correct and complete knowledge carried under the guidance of Dr. C.P. Gupta, Professor and
Prof. Dinesh Soni , Associate Professor, Department of Computer Science and Engineering,
Rajasthan Technical University Kota.
The results contained in this report have not been submitted in part or in full to any other
University or Institute for the award of any degree or diploma to the best of our knowledge

Aditi Shankhwal (21EUCCS006) (Signature)


Avirat Tak(21EUCCS026)
Chelsi Kherwal (21EUCCS033)
Nisha Garg (21EUCCS079)

i
Certificate

This is to certify that the Project Report entitled as “Obstacle Detection in Vehicles using IOT”
has been successfully carried out by Aditi Shankhwal(21/181), Avirat Tak (21/201), Chelsi
Kherwal (21/208), and Nisha Garg(21/249) under my guidance partially fulfilling the criteria of
Bachelor of Technology in Computer Science and Engineering from the Department
of Computer Science and Engineering, Rajasthan Technical University Kota, for the academic
year 2024-25.

(Signature)
Dr. C.P. Gupta
(Professor)

ii
Acknowledgements

We are thankful to our bachelor’s supervisor Dr. C.P. Gupta, and Prof. Dinesh Soni for
her continuous support, conviction, encouragement, and invaluable advice in project work.

We would also like to thank Dr. Harish Sharma, Head of Departmnent, Computer Science and
Engineering Department, Rajasthan Technical University, Kota for his guidance and support.
Further, we would like to thank the faculty members and supporting staff of Computer Science
Engineering Department for their full support and heartiest co-operation:

This project would not have been possible without the hearty support of our families. Our
deepest regards to our Parents for their blessings, affection and continuous support. Also, Last
but not the least, We thank to the GOD, the almighty for giving us the inner willingness,
strength and wisdom to carry out this project work successfully.

Yours Sincerely,
Aditi Shankhwal (21/181)
Avirat Tak (21/201)
Chelsi Kherwal (21/208)
Nisha Grag (21/249)

iii
Abstract

The “Obstacle Detection in Vehicles using IOT” project explores the design and implementation
of an obstacle detection system utilizing ultrasonic sensor technology, primarily aimed at
enhancing safety in autonomous navigation, robotics, and IoT-based applications. Ultrasonic
sensors function by emitting high-frequency sound waves that reflect off nearby objects, with
the system calculating the distance based on the time delay of the returning echo.
An Arduino microcontroller processes this data to determine if an obstacle is within a critical
range. If an obstacle is detected within the set threshold, the system activates a relay module and
a buzzer, providing an immediate audio warning. This setup is both cost-effective and robust,
ensuring accurate, real-time detection in various environments. The project also addresses
several challenges, including optimizing the system to reduce interference from other ultrasonic
or electronic signals, improving sensor accuracy under different environmental conditions, and
ensuring consistent performance in diverse settings. Furthermore, the simplicity of this system
allows it to be easily expanded with additional sensors, such as infrared (IR), to improve obstacle
recognition in complex or low visibility environments. Testing demonstrates the system’s high
accuracy and reliability, with results indicating consistent obstacle detection across multiple
test scenarios, including different distances and obstacle materials. The flexibility of this setup
makes it a promising choice for integration in applications that require obstacle detection and
collision avoidance, such as advanced driver assistance systems (ADAS), automated delivery
robots, and personal safety devices

iv
Table of Contents

Candidate’s Declaration i

Certificate ii

AcknowledgementS iii

Abstract iv

1 Introduction 1
1.1 Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Prevention of accidents . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 Driver assistance and support . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.3 Safer integration of technology . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.4 Promoting awareness and responsible driving . . . . . . . . . . . . . . . . 2
1.2 Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Literature Review 3
2.1 IoT-based Obstacle Detection and Alerting System in Vehicles using Ultrasonic
Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Ultrasonic Sensor-Based Intelligent Vehicle Collision Avoidance System . . . . . 3
2.3 Obstacle Detection and Avoidance System for Autonomous Vehicles: A Review . 3
2.4 An Ultrasonic Sensor Based Obstacle Avoidance System for Visually Impaired
People . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.5 A Study on Ultrasonic Sensors for Obstacle Detection in Vehicles . . . . . . . . 4
2.6 Real-Time Vehicle Obstacle Detection and Avoidance using Arduino and Ultra-
sonic Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.7 An Ultrasonic Sensor-Based Parking Assistance System . . . . . . . . . . . . . . 4
2.8 Arduino-Based Obstacle Avoidance for Autonomous Vehicles . . . . . . . . . . . 5
2.9 Ultrasonic Sensor-Based Intelligent Parking Assist System . . . . . . . . . . . . 5

v
2.10 Development of an Ultrasonic Sensor-Based Intelligent Vehicle Collision Avoidance
System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Approach 6

4 Hardware Components 8
4.1 Arduino UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Ultrasonic Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3 DC Gear Motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.4 DC Jack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.5 Connecting Wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.6 Soldering Iron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.7 Solder Wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.8 3.7V Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5 Software Components 18
5.1 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.1 Arduino IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

6 Working 21
6.1 Working of the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.1.1 1. Obstacle Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.1.2 2. Obstacle Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6.1.3 3. Ignition and Emergency Controls . . . . . . . . . . . . . . . . . . . . . 22
6.1.4 4. Software and Hardware Coordination . . . . . . . . . . . . . . . . . . 23
6.1.5 5. Performance and Testing . . . . . . . . . . . . . . . . . . . . . . . . . 23

7 Block Diagram 25

8 Designed Prototype 26

9 Conclusion 27

10 Future Recommendations 28
10.1 Integration of Multiple Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
10.2 Development of Advanced Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 28
10.3 Integration with Existing Vehicle Safety Systems . . . . . . . . . . . . . . . . . . 28

vi
10.4 Intuitive and User-Friendly Interface . . . . . . . . . . . . . . . . . . . . . . . . 29
10.5 Integration with Connected Vehicle Technologies . . . . . . . . . . . . . . . . . . 29
10.6 Compliance with Safety Standards and Regulations . . . . . . . . . . . . . . . . 29
10.7 Real-Time Data Analysis and Cloud Integration . . . . . . . . . . . . . . . . . . 29
10.8 Predictive Maintenance and System Health Monitoring . . . . . . . . . . . . . . 30
10.9 Improved Power Efficiency and Low-Voltage Operation . . . . . . . . . . . . . . 30
10.10Real-Time Vehicle-to-Infrastructure Communication . . . . . . . . . . . . . . . . 30

vii
List of Figures

4.1 Diagram of Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


4.2 PIN Layout of Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Ultrasonic sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.4 DC Gear Motor Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.5 DC Jack Connector for Power Supply . . . . . . . . . . . . . . . . . . . . . . . . 14
4.6 connecting wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.7 Soldering Iron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.8 Solder Wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.9 Li-ion battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.1 IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

6.1 Arduino UNO and HC-SR04 Ultrasonic Sensor Wiring Diagram . . . . . . . . . 24

7.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

8.1 Designed Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

viii
Chapter 1: Introduction

The primary objective of this project is to design and implement an obstacle detection system
that can effectively identify obstacles within a set range and provide immediate feedback to
users. This system can be further extended to support IoT functionality, allowing data on
obstacle proximity to be transmitted and monitored remotely, which is particularly beneficial
for real-time safety management.
In this report, we will explore the design, development, and testing of the obstacle detection
system, detailing the components used, the methodology employed, and the performance
outcomes. Through this project, we aim to create an affordable, efficient obstacle detection
system that can serve as a foundational model for future, more complex detection and safety
systems.

1.1 Requirement
The system we’re developing addresses important safety concerns in today’s world, where road
accidents and driver fatigue-related incidents continue to pose significant risks. Here are a few
key reasons why this system is relevant and needed

1.1.1 Prevention of accidents

The system’s ability to detect obstacles in the vehicle’s path and respond by slowing down and
stopping the vehicle can help prevent collisions. By providing an additional layer of safety, it
reduces the chances of accidents caused by driver inattention or delayed reactions.

1.1.2 Driver assistance and support

The system serves as an assistance mechanism for drivers, providing an extra set of eyes
and ensuring a safer driving experience. It helps alleviate the burden of constant vigilance,
particularly in situations where drivers may experience fatigue or distractions.

1
1.1.3 Safer integration of technology

With the increasing presence of advanced technologies in vehicles, it is crucial to ensure their
integration is done safely. By utilizing an Arduino UNO microcontroller and compatible sensors,
our system offers a practical and accessible approach to incorporating safety features, promoting
responsible and secure implementation.

1.1.4 Promoting awareness and responsible driving

By showcasing the capabilities of this system, we aim to raise awareness about road safety
and encourage responsible driving practices. It highlights the importance of attentiveness, rest
breaks, and adhering to traffic regulations.

1.2 Approach
1. Sensor Integration: Connect the ultrasonic sensor to the Arduino UNO to enable
distance measurement for detecting obstacles.

2. Distance Measurement: Program the Arduino to send and receive ultrasonic pulses to
calculate the distance between the vehicle and any obstacle.

3. Real-Time Monitoring: Continuously monitor distance readings to ensure real-time


obstacle detection.

4. Condition-Based Response: Use conditional statements to identify if an obstacle is


within a specified range.

5. Alert Mechanism: Trigger an alert or safety response if the obstacle is detected within
the critical range to prevent collisions.

6. Ignition and Brake Controls: Integrate ignition and brake switches with the Arduino,
allowing the system to respond based on distance readings from the sensor.

2
Chapter 2: Literature Review

2.1 IoT-based Obstacle Detection and Alerting System


in Vehicles using Ultrasonic Sensors
This paper presents an IoT-based system designed to detect obstacles around vehicles using
ultrasonic sensors. It emphasizes the integration of sensors with Arduino to measure the distance
of obstacles and provide real-time alerts. The methodology effectively minimizes the risk of
collisions by detecting obstacles within a 180-degree range.

2.2 Ultrasonic Sensor-Based Intelligent Vehicle Collision


Avoidance System
This paper discusses the development of a collision avoidance system for vehicles using ultrasonic
sensors. The system detects obstacles and alerts the driver to avoid potential accidents. It
explores the practical application of ultrasonic sensors in reducing vehicle collisions by processing
distance measurements and responding with appropriate warnings.

2.3 Obstacle Detection and Avoidance System for Au-


tonomous Vehicles: A Review
This review paper focuses on obstacle detection and avoidance systems for autonomous vehicles.
It covers different sensing technologies and approaches used for detecting and avoiding obstacles
in autonomous driving applications.

3
2.4 An Ultrasonic Sensor Based Obstacle Avoidance Sys-
tem for Visually Impaired People
The paper proposes an obstacle avoidance system for visually impaired individuals using
ultrasonic sensors. It discusses the design and implementation of the system, which helps
visually impaired individuals navigate their surroundings safely.

2.5 A Study on Ultrasonic Sensors for Obstacle Detection


in Vehicles
This review focuses on the capabilities of ultrasonic sensors in vehicle obstacle detection systems.
It outlines how ultrasonic waves detect objects by measuring the time it takes for sound waves
to reflect back, making it an essential technology in collision avoidance. The paper discusses
applications ranging from autonomous vehicles to simple parking assistance systems.

2.6 Real-Time Vehicle Obstacle Detection and Avoidance


using Arduino and Ultrasonic Sensors
This paper presents a system where ultrasonic sensors are used to detect obstacles in real-time.
The system integrates with an Arduino microcontroller to process the data and control a vehicle’s
response, such as stopping or turning to avoid a detected obstacle. It highlights the simplicity
and effectiveness of the ultrasonic sensor-based system in preventing vehicle collisions.

2.7 An Ultrasonic Sensor-Based Parking Assistance Sys-


tem
This paper discusses the use of ultrasonic sensors to assist drivers in parking by detecting nearby
obstacles. The system provides real-time feedback on the distance between the vehicle and any
obstacles, helping the driver park safely. The research highlights the importance of ultrasonic
sensors in applications where precise distance measurement is critical.

4
2.8 Arduino-Based Obstacle Avoidance for Autonomous
Vehicles
This research explores the development of an Arduino-based system for autonomous vehicles
that relies on ultrasonic sensors for obstacle detection. The paper discusses how the system
continuously monitors the surroundings, calculates the distance of obstacles, and controls the
vehicle’s movements to avoid collisions. It emphasizes the versatility and low cost of ultrasonic
sensors in autonomous systems.

2.9 Ultrasonic Sensor-Based Intelligent Parking Assist


System
This paper focuses on an ultrasonic sensor-based intelligent parking assist system. It discusses
the design and implementation of the system, which assists drivers in parking their vehicles
safely and accurately.

2.10 Development of an Ultrasonic Sensor-Based Intelli-


gent Vehicle Collision Avoidance System
The paper presents the development of an intelligent vehicle collision avoidance system using
ultrasonic sensors. It discusses the design and implementation of the system, which helps detect
obstacles and avoid collisions.

5
Chapter 3: Approach

1. Sensor Integration: Connect the ultrasonic sensor to the Arduino UNO to enable
distance measurement for detecting obstacles. This sensor uses sound waves to measure
the proximity of objects in real-time, providing essential data for navigation and obstacle
avoidance.

2. Distance Measurement: Program the Arduino to send and receive ultrasonic pulses
to calculate the distance between the vehicle and any detected obstacle. The sensor
measures the time delay between emitted and reflected sound waves to determine distance
accurately.

3. Real-Time Monitoring: Continuously monitor distance readings to ensure the system


provides real-time obstacle detection, enhancing safety by allowing prompt responses to
nearby obstacles.

4. Condition-Based Response: Use conditional statements in the program to check if


an obstacle is within a specified critical range. When an obstacle is detected within this
range, the system prepares to activate safety measures.

5. Alert Mechanism: Trigger a buzzer alert if an obstacle is within the set critical range,
providing an immediate audio warning to the driver or user. This alert ensures quick
reaction to potential hazards.

6. Ignition and Brake Controls: Integrate ignition and brake switches with the Arduino
to allow automated responses based on distance readings. The system can slow down or
stop the vehicle to avoid collisions.

7. Additional Safety Enhancements: Integrate a relay module to control high-power


components like a water pump if needed. The relay acts as a switch to ensure that the
Arduino can manage high-power devices safely.

6
8. IoT Integration: Use a networking module like the ESP8266 to enable IoT connectivity,
allowing remote monitoring and data transmission for real-time safety management. This
integration supports advanced applications in smart safety and autonomous navigation.

7
Chapter 4: Hardware Components

4.1 Arduino UNO


The Arduino Uno is a microcontroller board based on the ATmega328.It has 14 digital in-
put/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. Arduino board
designs use a variety of microprocessors and controllers.
The boards are equipped with sets of digital and analog input/output (I/O) pins that may
be interfaced to various expansion boards or breadboards (shields) and other circuits. The
boards feature serial communications interfaces, including Universal Serial Bus (USB) on some
models, which are also used for loading programs from personal computers.
The microcontrollers are typically programmed using a dialect of features from the pro-
gramming languages C and C++. In addition to using traditional compiler toolchains the
Arduino project provides an integrated development environment (IDE) based on the Processing
language project.
Most Arduino boards consist of an Atmel 8-bit AVR microcontroller (Atmega8, Atmega168,
Atmega328, Atmega1280, Atmega2560) with varying amounts of flash memory, pins, and features.
The 32-bit Arduino Due, based on the Atmel SAM3X8E was introduced in 2012. The boards
use single or double-row pins or female headers that facilitate connections for programming and
incorporation into other circuits. These may connect with add-on modules termed shields.
Multiple and possibly stacked shields may be individually addressable via an I²C serial
bus. Most boards include a 5V linear regulator and a 16 MHz crystal oscillator or ceramic
resonator. Some designs, such as the LilyPad, run at 8 MHz and dispense with the onboard
voltage regulator due to specific form-factor restrictions.
Arduino microcontrollers are pre-programmed with a boot loader that simplifies uploading
of programs to the on-chip flash memory. The default bootloader of the Arduino UNO is the 7
optiboot bootloader Boards are loaded with program code via a serial connection to another

8
computer.
Some serial Arduino boards contain a level shifter circuit to convert between RS-232
logic levels and transistor-transistor logic (TTL) level signals. Current Arduino boards are
programmed via Universal Serial Bus (USB), implemented using USB-to-serial adapter chips
such as the FTDI FT232. Some boards, such as later-model Uno boards, substitute the FTDI
chip with a separate AVR chip containing USB-to-serial firmware, which is reprogrammable via
its own ICSP header.
Other variants, such as the Arduino Mini and the unofficial Boarduino, use a detachable
USB to-serial adapter board or cable, Bluetooth, or other methods. When used with traditional
microcontroller tools, instead of the Arduino IDE, standard AVR in-system programming (ISP)
programming is used.

Figure 4.1: Diagram of Arduino Uno

Figure 4.2: PIN Layout of Arduino Uno

9
Vin: The input voltage or Vin to the Arduino while it is using an exterior power supply opposite
to volts from the connection of USB or else RPS (regulated power supply). By using this pin,
one can supply the voltage.

5Volts: The RPS can be used to give the power supply to the microcontroller as well as
components which are used on the Arduino board. This can approach from the input voltage
through a regulator.

3V3: A 3.3 supply voltage can be generated with the onboard regulator, and the highest draw
current will be 50 mA.

GND: GND (ground) pins.

Memory: The memory of an ATmega328 microcontroller includes 32 KB, and 0.5 KB memory
is utilized for the bootloader. It also includes SRAM-2 KB as well as EEPROM-1 KB.

Input and Output: The Arduino Uno R3 includes 14 digital pins that can be used as
input or output by using functions such as pinMode(), digitalRead(), and digitalWrite().
These pins operate with 5V, and each pin can give or receive 20mA, with an internal pull-up
resistor of 20k to 50k ohms. The maximum current on any pin is 40mA to avoid damaging the
microcontroller.

Serial Pins: The serial pins (TX-1 and RX-0) are used to transfer TTL serial data. They
connect to the equivalent pins of the ATmega8 U2 USB-to-TTL chip.

External Interrupt Pins: Pins 2 and 3 are external interrupt pins, which can be used to
trigger interrupts on rising or falling edges, or on value changes.

PWM Pins: The PWM pins (3, 5, 6, 9, 10, 11) provide 8-bit PWM output using the
analogWrite() function.

SPI Pins: The SPI pins (10, 11, 12, 13) are used for SPI communication via the SPI library.
These pins are named SS, MOSI, MISO, and SCK.

LED Pin: Pin 13 has an onboard LED, which lights up when the pin is set to HIGH.

TWI (2-Wire Interface) Pins: The TWI pins are SDA (A4) and SCL (A5), which support
TWI communication via the Wire library.

AREF Pin: This pin provides an analog reference voltage to the analog input pins when using
the analogReference() function.

10
Reset (RST) Pin: The reset pin can be used to reset the microcontroller. This is particularly
useful with shields that might block the reset button on the board.

Communication: The Arduino Uno supports SPI, I2C, and UART serial communication
protocols.

UART: The UART communication uses TX (pin 1) and RX (pin 0) for TTL serial communica-
tion.

I2C: I2C communication uses SDA (A4) and SCL (A5) pins, with the Wire library handling
the communication.

SPI Pins: The SPI communication protocol uses the MOSI (pin 11), MISO (pin 12), and SCK
(pin 13) pins.

MOSI (Pin 11): This is the Master Out Slave In pin, used to transmit data to connected
devices.

MISO (Pin 12): This is the Master In Slave Out pin, which receives data from connected
devices.

SCK (Pin 13): The Serial Clock (SCK) pin synchronizes the data transmission between
devices.

ICSP Header: The ICSP header can be used to directly program the ATmega microcontroller
without using the bootloader.

4.2 Ultrasonic Sensor


An ultrasonic sensor is an instrument that measures the distance to an object using ultrasonic
sound waves. An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that
relay back information about an object’s proximity.
The ultrasonic sensor works on the principle of SONAR and RADAR system which is used
to determine the distance to an object. An ultrasonic sensor generates the high-frequency sound
(ultrasound) waves. When this ultrasound hits the object, it reflects as echo which is sensed
by the receiver. Ultrasonic sensors work by emitting sound waves at a frequency too high for
humans to hear.
They then wait for the sound to be reflected back, calculating distance based on the time
required. This is similar to how radar measures the time it takes a radio wave to return after

11
hitting an object. While some sensors use a separate sound emitter and receiver, it’s also
possible to combine these into one.
For ultrasonic sensing, the most widely used range is 40 to 70 kHz. The frequency determines
range and resolution; the lower frequencies produce the greatest sensing range. At 58 kHz, a
commonly used frequency, the measurement resolution is one centimetre (cm), and range is
up to 11 meters having an ultrasonic element alternate between emitting and receiving signals.
This type of sensor can be manufactured in a smaller package than with separate elements,
which is convenient for applications where size is at a premium.
Ultrasonic sensors are used around the world, indoors and outdoors in the harshest conditions,
for a variety of applications. Our ultrasonic sensors, made with piezoelectric crystals, use high
frequency sound waves to resonate a desired frequency and convert electric energy into acoustic
energy, and vice versa.

Figure 4.3: Ultrasonic sensor

4.3 DC Gear Motors


A machine that converts DC power into mechanical power is known as a DC motor. Its operation
is based on the principle that when a current carrying conductor is placed in a magnetic field,
the conductor experiences a mechanical force. DC motors have a revolving armature winding
but non-revolving armature magnetic field and a stationary field winding or permanent magnet.
Different connections of the field and armature winding provide different speed/torque regulation
features. The speed of a DC motor can be controlled by changing the voltage applied to the
armature or by changing the field current. A gear motor is a specific type of electrical motor
that is designed to produce high torque while maintaining a low horsepower, or low speed, motor
output. Gear motors can be found in many different applications and are probably used in many

12
devices in your home. Gear motors are commonly used in devices such as can openers, garage
door openers, washing machine time control knobs, and even electric alarm clocks. Common
commercial applications of a gear motor include hospital beds, commercial jacks, and cranes.
Regardless of what type of gear motor you’re dealing with, they all work in the same manner.
Gear motors are commonly used in commercial applications where a piece of equipment needs
to be able to exert a high amount of force in order to move a very heavy object.

Figure 4.4: DC Gear Motor Working

4.4 DC Jack
A DC connector (or DC plug, for one common type of connector) is an electrical connector for
supplying direct current (DC) power.
Compared to domestic AC power plugs and sockets, DC connectors have many more standard
types that are not interchangeable. The dimensions and arrangement of DC connectors can
be chosen to prevent accidental interconnection of incompatible sources and loads. Types vary
from small coaxial connectors used to power portable electronic devices from AC adapters to
connectors used for automotive accessories and for battery packs in portable equipment.

13
Figure 4.5: DC Jack Connector for Power Supply

4.5 Connecting Wire


Connecting wires allows an electrical current to travel from one point on a circuit to another
because electricity needs a medium through which it can move. Most of the connecting wires
are made up of copper or aluminium. Copper is cheap and good conductivity.
The Function of Connecting Wires. Connecting wires provide a medium to an electrical
current so that they can travel from one point on a circuit to another. In the case of computers,
wires are embedded into circuit boards to carry pulses of electricity.

Figure 4.6: connecting wire

4.6 Soldering Iron


Connecting wires allows an electrical current to travel from one point on a circuit to another
because electricity needs a medium through which it can move. Most of the connecting wires

14
are made up of copper or aluminium. Copper is cheap and good conductivity.
The Function of Connecting Wires. Connecting wires provide a medium to an electrical
current so that they can travel from one point on a circuit to another. In the case of computers,
wires are embedded into circuit boards to carry pulses of electricity.

Figure 4.7: Soldering Iron

4.7 Solder Wire


Solder is a fusible alloy used to join less fusible metals or wires, etc. Solder wire is comprised of
different alloys, or of pure tin. Each metal requires a certain type of soldering wire to create
strong bonds, because the combinations of metals that comprise soldering wire melt at different
temperatures.

15
Figure 4.8: Solder Wire

4.8 3.7V Battery


A 3.7V 2000mAh lithium-ion battery is a rechargeable energy storage device commonly used
in portable electronics, electric vehicles, IoT devices, and more. Lithium-ion (Li-ion) batteries
are known for their high energy density, low self-discharge rate, and ability to be recharged
multiple times. In this battery, 3.7V refers to its nominal voltage, which indicates the typical
voltage output during its discharge cycle. 2000mAh (milliampere-hours) represents the battery’s
capacity, which means it can provide 2000mA of current for one hour or a proportionate amount
of current over a longer period. For example, it can deliver 1000mA for two hours or 500mA for
four hours.
Lithium-ion batteries operate by moving lithium ions from the negative electrode (anode) to
the positive electrode (cathode) through an electrolyte during discharge, and the reverse happens
during charging. They are preferred due to their high energy density, making them compact and
lightweight compared to older technologies like nickel-cadmium (NiCd) and lead-acid batteries.
In this project, the 3.7V 2000mAh lithium-ion battery will power the obstacle detection
system for vehicles. Additionally, the battery can be recharged using solar panels, ensuring
continuous power supply and operation without frequent manual recharging, making it ideal
for IoT-based, energy-efficient systems. These batteries are also known for their long cycle life,
usually lasting several hundred to a thousand charge cycles before their capacity diminishes
noticeably.
Applications of lithium-ion batteries include smartphones, laptops, electric vehicles, and

16
many embedded systems in IoT due to their lightweight and long-lasting charge capabilities.

Figure 4.9: Li-ion battery

17
Chapter 5: Software Components

5.1 Software Requirements

5.1.1 Arduino IDE

The ATMega328p microcontroller IC with Arduino bootloader makes a lot of work easier in this
project as Arduino code is written in C++ with an addition of special methods and functions,
which we’ll mention later on. C++ is a human-readable programming language. When you
create a ‘sketch’ (the name given to Arduino code files), it is processed and compiled to machine
language.
The Arduino Integrated Development Environment (IDE) is the main text editing program
used for Arduino programming. It is where you’ll be typing up your code before uploading it to
the board you want to program. Arduino code is referred to as sketches.

Figure 5.1: IDE

18
Listing 5.1: Obstacle Detection and Response Code
# define trigPin 9
# define echoPin 10
# define motor 4
# define buzzer 8

void setup ()
{
pinMode ( trigPin , OUTPUT ) ;
pinMode ( echoPin , INPUT ) ;
pinMode ( motor , OUTPUT ) ;
pinMode ( buzzer , OUTPUT ) ;
}

void loop ()
{
long duration , distance ;

// Generate an ultrasonic pulse


digitalWrite ( trigPin , LOW ) ;
dela yMicro second s (2) ;
digitalWrite ( trigPin , HIGH ) ;
dela yMicro second s (10) ;
digitalWrite ( trigPin , LOW ) ;

// Measure the duration of the pulse ’s return


duration = pulseIn ( echoPin , HIGH ) ;

// Calculate distance in centimeters


distance = ( duration / 2) / 29.1;

// Check distance threshold


if ( distance < 20) // This is where checking the distance you can
change the value
{
digitalWrite ( motor , HIGH ) ; // When the distance is below 20 cm
digitalWrite ( buzzer , HIGH ) ;
}
else
{

19
digitalWrite ( motor , LOW ) ; // When the distance is greater than
20 cm
digitalWrite ( buzzer , LOW ) ;
}

delay (500) ;
}

20
Chapter 6: Working

6.1 Working of the System

6.1.1 1. Obstacle Detection

The system employs an HC-SR04 ultrasonic sensor to detect obstacles. The ultrasonic sensor
operates by emitting high-frequency sound waves and measuring the time taken for the waves to
reflect back after hitting an object. This principle, based on SONAR and RADAR technologies,
allows the system to calculate the distance to the obstacle accurately.

a. Sensor Mechanism

The ultrasonic sensor has two primary components:

• Transmitter (Trig Pin): Emits ultrasonic waves.

• Receiver (Echo Pin): Detects the reflected waves.

When the transmitter emits a sound wave, it travels through the air, hits an obstacle, and
returns as an echo. The time taken for the echo to return is recorded, and the distance is
calculated using the formula:

Time × Speed of Sound


Distance =
2
This division by 2 accounts for the round trip of the sound wave.

b. Real-Time Monitoring

The Arduino UNO microcontroller continuously sends pulses through the trig pin of the ultrasonic
sensor. The microcontroller monitors the echo pin for the reflected signal. Each pulse cycle
ensures that the system maintains a constant awareness of its surroundings, with the distance
data updated multiple times per second.

21
6.1.2 2. Obstacle Response

Once the system identifies an obstacle within the critical distance of 20 cm, it executes a series
of predefined responses to ensure safety.

a. Distance-Based Conditional Response

The Arduino is programmed with conditional logic to evaluate the measured distance. If the
distance is less than or equal to 20 cm, the system enters a response state.

b. Alert Mechanism

The first line of defense is an audible alert triggered by a buzzer. The buzzer serves as a warning
signal to the driver or user, indicating the immediate presence of an obstacle. This simple yet
effective feature ensures that the user is promptly informed and can take corrective action.

c. Automatic Brake Activation

For enhanced safety, the system is equipped to control the vehicle’s brakes. When the obstacle
is detected within the critical range:

• The Arduino reduces the vehicle’s speed gradually to avoid abrupt stopping, ensuring
passenger comfort and safety.

• The system activates the brake switch, bringing the vehicle to a complete stop if the
obstacle remains within range.

6.1.3 3. Ignition and Emergency Controls

In addition to the obstacle detection and braking mechanisms, the system incorporates ignition
and emergency stop functionalities.

• Ignition Control: The system ensures that the vehicle’s ignition can be controlled based
on the sensor data. For instance, if an obstacle is persistently detected, the ignition can
be prevented from starting until the path is cleared.

• Emergency Stop: The system features a manual emergency stop button, allowing the
driver to override the automated controls if necessary.

22
6.1.4 4. Software and Hardware Coordination

The integration of hardware components and software algorithms ensures smooth operation.
Key components include:

• Arduino UNO Microcontroller: Acts as the brain of the system, processing sensor
data and executing commands.

• HC-SR04 Ultrasonic Sensor: Responsible for detecting obstacles and providing distance
measurements.

• Relay Module: Enables control of external devices like the brakes and ignition.

• Buzzer: Provides audible alerts to the driver.

• Power Supply (3.7V Battery): Ensures uninterrupted operation of the system.

The Arduino code is structured to handle real-time data from the sensor while maintaining
high reliability and accuracy. The system’s programming is optimized to minimize latency,
ensuring rapid responses in critical situations.

6.1.5 5. Performance and Testing

The system was rigorously tested under various scenarios, including:

• Different Distances: Ensuring consistent detection at and below the critical threshold
of 20 cm.

• Obstacle Materials: Testing the system’s response to obstacles made of different


materials, such as metal, wood, and plastic.

• Environmental Conditions: Verifying the system’s performance in varying light,


temperature, and humidity conditions.

The results demonstrated high accuracy and reliability, with the system successfully detecting
obstacles and triggering appropriate responses in all test cases.

23
Figure 6.1: Arduino UNO and HC-SR04 Ultrasonic Sensor Wiring Diagram

24
Chapter 7: Block Diagram

Figure 7.1: Block Diagram

25
Chapter 8: Designed Prototype

Figure 8.1: Designed Prototype

26
Chapter 9: Conclusion

In conclusion, the development of the obstacle detection and alert system using an ultrasonic
sensor and buzzer marks a significant step toward enhancing road safety, especially for applica-
tions where low-cost and efficient solutions are critical. The system efficiently detects obstacles
in the path of a vehicle and alerts the driver through an audible signal, providing sufficient time
to react and prevent potential collisions. By utilizing the Arduino UNO as the controller and
incorporating the ultrasonic sensor for distance measurement, this system demonstrates how
simple microcontroller-based designs can address real-world problems in vehicle safety.
The core functionality of the system is rooted in the ultrasonic sensor’s ability to measure
the distance to nearby objects by emitting sound waves and calculating the time taken for
the waves to reflect back after hitting an obstacle. The Arduino UNO continuously processes
this data and triggers the buzzer when the distance to an obstacle falls within a pre-defined
threshold, indicating the presence of a potential hazard.
Through the integration of these components and the utilization of intelligent control
algorithms, our system showcased the potential of microcontroller-based systems in improving
driver safety. It addressed critical challenges on the road by proactively detecting and responding
to obstacles.
The project highlighted the importance of incorporating advanced technologies and intelligent
systems in vehicles to prevent accidents and mitigate risks. By leveraging the capabilities of
the Arduino UNO microcontroller, ultrasonic sensor, we demonstrated the feasibility and
effectiveness of our safety system.
In conclusion, our project successfully addressed the need for improved road safety by
providing a practical solution for obstacle detection. The system’s effectiveness and potential
for wider applications make it a valuable contribution to the field of intelligent transportation
systems and driver safety.

27
Chapter 10: Future Recommendations

10.1 Integration of Multiple Sensors


To improve the accuracy and reliability of the obstacle detection system, integrating additional
sensors like cameras and radar alongside the existing ultrasonic sensors is recommended. This
combination can enhance performance, particularly in complex or adverse weather conditions
such as fog, rain, or snow. Cameras provide visual data for recognizing obstacles, while radar is
useful for detecting objects at longer distances in poor visibility.

10.2 Development of Advanced Algorithms


The future system can benefit from more sophisticated algorithms for data analysis. Incor-
porating machine learning or AI-based models can enable the system to make real-time,
informed decisions, such as adjusting vehicle speed and trajectory based on the detected obstacles
and driver state. This could significantly improve the system’s decision-making capabilities and
adaptability to various driving conditions.

10.3 Integration with Existing Vehicle Safety Systems


The developed safety system should be integrated with existing vehicle technologies like Anti-
lock Braking Systems (ABS) and Collision Avoidance Systems. Such integration would
enable seamless communication between systems and provide faster, automated responses to
obstacles. For example, automatic braking or steering adjustments could be made if the system
detects a potential collision.

28
10.4 Intuitive and User-Friendly Interface
Designing a more intuitive and user-friendly interface is critical for driver interaction. A
visual display or auditory alerts can be used to keep the driver informed about the system’s
actions, obstacles detected, and the current status of the vehicle. A non-intrusive, easy-to-
understand interface would help drivers respond promptly to the system’s alerts.

10.5 Integration with Connected Vehicle Technologies


The safety system should be integrated with connected vehicle technologies, allowing
real-time communication with other vehicles, infrastructure, or cloud-based services. This would
allow the system to share information, such as detected obstacles, with nearby vehicles and
traffic management systems, enabling collaborative accident avoidance and improving road
safety.

10.6 Compliance with Safety Standards and Regulations


It is essential to ensure that the developed system adheres to relevant automotive safety
standards and regulations, such as ISO 26262 for functional safety. The system must
undergo rigorous testing and validation procedures to demonstrate its reliability and compliance
with industry standards. This would ensure its safety, effectiveness, and legal acceptance for
widespread use.

10.7 Real-Time Data Analysis and Cloud Integration


Incorporating cloud-based data storage and analysis would allow the system to collect
and process large volumes of data in real-time. This data can be used to refine the obstacle
detection algorithms and improve system accuracy over time. Real-time cloud integration could
also enable remote diagnostics and system updates to ensure the vehicle always operates with
the latest software improvements.

29
10.8 Predictive Maintenance and System Health Moni-
toring
The safety system could include predictive maintenance features to monitor the health of
the vehicle’s sensors and components. By using data from the system and sensors, the system
could anticipate potential failures and notify the driver in advance. This would allow for timely
maintenance and prevent failures that might compromise safety.

10.9 Improved Power Efficiency and Low-Voltage Opera-


tion
In the future, focusing on power efficiency will be essential, particularly as the number of
sensors and computational components increases. The system should be optimized to function
effectively with low power consumption, extending the vehicle’s battery life in electric vehicles
or reducing strain on the vehicle’s power systems in traditional vehicles. Energy-efficient designs
would ensure that the safety system remains active and responsive without affecting the vehicle’s
performance.

10.10 Real-Time Vehicle-to-Infrastructure Communica-


tion
Future enhancements could include Vehicle-to-Infrastructure (V2I) communication, allow-
ing the vehicle to communicate directly with traffic lights, road signs, and other infrastructure.
This can help anticipate upcoming obstacles such as traffic congestion, construction zones, or
accidents, and enable the system to make more informed decisions to avoid potential hazards.

30
Bibliography

[1] S. Sultana, R. H. Khondoker, and N. Javaid, ”A Review of Intelligent Driver Monitoring


Systems,” 2019.

[2] C. B. Patil and R. N. Awale, ”Real-Time Vehicle Detection, Tracking, and Counting of
Multiple Vehicles in Urban Traffic,” 2020.

[3] A. Gupta, A. Malhotra, and A. Sharma, ”Obstacle Detection and Avoidance System for
Autonomous Vehicles: A Review,” 2019.

[4] V. H. Rana, B. B. Boricha, and M. H. Marvaniya, ”An Ultrasonic Sensor Based Obstacle
Avoidance System for Visually Impaired People,” 2020.

[5] C. P. Abeyratne and A. D. Nugawela, ”Monitoring Driver Drowsiness using Electrooculogra-


phy Signals and Support Vector Machine,” 2013.

[6] M. M. Hamzah, H. A. Sulaiman, and N. F. Rosli, ”Review on Drowsy Driving Detection


Techniques,” 2019.

[7] R. S. Giri and S. S. Gunjal, ”Arduino-Based Vehicle Accident Detection and Reporting
System,” 2019.

[8] Y. Jia, X. Feng, and L. Zhang, ”Design of Driver Fatigue Monitoring System Based on Eye
Tracking,” 2016.

[9] M. A. Hossain, M. A. Rahim, and M. A. Hossain, ”Ultrasonic Sensor-Based Intelligent


Parking Assist System,” 2021.

[10] N. M. M. Tareque, M. A. Hossain, and M. A. Rahim, ”Development of an Ultrasonic


Sensor-Based Intelligent Vehicle Collision Avoidance System,” 2020.

31

You might also like