Technical ReportPDF Available

DISTANCE MEASUREMENT USING ULTRASONIC SENSOR & ARDUINO

Authors:

Abstract

The project is designed to measuring distance using ultrasonic waves and interfaced with arduino. We know that human audible range is 20hz to 20khz. We can utilize these frequency range waves through ultrasonic sensor HC-SR04.The advantages of this sensor when interfaced with arduino which is a control and sensing system, a pro per distance measurement can be made with new techniques. Ultrasonic sensors are first rate gear to degree distance without real touch and used at several places like water degree measurement, distance dimension etc. this is an efficient manner to measure small distances exactly. on this assignment we've got used an Ultrasonic Sensor to determine the space of an obstacle from the sensor. In many applications like vehicle control, medical applications, robotic movement control, etc distance measurement of an object is used. This can be done using a variety of sensors-Ultrasonic, IR, radar, laser, etc. Measurement using ultrasonic sensors is the cheapest and its reliability among several others is very high.In this project distance measurement and location of an object by using ultrasonic sensor and microcontroller is present.
1
DISTANCE MEASUREMENT USING ULTRASONIC
SENSOR & ARDUINO
Department of Information & Communication Technology
Microprocessor & Microcontroller Project Report
Under the Supervision of
Alimul Rajee
Lecturer
Department of Information & Communication Technology
Prepared By
Team- J
Team Member
Student ID
11909018
11909034
11909030
11909051
Date of Submission: May,2022
2
CERTIFICATE OF APPROVAL
This is to certify that the project titled Distance Measurement using Ultrasonic Sensor and
Arduino carried out by Jasmine Akter,Maria Nusrat,Md Rasel Hossain,Mehedi Hasan Sakib,
for the partial fulfillment of the requirements of Microprocessor & Microcontroller based
project.the dissertation has been carried out under my guidance and is record of the authentic
work carried out successfully.
...............................................................
Alimul Rajee
Lecturer
Dept. of ICT
Comilla University.
3
DECLARATION
“We Do hereby declare that this submission is our own work conformed to the norms and
guidelines is given by our supervisor and that, to the best of our knowledge and belief, it
contains no material previously written by another neither person nor material (data, theoretical
analysis, figures, and text) which has been accepted for the award of any other degree or diploma
of the university or other institute of higher learning, except where due acknowledgement has
been made in the text.”
..........................................................
Jasmine Akter
ID-11909018 Session-2018-19
Dept.of ICT,Comilla University
..........................................................
Maria Nusrat
ID-11909034 Session-2018-19
Dept.of ICT,Comilla University
..........................................................
Md Rasel Hossain
ID-11909030 Session-2018-19
Dept.of ICT,Comilla University
Date :May,2022
..........................................................
Mehedi Hasan Sakib
ID-11909051 Session-2018-19
Dept.of ICT,Comilla University
4
ABSTRACT
Nowadays, we have some difficulties in obtaining the distance that we want to measure. Even
though, measuring tape is an easy option, but this kind of tool will have a limitation of manual
error.
The project is designed to measuring distance using ultrasonic waves and interfaced with
arduino. We know that human audible range is 20hz to 20khz. We can utilize these frequency
range waves through ultrasonic sensor HC-SR04.The advantages of this sensor when interfaced
with arduino which is a control and sensing system, a pro per distance measurement can be made
with new techniques. Ultrasonic sensors are first rate gear to degree distance without real touch
and used at several places like water degree measurement, distance dimension etc. this is an
efficient manner to measure small distances exactly. on this assignment we've got used an
Ultrasonic Sensor to determine the space of an obstacle from the sensor.
In many applications like vehicle control, medical applications, robotic movement control, etc.;
distance measurement of an object is used. This can be done using a variety of sensors-
Ultrasonic, IR, radar, laser, etc. Measurement using ultrasonic sensors is the cheapest and its
reliability among several others is very high.
In this project distance measurement and location of an object by using ultrasonic sensor and
microcontroller is present.
5
TABLE OF CONTENT
CHAPTER
CHAPTER NAME
PAGE
CERTIFICATE
2
DECLARATION
3
ABSTRACT
4
ACKNOWLEDGEMENT
8
LIST OF ABBREVIATIONS
9
LIST OF FIGURES
10
LIST OF TABLES
11
01.
CHAPTER 1 INTRODUCTION
12-13
1.1. Problem statement
13
1.2. Necessity of the project
13
02.
CHAPTER 2 LITERATURE SERVEY
14
03.
CHAPTER 3 SYSTEM DESCRIPTION
15-54
3.1 Components Used
15
3.2 Arduino(uno)
3.2.1 Introduction
16
3.2.2. NEED FOR ARDUINO
17
3.2.3. TYPE OF ARDUINO BOARDS
18
3.2.4. ELEMENTS OF ARDUINO BOARDS
19
3.2.4.1. Hardware
20
3.2.4.2. Software
22
3.2.4.3. Features of Arduino IDE
22
3.2.5. PROGRAMMING BASICS
23
3.2.6. APPLICATIONS
25
6
CHAPTER
CHAPTER NAME
PAGE
3.2.7 Pin diagram
26
3. 2.8 Key Parameters
27
3.3 Ultrasonic Sensor
3.3.1. Introduction
28
3.3.2 Electrical Parameter
28
3.3.3 Working
28
3.3.4. HC-SR04 Specifications
30
3.3.5. Timing Chart and Pin Explanations
31
3.3.6. Operation
32
3.4. LASER DIODE MODULE
3.4.1 Definition
35
3.4.2. Construction of Laser diode
35
3.4.3. Working of Laser diode
36
3.4.4. Major Categories of Laser Diode
39
3.4.5. Laser Diode L-I Characteristics
40
3.4.6. Advantages & Disadvantage of Laser Diode
41
3.4.7. Applications of Laser diode
41
3.5. LCD Display
3.5.1. INTRODUCTION
42
3.5.2. Specifications of LCD 16X2
42
3.5.3. LCD 16X2 Pin Configuration
43
3.5.4. LCD 16X2 Commands
44
3.5.5.Working Principle
45
3.6. SWITCH
3.6.1. INTRODUCTION
47
3.6.2.Characteristics of a Switch
47
3.6.3.Types of Switches
48
3.6.6.Bipolar Transistors
49
7
CHAPTER
CHAPTER NAME
PAGE
3.7. JUMPER WIRE
3.7.1. INTRODUCTION
51
3.7.2. Types of Jumper Wires
52
3.8. BATTERY
3.8.1.INTRODUCTION
53
3.8.2. Battery Basics
53
04.
CHAPTER 4 SOFTWARE DESCRIPTION
55-61
4.1. Arduino IDE
4.1.1 Introduction
55
4.1.2 Programming Language used
55
4.1.3 Getting started with arduino ide
56
4.1.4. Features of Arduino IDE
59
4.2 Processing IDE
4.2.1 Introduction
59
4.2.2 Processing Software
59
4.2.3 Getting Started
60
4.3 How processing IDE communicate with Arduino IDE?
61
05.
CHAPTER 5 METHODOLOGY
62-64
5.1 Schematic Diagram
62
5.2 Implementation
63
06.
CHAPTER 6 RESULT
65
07.
CHAPTER 7 APPLICATION
66
08.
CHAPTER 8 CONCLUSION AND FUTURE SCOPE
67
8.1 Conclusion
67
8.2 Future scope
67
09.
CHAPTER 9-REFERENCE
68-70
8
ACKNOWLEDGEMENT
We take this opportunity to think certain people without whom this endeavor would not have
been possible. We would also express our thanks to the head of the Department. We would like
to express our sincere gratitude to our guide Alimul rajee sir for constant encouragement , help
and guidance without which this project would not have been completed.
We would like to express our sincere gratitude towards our supervisor for their constant support
and valuable advice throughout the progress of the project . Last but not the least , We express
our heartiest acknowledgment to our parents, friends and colleagues who directly or indirectly
helps us in completing this project.
9
LIST OF ABBREVIATIONS
LED: Light Emitting Diode
IDE: Intrigated development environment
LDR: Light Dependent Repeater
ISP: In- System programming
RX : Reciever
TX: Transmitter
ToF:Time of flight
IJCACS:International Journal of Control, Automation, Communication and Systems
ATS:Arduino Ethernet shield
AWS: Arduino Wireless shield
AMDS:Arduino Motor Driver Shield
USB:Universal serial bus
EPROM : Electrically Erasable Programmable Read Only Memory
SRAM: Static random acces memory
GPS: Ground
UAV: Unmanned aerial vehicle
HVAC:Heating, Ventilation, and Air Conditioning
MOSFET:Metal-oxide-semiconductor field-effect transistor
TRIAC:Triode for Alternating Current
10
LIST OF FIGURES
FIGURE
PAGE
Figure:3.2.3.1
18
Figure:3.2.5.1
23
Figure:3.2.5.2
24
Figure:3.2.5.4
25
Figure:3.2.7.1
26
Figure:3.3.3.1
28
Figure:3.3.3.2
29
Figure:3.3.5.1
31
Figure:3.3.1
32
Figure:3.3.2
33
Figure:3.3.3
34
Figure:3.4.2.1
36
Figure:3.4.3.1
37
Figure:3.4.3.2
38
Figure:
3.4.5.1
40
Figure:3.5.1.1
42
Figure:3.5.3.1
43
Figure:3.6.4.1
48
Figure:3.6.6.1
50
Figure:3.7.2
52
Figure:3.8.2.1
54
Figure:4.1.3.1
56
Figure:4.1.3.2
57
Figure:4.3.1
61
Figure:4.1.3.3
58
Figure:4.3.2.1
60
Figure:5.1.1
62
11
LIST OF TABLES
TABLE
TABLE NAME
PAGE
Table:3.2.3.1
Heading and text fonts
19
Table:3.2.8.1
Key Parameters
27
Table:3.5.4.1
LCD 16×2 commands
44
12
CHAPTER 1
INTRODUCTION
Distance measurement of an object in front or by the side of the moving entity is required in
large number of devices. These devices may be small or large and can be quite simple or
complicated. Distance measurement has important applications in automotive and industrial
applications. The distance measurement through sensors is useful in detecting obstacles.
It uses ultrasonic waves to search an object same as Bats uses sonar technique to communicate
with other bats. Bats are wonderful creatures. Blind from the eyes but the vision is sharper than
humans, Ultrasonic ranging is the technique used by bats. Ultrasonic sensor provides an easy
way in distance measurement. The sensor is perfect for distance measurements between moving
or stationary objects. Ultrasonic Sensor measure the distance of the objects in air through non-
contact technique. They measure distance without damage and are easy to use and reliable. [5]
In order to calculate the distance between the sensor and the object, the sensor measures the time
it takes between the emissions of the sound by the transmitter to its contact with the receiver. The
formula for this calculation is D = ½ T x C (where D is the distance, T is the time, and C is the
speed of sound ~ 343 meters/second). For example, if a scientist set up an ultrasonic sensor
aimed at a box and it took 0.025 seconds for the sound to bounce back, the distance between the
ultrasonic sensor and the box would be,
D = 0.5 x 0.025 x 343 or about 4.2875 meters.
An ultrasonic sensor emits sound waves toward an object and determines its distance by
detecting reflected waves Ultrasonic sensor diagram.(Robo Galaxy)Ultrasonic sensors are used
primarily as proximity sensors.[6]
13
1.1 Problem statement
A low cost distance measurement system using ultrasonic sensor which works good in different
light condition and has the capability to detect the distance of the object. The hardware utilized
included the Arduino Uno on a bread board interfaced with LCD, LEDs, Buzzer and Ultrasonic
sensor. The program to run the circuit was developed using Arduino IDE and stored at the
memory of the Arduino microcontroller. The study demonstrated that the designed sensor could
be used to accurately determine the position of an approaching object and display the distance
readings on the LCD display.[8]
1.2 Necessity of the project
The main objective of the project is to provide useful and low cost measurement system that is
easy to configure and handle. In this method of distance sensing and measurement is efficient
and assures measurements of small distances precisely. This distance sensing and measurement
system can get wide applications where proximity detection is required e.g. in industries and
traffic departments.[7]
14
CHAPTER 2
LITERATURE SURVEY
Latha, N. Anju, B. Rama Murthy, and K. Bharat Kumar try to develop an application which is
based upon the reflection of sound waves.They offer low cost and a precision of less than 1 cm
in distance measurements of up to 6m [9]. However, the most popular method used in these
measurements is based on the time of flight (ToF) measurement. This ToF is the time elapsed
between the emission and subsequent arrival after reflection of an Ultrasonic pulse train
travelling at the speed of sound. This causes large response times for a single measurement.[9]
Bereziuk, Oleh, et al. proposed a device that allows to measure the distances to obstacles for the
development of highly efficient dustcarts as the main link in the structure of machines for the
collection and primary processing of municipal solid wastes. A structural scheme of the device
and a block diagram of the program algorithm is also proposed that allows to control the
operation of the microcontroller of the device for distance measuring with consideration of
environmental parameters.[10]
Carullo, Alessio, and Marco Parvis develop an automotive application which is able to self-adapt
to the environmental conditions. The sensor contains a noise measurement system and an auto-
change facility of the signal that is used to drive the transmitter, thus producing the best accuracy
under different condition. Tests have been performed in real driving conditions and have shown
a regular behavior of the sensor under all typical driving maneuvers for speeds of up to 33 m/s
(120 km/h). The sensor features a simple and costless analog processing of the signal without
employing microprocessors.[11]
15
CHAPTER 3
SYSTEM DESCRIPTION
3.1 Components Used
1. Arduino uno
2. Ultrasonic Sensor
3. LCD Display
4. Laser Module
5. Jumper Wire
6. Switch
7. Battery
16
3.2 Arduino(uno)
3.2.1 Introduction
Arduino is an open source microcontroller which can be easily programmed, erased and
reprogrammed at any instant of time. Introduced in 2005 the Arduino platform was designed to
provide an inexpensive and easy way for hobbyists, students and professionals to create devices
that interact with their environment using sensors and actuators. Based on simple microcontroller
boards, it is an open source computing platform that is used for constructing and programming
electronic devices. It is also capable of acting as a mini computer just like other microcontrollers
by taking inputs and controlling the outputs for a variety of electronics devices. It is also capable
of receiving and sending information over the internet with the help of various Arduino shields,
which are discussed in this paper. Arduino uses a hardware known as the Arduino development
board and software for developing the code known as the Arduino IDE (Integrated Development
Environment). Built up with the 8-bit Atmel AVR microcontroller's that are manufactured by
Atmel or a 32-bit Atmel ARM, these microcontrollers can be programmed easily using the C or
C++ language in the Arduino IDE. Unlike the other microcontroller boards in India, the Arduino
boards entered the electronic market only a couple of years ago, and were restricted to small
scale projects only. People associated with electronics are now gradually coming up and
accepting the role of Arduino for their own projects. This development board can also be used to
burn (upload) a new code to the board by simply using a USB cable to upload. The Arduino IDE
provides a simplified integrated platform which can run on regular personal computers and
allows users to write programs for Arduino using C or C++. International Journal of Control,
Automation, Communication and Systems (IJCACS), Vol.1, No.2, April 2016 22 With so many
Arduino boards available in the market, selecting a particular development board needs a variety
of survey done with respect to their specifications and capabilities, which can be used for the
project execution according to its specified applications.[13]
17
3.2.2. NEED FOR ARDUINO
Why is there a need to use Arduino in specific? or What makes it different from others? Massimo
Banzi, a Co-founder of Arduino mentions some very important reasons for this question.
1) Active User Community: A group of people using a similar product can hold posted message
conversations and share their experiences or solve the problems of the other users in the
communities with their own experiences [13].
“If you start charging for everything, everything dies very quickly.” says Banzi, Arduino
Cofounder.
2) Growth of Arduino: Arduino was developed with intent to provide an economical and trouble-
free way for hobbyists, students and professionals to build devices that interact with their
situation using sensors and actuators. This makes it perfect for newcomers to get started
quickly[13].
3) Inexpensive Hardware: Since Arduino is an open source platform the software is not
purchased and only the cost of buying the board or its parts is incurred, thus making it very
cheap. The hardware designs are also available online for free from its official website [13].
4) Arduino Board as a Programmer: To make Arduino board function easy and also making it
available everywhere these boards come with a USB cable for power requirements as well as
functioning as a programmer [13].
5) Multi-platform Environment: The Arduino IDE is capable of running on a number of
platforms including Microsoft, Linux and Mac OS X making the user community even
larger[13].
18
3.2.3. TYPE OF ARDUINO BOARDS
Arduino boards are available with many different types of built-in modules in it. Boards such as
Arduino BT come with a built-in Bluetooth module, for wireless communication. These built-in
modules can also be available separately which can then be interfaced (mounted) to it. These
modules are known as Shield.
Some of the most commonly used Shields are:
Arduino Ethernet shield: It that allows an Arduino board to connect to the internet using the
Ethernet library and to read and write an SD card using the SD library [14].
Arduino Wireless shield: It allows your Arduino board to communicate wirelessly using
Zigbee [14].
Arduino Motor Driver Shield: It allows your Arduino boards to interface with driver of a
motor etc. [14]
International Journal of Control, Automation, Communication and Systems (IJCACS), Vol.1, No.2, April 2016
Fig. 3.2.3.1.Arduino Shields Ethernet, Wireless and Motor Driver
19
Here is a list of the different types of Arduino Boards available along with its microcontroller
type,crystal frequency and availabilities of auto reset facility:
Table :3.2.3.1. Heading and text fonts
Arduino Type
Microcontroller
Clock Speed
Arduino Uno
Arduino Duemilanove / ATmega328
Arduino Nano
Arduino Nano
Arduino Leonardo
Arduino Mini w/ ATmega328
Arduino Etherne
Arduino Fio
Arduino BT w/ ATmega328
LilyPad Arduino w/ ATmega328
Arduino Pro or Pro Mini
Arduino NG
ATmega328
ATmega328
ATmega328
ATmega2560
ATmega32u4
ATmega328
Equivalent to Arduino
ATmega328
ATmega328
ATmega328
ATmega328
ATmega8
16 MHz with auto-reset
16 MHz with auto-reset
16 MHz with auto-reset
16 MHz with auto-reset
16 MHz with auto-reset
16 MHz with auto-reset
UNO with an Ethernet shield
8 MHz with auto-reset
16 MHz with auto-reset
8 MHz (3.3V) with auto-reset
16 MHz with auto-reset
16 MHz with auto-reset
3.2.4. ELEMENTS OF ARDUINO BOARDS
Elements of an Arduino Board can be done into two categories:
• Hardware
• Software
20
3.2.4.1. Hardware
The Arduino Development Board consists of many components that together makes it work.
Here are some of those main component blocks that help in its functioning:
• Microcontroller: This is the heart of the development board, which works as a mini computer
and can receive as well as send information or command to the peripheral devices connected to
it. The microcontroller used differs from board to board; it also has its own various
specifications.
• External Power Supply: This power supply is used to power the Arduino development board
with a regulated voltage ranging from 9 12 volts.
USB plug: This plug is a very important port in this board. It is used to upload (burn) a
program to the microcontroller using a USB cable. It also has a regulated power of 5V which
also powers the Arduino board in cases when the External Power Supply is absent.
Internal Programmer: The developed software code can be uploaded to the microcontroller
via USB port, without an external programmer.
Reset button: This button is present on the board and can be used to resets the Arduino
microcontroller.
• Analog Pins: There are some analog input pins ranging from A0 A7 (typical). These pins are
used for the analog input / output. The no. of analog pins also varies from board to board.
21
• Digital I/O Pins: There are some digital input pins also ranging from 2 to 16 (typical). These
pins are used for the digital input / output. The no. of these digital pins also varies from board to
board.
•Power and GND Pins: There are pins on the development board that provide 3.3, 5 volts and
ground through them.
Fig. 3.2.4.1.A labled diagram of an Arduino Board and an IDE.
22
3.2.4.2. Software
The program code written for Arduino is known as a sketch. The software used for developing
such sketches for an Arduino is commonly known as the Arduino IDE. This IDE contains the
following parts in it:
• Text editor: This is where the simplified code can be written using a simplified version of C++
programming language.
• Message area: It displays error and also gives a feedback on saving and exporting the code.
Text: The console displays text output by the Arduino environment including complete error
messages and other information
• Console Toolbar: This toolbar contains various buttons like Verify, Upload, New, Open, Save
and Serial Monitor. On the bottom right hand corner of the window there displays the
Development Board and the Serial Port in use.
3.2.4.3. Features of Arduino IDE
Microcontroller: ATmega328
Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6
DC Current per I/O Pin: 40 mA
DC Current for 3.3V Pin: 50 mA
Flash Memory: 32 KB of which 0.5 KB used by bootloader
SRAM: 2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
Clock Speed: 16 MHz
23
3.2.5. PROGRAMMING BASICS
Now we’ll discuss about the programming techniques of Arduino sketch in the Arduino IDE. There are
two main parts every sketch will always have, they are:
• void setup ()
• void loop ()
1) void setup():
This is the first routine that begins when the Arduino starts functioning. This function is executed only
once throughout the entire program functioning.
The setup function contains the initialization of every pin we intend use in our project for input or
output. Here is an example of how it should be written:
Here the pin is the no. of the pin that is to be defined. INPUT / OUPUT correspond to the mode in which
the pin is to be used.
FIGURE:3.2.5.1
It also contains the initialization of the Serial Monitor. A serial monitor is used to know the data that are
being sent serially to any peripheral device.
Before using any variables for programming it is necessary to define them above the function “void
setup()”
24
2) void loop():
This function is the next important function in the Sketch. It consists of that part of the code that
needs to be continuously executed unlike the part of the code written in the setup function. An
example of a void loop is as follows:
FIGURE:3.2.5.2
Here digital Write is a function that writes a high or a low value to a digital pin. If the pin has
been
configured as an OUTPUT with pin Mode(), its voltage will be set to the corresponding value:
5V
(or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.
Similarly if there is a need for delay in the sketch then there is another function that creates a
delay in the execution of the code
FIGURE:3.2.5.3
This creates a delay in the execution of the program for the time period specified (in milliseconds).
Using the above two function lets create a sketch for blinking a led.
25
Fig. 3.2.5.4. Arduino Shields Ethernet, Wireless and Motor Driver
3.2.6. APPLICATIONS
Arduino has endless applications as it has been used extensively for creating projects by hobbyist,
amateurs and professional in various fields of engineering. Here are some of those amazing projects
that have been developed on an Arduino platform:
1. Arduino Satellite (ArduSat)
ArduSat is an open source satellite completely based on Arduino to create a stage for space discoveries.
Built by Spire previously known as NanoSatisfi, ArduSat collects various types of information’s from the
space environment, with the help of numerous sensors that includes temperature sensors, pressure sensors,
cameras, GPS, spectrometer, and magnetometer etc with its programmable Arduino processors [16].
This platform also allows common public to experiment their projects in space. ArduSat can be used for
photography from space, making a spectrograph of the sun, detecting high energy radiation, compiling
temperature readings and observing meteors etc. [15]
26
2. ArduPilot (ArduPilotMega - APM)
ArduPilot is an unmanned aerial vehicle (UAV) based on the open source platform and built
using Aruino Mega which is able to control independent multicopters, fixed-wing aircraft,
traditional helicopters and ground rovers. [17]It was created by the DIY Drones community in
2007 and was also an award winning platform of 2012 [17].[12]
3.2.7 Pin diagram
FIGURE:3.2.7.1
27
3. 2.8 Key Parameters
TABLE:3.2.8.1
28
3.3 Ultrasonic Sensor
3.3.1. Introduction
The HC-SR04 Ultrasonic Distance Sensor is an inexpensive device that is very useful for
robotics and test equipment projects. This tiny sensor is capable of measuring the distance
between itself and the nearest solid object. The HC-SR04 can be hooked directly to an Arduino
or other microcontroller and it operates on 5 volts.
This ultrasonic distance sensor is capable of measuring distances between 2 cm to 400 cm. It’s a
low current device so it’s suitable for battery powered devices.
3.3.2 Electrical Parameter
3.3.3 Working
Ultrasonic sensors use sound to determine the distance between the sensor and the closest object
in its path. How do ultrasonic sensors do this? Ultrasonic sensors are essentially sound sensors,
but they perate at a frequency above human hearing.
FIGURE:3.3.3.1
The sensor sends out a sound wave at a specific frequency. It then listens for that specific sound
wave to bounce off of an object and come back (Figure 1).
29
The sensor keeps track of the time between sending the sound wave and the sound wave
returning. If you know how fast something is going and how long it is traveling you can find the
distance traveled with equation 1.
Equation 1. d = v × t
The speed of sound can be calculated based on the a variety of atmospheric conditions, including
temperature, humidity and pressure. Actually calculating the distance will be shown later on in
this document.
It should be noted that ultrasonic sensors have a cone of detection, the angle of this cone varies
with distance, Figure 2 show this relation. The ability of a sensor to an object also depends on the
objects orientation to the sensor. If an object doesn’t present a flat surface to the sensor then it is
possible the sound wave will bounce off the object in a way that it does not return to the
sensor.[18]
FIGURE:3.3.3.2
30
3.3.4. HC-SR04 Specifications
The sensor chosen for the Firefighting Drone Project was the HC-SR04. This section contains
the specifications and why they are important to the sensor module. The sensor modules
requirements are as follows.
● Cost
● Weight
● Community of hobbyists and support
● Accuracy of object detection
● Probability of working in a smoky environment
● Ease of use
The HC-SR04 Specifications are listed below. These specifications are from the Cytron
Technologies HCSR04 User’s Manual (source 1).
● Power Supply: +5V DC
● Quiescent Current: <2mA
● Working current: 15mA
● Effectual Angle: <15º
● Ranging Distance: 2400 cm
● Resolution: 0.3 cm
● Measuring Angle: 30º
● Trigger Input Pulse width: 10uS
● Dimension: 45mm x 20mm x 15mm
31
● Weight: approx. 10 g [18]
3.3.5. Timing Chart and Pin Explanations
The HC-SR04 has four pins, VCC, GND, TRIG and ECHO; these pins all have different
functions. The VCC and GND pins are the simplest -- they power the HC-SR04. These pins need
to be attached to a +5 volt source and ground respectively. There is a single control pin: the
TRIG pin. The TRIG pin is responsible for sending the ultrasonic burst. This pin should be set to
HIGH for 10 μs, at which point the HC-SR04 will send out an eight cycle sonic burst at 40 kHZ.
After a sonic burst has been sent the ECHO pin will go HIGH. The ECHO pin is the data pin -- it
is used in taking distance measurements. After an ultrasonic burst is sent the pin will go HIGH, it
will stay high until an ultrasonic burst is detected back, at which point it will go LOW.[18]
FIGURE:3.3.5.1
32
3.3.6. OPERATION
Ultrasonic distance sensors use pulses of ultrasonic sound (sound above the range of human
hearing) to detect the distance between them and nearby solid objects.The device operates as
follows:
1. A 5 volt pulse of at least 10 uS (10 microseconds) in duration is applied to the Trigger pin.
2. The HC-SR04 responds by transmitting a burst of eight pulses at 40 KHz. This 8-pulse
pattern makes the “ultrasonic signature from the device unique, allowing the receiver to
discriminate between the transmitted pattern and the ultrasonic background noise.
3. The eight ultrasonic pulses travel through the air away from the transmitter. Meanwhile the
Echo pin goes high to start forming the beginning of the echo-back signal.
4. If the pulse in NOT reflected back then the Echo signal will timeout after 38 mS (38
milliseconds) and return low. This produces a 38 mS pulse that indicates no obstruction within
the range of the sensor.
5. If the pulse IS reflected back the Echo pin goes low when the signal is received. This
produces a pulse whose width varies between 150 uS to 25 mS, depending upon the time it took
for the signal to be received.
6. The width of the received pulse is used to calculate the distance to the reflected object. Remember
that the pulse indicates the time it took for the signal to be sent out and reflected back so to get the
distance you’ll need to divide your result in half.
33
Fig:3.3.2
34
The illustration below shows the dimensions of the HC-SR04 Ultrasonic Distance Sensor as
well as the effective angle of operation. As you can see the sensor is most accurate when the
object to be detected is directly in front of it but you do get a response from objects within a 45
degree “window”. The documentation recommends confining that window to 30 degrees
(15)degrees on either side) for accurate readings.
35
3.4. LASER DIODE MODULE
3.4.1 Definition
LASER is an acronym of Light amplification by stimulated emission of radiation. A laser diode
emits radiation of a single wavelength or sometimes a narrow band of closely spaced
wavelength.It emits light due to stimulated emission, in this when an incident photon strike
semiconductor atom, the electrons at higher energy level recombine with lower energy level
hole. Due to this two photons are emitted one incident photon and other is emitted due to
recombination of electrons and hole.
LEDs also work on the same principle but the major difference is the internal architecture. A
laser diode is formed from narrow channels and it acts as a waveguide for light. But LEDs is
made up of wide channels.
Due to its structure Laser diode emits coherent & monochromatic light (Single colour). The light
emitted by Laser diode consists of single wavelength while LEDs emit light consisting of a wide
band of wavelengths. Thus, the light emitted by LED is incoherent.
3.4.2. Construction of Laser diode
The Laser diode is made up of two layers of Semiconductors i.e. P-type and N-type. The layers
of semiconductors are made up of GaAs doped with materials like selenium, aluminium or
silicon. The construction is same as that of LED except the channels used in Laser are narrow to
produce a single beam of light.
And one more difference in a Laser diode is that an intrinsic layer of GaAs (undoped) is also
present. This layer is called active layer. The active layer is enclosed by layers of lower
refractive index. This act as optical reflectors.
36
FIGURE:3.4.2.1
These layers along with active layer form a waveguide so that light can travel only in a single
path in a single and fixed direction. The beam of light is produced in this section. The metal
contacts are provided to facilitate biasing.
3.4.3. Working of Laser diode
The laser diode works on the principle that every atom in its excited state can emit photons if
electrons at higher energy level are provided with an external source of energy.
37
FIGURE:3.4.3.1
There are basically three phenomena by which an atom can emit light energy and that
are Absorption, Spontaneous Emission & Stimulated emission.
38
FIGURE:3.4.3.2
Absorption
In absorption, the electrons at lower energy levels jump to higher energy level i.e. from valence
band to conduction band when the electrons are provided with an external source of energy.
Now, there are holes at lower energy level i.e. valence band and electrons at higher energy level
i.e. conduction band.
Spontaneous Emission
Now, if the electrons in higher energy level are unstable then they will tend to move to the lower
energy level in order to achieve stability. But if they will move from higher energy level to lower
energy levels they will definitely release the energy which will be the energy difference between
these two levels. The energy released will be in the form of light and thus photons will be
emitted. This process is called spontaneous emission.
39
Stimulated Emission
In stimulated emission, the photons strike electrons at higher energy level and these photons are
supplied from an external light energy source. When these photons strike the electrons, electrons
gain energy and they recombine with holes and release an extra photon. Thus, one incident
photon stimulates another photon to release. Thus, this process is called stimulated emission.
Population inversion
The density of electrons at energy levels is the population of electrons and it is more in valence
band or lower energy band and less in the conduction band or higher energy level. If the
population of electrons increases at higher energy level or the lifetime of higher energy states is
long then stimulated emission will increase. This increase of population at higher energy level is
termed as population inversion.And this is the requisite state for Laser diode. More the
population inversion more will be the electrons at higher and meta stable state and more will be
the stimulated emission. The photons emitted are in the same phase with the incident photons.
And these photons travel as a single beam of light and thus produce coherence.[19]
3.4.4. Major Categories of Laser Diode
There are two major categories of Laser Diode i.e. Injection Laser Diode & Optically Pumped
semiconductor laser diode.
1. Injection laser diode: The operation is similar to LED except that LEDs are formed by
wide channels of Semiconductor while Laser diodes are formed from narrow channels. We
have already discussed this in the construction of Laser Diode. In this, the light beam
travels in the waveguide and the diode itself acts as a waveguide. The light beam is
amplified by repeated stimulated emission.
2. Optically Pumped Semiconductor Laser: In optically pumped laser the injection laser
diode acts as an external pump. The III & V group semiconductor materials act as a basis.
And the amplification is achieved by stimulated emission.
It offers several advantages such as prevention from interference caused due to the electrode
structure. Besides, it also provides an advantage of wavelength selection.
40
3.4.5. Laser Diode L-I Characteristics
The light energy increases with increase in laser current but it is dependent on temperature. It is
evident from the curve that the light energy increases after a particular threshold laser current.
This threshold value of laser current increases exponentially with the temperature.
Thus, at a higher temperature, the threshold value of laser current up to which light energy is
generated, also increases. Thus, it is necessary to operate the laser diode up to threshold value of
laser current because above this value there is no light energy. In order to have a reliable
operation, it is necessary to determine the threshold value of laser current.[19]
V-I Characteristics of Laser diode
The forward voltage of laser diode is generally around 1.5 V. Although the forward voltage
depends on operating temperature. The variance of current in the diode with the voltage can be
understood with the help of below diagram.
FIGURE: 3.4.5.1
41
3.4.6. Advantages & Disadvantage of Laser Diode
Advantages
1. Low power Consumption device.
2. Economical as its cost of manufacturing and operation is low.
3. It can be operated for a long time.
4. Portable due to its small size and internal architecture.
5. Highly reliable and highly efficient.
Disadvantages
1. These are temperature dependent and thus its operation is affected by the change in
operating temperature.
2. It is not suitable for high power application.
3.4.7. Applications of Laser diode
1. Fibre optical communication system.
2. Barcode readers.
3. Laser Printing and laser scanning.
4. Rangefinders.
5. In medical fields in surgical instruments.
6. In CD players and DVD recorder.
These are some of the significant applications of the LASER diode. Amongst all of these
applications the most crucial realm in which laser diode finds its application is optical fibre
communication system.[19]
42
3.5. LCD Display
3.5.1. INTRODUCTION
An electronic device that is used to display data and the message is known as LCD 16×2. As the
name suggests, it includes 16 Columns & 2 Rows so it can display 32 characters (16×2=32) in
total & every character will be made with 5×8 (40) Pixel Dots. So the total pixels within this
LCD can be calculated as 32 x 40 otherwise 1280 pixels.
FIGURE:3.5.1.1: LCD 16 X2
16 X2 displays mostly depend on multi-segment LEDs. There are different types of displays
available in the market with different combinations such as 8×2, 8×1, 16×1, and 10×2, however,
the LCD 16×2 is broadly used in devices, DIY circuits, electronic projects due to less cost,
programmable friendly & simple to access.[16]
3.5.2. Specifications of LCD 16X2
The specifications of LCD 16X2 are discussed below.
The operating voltage of this display ranges from 4.7V to 5.3V
The display bezel is 72 x 25mm
The operating current is 1mA without a backlight
PCB size of the module is 80L x 36W x 10H mm
HD47780 controller
LED color for backlight is green or blue
43
Number of columns 16
Number of rows 2
Number of LCD pins 16
Characters 32
It works in 4-bit and 8-bit modes
Pixel box of each character is 5×8 pixel
Font size of character is 0.125Width x 0.200height
3.5.3. LCD 16X2 Pin Configuration
The pin configuration of LCD 16 X 2 is discussed below so that LCD 16×2 connection can be
done easily with external devices.
FIGURE:3.5.3.1: 16X2 LCD Pin Diagram
Pin1 (Ground): This pin connects the ground terminal.
Pin2 (+5 Volt): This pin provides a +5V supply to the LCD
Pin3 (VE): This pin selects the contrast of the LCD.
Pin4 (Register Select): This pin is used to connect a data pin of an MCU & gets either 1
or 0. Here, data mode = 0 and command mode =1.
Pin5 (Read & Write): This pin is used to read/write data.
Pin6 (Enable): This enables the pin must be high to perform the Read/Write procedure.
This pin is connected to the data pin of the microcontroller to be held high constantly.
44
Pin7 (Data Pin): The data pins are from 0-7 which are connected through the
microcontroller for data transmission. The LCD module can also work on the 4-bit mode
through working on pins 1, 2, 3 & other pins are free.
Pin8 Data Pin 1
Pin9 Data Pin 2
Pin10 Data Pin 3
Pin11 Data Pin 4
Pin12 Data Pin 5
Pin13 Data Pin 6
Pin14 Data Pin 7
Pin15 (LED Positive): This is a +Ve terminal of the backlight LED of the display & it is
connected to +5V to activate the LED backlight.
Pin16 (LED Negative): This is a -Ve terminal of a backlight LED of the display & it is
connected to the GND terminal to activate the LED backlight.[16]
3.5.4. LCD 16X2 Commands
The LCD 16×2 commands are discussed below.
HexCode 1
This command will remove data displaying on the screen ofLCD.
HexCode 2
It used to move return home.
HexCode 4
It is used to modify a cursor location to the left side.
HexCode 6
It is used to change the cursor location to the right side.
HexCode 5
It is used to shift the display to right.
HexCode 7
It used to shift the display to left.
HexCode 8
It is used to turn ON the cursor &turn off the display
HexCode 0A
It is used to turn OFF the cursor & turn oON the display
HexCode 0C
It is used to turn ON the display & blink the cursor.
HexCode 0E
It is used to turn ON display & blink the cursor
45
HexCode 0F
It changes the cursor location to left.
HexCode 10
It changes the cursor location to right.
HexCode 14
It changes the display location to the left side.
HexCode 18
It changes the display location to the right side.
HexCode 1C
It is used to shift the cursor to the primary line.
HexCode 80
It moves the cursor to the beginning of the next line
HexCode 38
2- lines & 5×7 matrix
Table:3.5.4.1
3.5.5.Working Principle
The basic working principle of LCD is passing the light from layer to layer through modules.
These modules will vibrate & line up their position on 90o that permits the polarized sheet to
allow the light to pass through it.
These molecules are accountable for viewing the data on every pixel. Every pixel utilizes the
method of absorbing light to illustrate the digit. To display the value, the position of molecules
must be changed to the angle of light.
So this light deflection will make the human eye notice the data that will be the ingredient
wherever the light gets absorbed. Here, this data will supply to the molecules & will be there till
they get changed.At present, LCDs are used frequently in CD/DVD players, digital watches,
computers, etc. In screen industries, LCDs have replaced the CRTs (Cathode Ray Tubes)
because these displays use more power as compared to LCD, heavier & larger.
The displays of LCDs are thinner as compared to CRTs. As compared to LED screens, LCD has
less power consumption because it functions on the fundamental principle of blocking light
instead of dissipating.
46
3.5.6. Registers of LCD
The registers used in LCD are two types like data register & command register. The register can
be changed by using the RS pinout. If we set ‘0’ then it is command register and if it is ‘1’ then it
is data register.
Command Register
The main function of the command register is to save instructions illustrated on LCD. That
assists in data clearing & changes the cursor location & controls the display.
Data Register
The data register is used to save the date to exhibit on the LCD. Once we transmit data to LCD,
then it shifts to the data register to process the data. If we fix the register value at one that the
data register will start working.[16]
47
3.6. SWITCH
3.6.1. INTRODUCTION
A Switch is a device which is designed to interrupt the current flow in a circuit. In simple words,
a Switch can make or break an electrical circuit. Every electrical and electronics application uses
at least one switch to perform ON and OFF operation of the device.
So, switches are a part of the control system and without it, control operation cannot be achieved.
A switch can perform two functions, namely fully ON (by closing its contacts) or fully OFF (by
opening its contacts).
When the contacts of a switch are closed, the switch creates a closed path for the current to flow
and hence load consumes the power from source.
3.6.2.Characteristics of a Switch
Before proceeding further and looking at different types of switches, let us see some important
points on the Characteristics of a Switch.
The two important characteristics of a switch are its Poles and Throws. A pole represents
a contact and a throw represents a contact-to-contact connection. Number of poles and
throws are used to describe a switch.
Some standard numbers of poles and throws are Single (1 pole or 1 throw) and Double (2
poles or 2 switches).
If the number of poles or throws are greater than 2, then the number is often directly
used. For example, a three pole six throw switch is often represented as 3P6T.
Another important characteristic of a switch is its action i.e., whether it is a Momentary
or Latched action. Momentary Switches (like push buttons, for example) are used to
make momentary contact (for a brief time or as long the button is pressed).
Latched Switches on the hand, maintain the contact until it is forced to the other position.
48
3.6.3.Types of Switches
Basically, Switches can be of two types. They are:
Mechanical
Electronic
Mechanical Switches are physical switches, which must be activated physically, by moving,
pressing, releasing, or touching its contacts.Electronic Switches, on the other hand, do not
require any physical contact in order to control a circuit. These are activated by semiconductor
action.
3.6.4.Mechanical Switches
Mechanical switches can be classified into different types based on several factors such as
method of actuation (manual, limit and process switches), number of contacts (single contact and
multi contact switches), number of poles and throws (SPST, DPDT, SPDT, etc.), operation and
construction (push button, toggle, rotary, joystick, etc.), based on state (momentary and locked
switches)etc. FIGURE:3.6.4.1
49
Based on the number of poles and throws, switches are classified into following types. The pole
represents the number of individual power circuits that can be switched. Most of the switches are
designed have one, two or three poles and are designated as single pole, double pole and triple
pole.
The number of throws represents the number of states to which current can pass through the
switch. Most of the switches are designed to have either one or two throws, which are designated
as single throw and double throw switches.[21]
3.6.5. Electronic Switches
The electronic switches are generally called as Solid State switches because there are no physical
moving parts and hence no physical contacts. Most of the appliances are controlled by
semiconductor switches such as motor drives and HVAC equipment.
There are different types of solid state switches are available in todays consumer, industrial and
automotive market with different sizes and ratings. Some of these solid state switches include
transistors, SCRs, MOSFETs, TRIACs and IGBTs.
3.6.6.Bipolar Transistors
A transistor either allows the current to pass or it blocks the current as similar to working of
normal switch.
In switching circuits, transistor operates in cut-off mode for OFF or current blocking condition
and in saturation mode for ON condition. The active region of the transistor is not used for
switching applications.
50
FIGURE:3.6.6.1
Both NPN and PNP transistors are operated or switched ON when a sufficient base current is
supplied to it. When a small current flows though the base terminal supplied by a driving circuit
(connected between the base and emitter), it causes the transistor to turn ON the collector-emitter
path.
And it is turned OFF when the base current is removed and base voltage is reduced to a slight
negative value. Even though it utilizes small base current, it is capable of carrying much higher
currents through the collector- emitter path.[21]
51
3.7. JUMPER WIRE
3.7.1. INTRODUCTION
Jumper wires are simply wires that have connector pins at each end, allowing them to be used to
connect two points to each other without soldering. Jumper wires are typically used
with breadboards and other prototyping tools in order to make it easy to change a circuit as
needed. Fairly simple. In fact, it doesn’t get much more basic than jumper wires.
FIGURE:3.7.1.1
Though jumper wires come in a variety of colors, the colors don’t actually mean anything. This
means that a red jumper wire is technically the same as a black one. But the colors can be used to
your advantage in order to differentiate between types of connections, such as ground or power.
While jumper wires are easy and inexpensive to purchase, it can also be a fun task to challenge
students to make their own. Doing so requires insulated wire and wire strippers. However,
beware that it is important not to nick the wire when stripping off the insulation.
52
3.7.2. Types of Jumper Wires
FIGURE:3.7.2
Jumper wires typically come in three versions: male-to-male, male-to-female and female-to-
female. The difference between each is in the end point of the wire. Male ends have a pin
protruding and can plug into things, while female ends do not and are used to plug things into.
Male-to-male jumper wires are the most common and what you likely will use most often. When
connecting two ports on a breadboard, a male-to-male wire is what you’ll need.
53
3.8. BATTERY
3.8.1.INTRODUCTION
A battery is a device that converts chemical energy into electrical energy and vice versa. This
summary provides an introduction to the terminology used to describe, classify, and compare
batteries for hybrid, plug-in hybrid, and electric vehicles. It provides a basic background, defines
the variables used to characterize battery operating conditions, and describes the manufacturer
specifications used to characterize battery nominal and maximum characteristics.[23]
3.8.2. Battery Basics
Cell, modules, and packs Hybrid and electric vehicles have a high voltage battery pack that
consists of individual modules and cells organized in series and parallel. A cell is the smallest,
packaged form a battery can take and is generally on the order of one to six volts. A module
consists of several cells generally connected in either series or parallel. A battery pack is then
assembled by connecting modules together, again either in series or parallel.
Battery Classifications Not all batteries are created equal, even batteries of the same
chemistry. The main trade-off in battery development is between power and energy: batteries can
be either high-power or high-energy, but not both. Often manufacturers will classify batteries
using these categories. Other common classifications are High Durability, meaning that the
chemistry has been modified to provide higher battery life at the expense of power and energy.
C- and E- rates In describing batteries, discharge current is often expressed as a C-rate in
order to normalize against battery capacity, which is often very different between batteries. A C-
rate is a measure of the rate at which a battery is discharged relative to its maximum capacity. A
1C rate means that the discharge current will discharge the entire battery in 1 hour. For a battery
with a capacity of 100 Amp-hrs, this equates to a discharge current of 100 Amps. A 5C rate for
this battery would be 500 Amps, and a C/2 rate would be 50 Amps. Similarly, an E-rate the
discharge power. A 1E rate is the discharge describes power to discharge the entire battery in 1
hour.
54
Secondary and Primary Cells Although it may not sound like it, batteries for hybrid, plug-
in, and electric vehicles are all secondary batteries. A primary battery is one that can not be
recharged. A secondary battery is one that is rechargeable.
(Maximum) Internal Resistance The resistance within the battery, generally different for
charging and discharging[23]
FIGURE:3.8.2.1
55
CHAPTER-4
SOFTWARE DESCRIPTION
4.1. Arduino IDE
4.1.1 Introduction
Arduino consists of both a physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated Development Environment) that
runs on your computer, used to write and upload computer code to the physical board.
4.1.2 Programming Language used
First, the Arduino compiler/IDE accepts C and C++ as-is. In fact many of the libraries are
written in C++. Much of the underlying system is not object oriented, but it could be. Thus,
"The arduino language" is C++ or C.
56
4.1.3 Getting started with arduino ide
This is the Arduino IDE once it’s been opened. It opens into a blank sketch where you can start
programming immediately. First, we should configure the board and port settings to allow us to
upload code. Connect your Arduino board to the PC via the USB cable.
FIGURE:4.1.3.1
57
IDE: Board Setup
You have to tell the Arduino IDE what board you are uploading to. Select the Toolspulldown
menu and go to Board.This list is populated by default with the currently available Arduino
Boards that are developed by Arduino. If you are using an Uno or an Uno-Compatible Clone (ex.
Funduino, SainSmart, IEIK, etc.), select Arduino Uno. If you are using another board/clone,
select that board.[24]
FIGURE:4.1.3.2
58
IDE: COM Port Setup
If you downloaded the Arduino IDE before plugging in your Arduino board, when you plugged
in the board, the USB drivers should have installed automatically. The most recent Arduino IDE
should recognize connected boards and label them with which COM port they are using. Select
the Tools pulldown menu and then Port.Here it should list all open COM ports, and if there is a
recognized Arduino Board, it will also give it’s name. Select the Arduino board that you have
connected to the PC. If the setup was successful, in the bottom right of the Arduino IDE, you
should see the board type and COM number of the board you plan to program. Note: the Arduino
Uno occupies the next available COM port; it will not always be COM3.[24]
FIGURE:4.1.3.3
At this point, your board should be set up for programming, and you can begin writing and
uploading code.[24]
59
4.1.4. Features of Arduino IDE
• The project file or the sketches for a project are saved with the file extension .ino
• Features such as cut / copy / paste are supported in this IDE.
There also is a facility for finding a particular word and replacing it with another by pressing
the Ctrl + F buttons on the keyboard.
• The most basic part or the skeleton of all Arduino code will have two functions.
4.2 Processing IDE
4.2.1 Introduction
Processing (programming language) Processing is an open-source computer programming
language and integrated development environment (IDE) built for the electronic arts, new media
art, and visual design communities with the purpose of teaching non-programmers the
fundamentals of computer programming in a visual context.
4.2.2 Processing Software
Word processing software is used to manipulate a text document, such as a resume or a report.
You typically enter text by typing, and the software provides tools for copying, deleting and
various types of formatting.
60
4.2.3 Getting Started
1. Open processing IDE 3.3.7.
2.Go to file menu and create new page.
3. Write the code.
4. Run.
4.3 How processing IDE communicate with Arduino IDE?
61
The Arduino IDE and the Processing IDE will communicate with each other through serial
communication. The Processing IDE has a serial library which makes it easy to communicate
with the Arduino.
62
CHAPTER 5
METHODOLOGY
5.1 Schematic Diagram
FIGURE:5.1.1
63
5.2 Implementation
1.Wireless distance measurement system is used to measure the distance between two object
precisely.
In this particular project we are using an ultrasonic sensor to measure the distance and we placed
the ultrasonic sensor on the top of a servo motor to rotate it at a range of 15 degree to 165
degree.
So by this angle range upto 400cm distance the ultrasonic senses can locate and measure the
distance of any object .
2. Now for the hardware port first we take a male to male jumper wire and connect it with 5V
pin and connect the other end to the positive rail of breadboard.
Next we take another male to male jumper wire and connect it to the ‘GND’ pin of Arduino and
we connect the other port to negative rail of the breadboard.
After that we connect ‘Vcc’ and ‘GND’ pin of both ultrasonic sensor and servo motor to the
positive and negative rail of the breadboard respectively. Next we connect the trigger pin of
ultrasonic sensor to ‘pin 9’ of Arduino board and we connect pin of ultrasonic sensor to ‘pin 11’
of Arduino board and we connect the data pin of servo motor to ’pin 12’ of Arduino board. And
hence the connection of Arduino is completed.
Next we write the code on Arduino IDE and burn it to the Arduino board.
64
3. We use ‘processing 3.3.7’ software. It is mainly programming language and environment
built for the electronics art and graphics used design.
We use this software to locate the object on the computer screen. And print the distance of the
object measured by the ultrasonic sensor.
4. We use ‘processing IDE’ to write the code processing IDE similar to the ‘Arduino IDE’. And
the ‘processing IDE’ communicate through serial communication with the ’Arduino IDE’.
5.For the communication process we send the data received from ultrasonic sensor to the serial
monitor with the same additional characters. These data in the serial monitor will be later
received by the ‘processing IDE and hence the communication between Arduino IDE and
processing IDE is completed.
6.Now we can see the distance of the object at which angle it is located as well as the location of
the object in the monitor.
65
CHAPTER 6
RESULT
6.1. RESULT
The working model of the proposed distance measurement system using ultrasonic sensor was
successfully designed and implemented. The circuit was able to measure distance upto
400cm.The circuit was also able to locate the object. Circuit was tested to measure various
distance .It has a fast response. The ultrasonic module works good.
By using ultrasonic sensor we were able to reduce cost and increase efficiency. This
implementation has been the readily used in the fast growing electronic industry.
66
CHAPTER 7
APPLICATION
1. Driverless car.
2. Robotics
3. To measure the level of fuel in the aircraft fuel tank.
4. In radar
5.Maintaining distance in pandemic time
67
CHAPTER 8
CONCLUSION AND FUTURE SCOPE
8.1 Conclusion
The objective of this project was to design and implement an wireless distance measurement
device using ultrasonic sensor. By using the system we can not only calculate the distance of the
object but we can also locate the object.
The following can be concluded from the above project-:
1. The system can calculate the distance of the object without errors.
2. The system can locate the object.
3. The system provide low cost and efficient solution.
8.2 Future scope
1. We can use humidity sensors in future to measure distance in different environment.
2. Using ultrasonic sensor with better specification we can increase the distance
measurement range.
3. This system is used in driverless car to detect obstacle.
68
CHAPTER 9
REFERENCES
1. Shrivastava, Prakhar, Praveen Kumar, and Ankit Tiwari. "Project review on ultrasonic
distance measurement." Int J Eng Tech Res. ISSN (2014): 2321-0869.
2. Ramesh, P., Sai Sudheera, and D. Vinay Reddy. "Distance measurement using ultrasonic
sensor and Arduino." Journal of Advanced Research in Technology and Management
Sciences (JARTMS) 3.2 (2021).
3. Sunitha, S. "Distance measurement using ultrasonic sensor and
NodeMCU." International Research Journal of Engineering and Technology 4.6 (2017):
1794-1797.
4. Vidhya, D. S., et al. "Obstacle detection using ultrasonic sensors." IJIRSTInternational
Journal for Innovative Research in Science & Technology 2.11 (2016).
5. Soni, Ayush, and Ankish Aman. "Distance Measurement of an Object by using
Ultrasonic Sensors with Arduino and GSM Module." International Journal of Science
Technology & Engineering 4.11 (2018): 23-28.
6. Ramesh, P., Sai Sudheera, and D. Vinay Reddy. "Distance measurement using ultrasonic
sensor and Arduino." Journal of Advanced Research in Technology and Management
Sciences (JARTMS) 3.2 (2021).
7. Gabriel, Mutinda Mutava, and Kamweru Paul Kuria. "Arduino uno, ultrasonic sensor
HC-SR04 motion detector with display of distance in the LCD." International Journal of
Engineering Research and Technical Research 9 (2020).
8. Gabriel, M.M. and Kuria, K.P., 2020. Arduino uno, ultrasonic sensor HC-SR04 motion
detector with display of distance in the LCD. International Journal of Engineering
Research and Technical Research, 9.
9. Latha, N. Anju, B. Rama Murthy, and K. Bharat Kumar. "Distance sensing with
ultrasonic sensor and Arduino." International Journal of Advance Research, Ideas and
Innovations in Technology 2.5 (2016): 1-5.
69
10. Bereziuk, Oleh, et al. "Ultrasonic microcontroller device for distance measuring between
dustcart and container of municipal solid wastes/O." Bereziuk, M. Lemeshev, V.
Bogachuk, W. Wójcik, K. Nurseitova, A. Bugubayeva//Przeglad Elektrotechniczny.
Warszawa, Poland 4 (2019): 146-150.
11. Carullo, Alessio, and Marco Parvis. "An ultrasonic sensor for distance measurement in
automotive applications." IEEE Sensors journal 1.2 (2001): 143.
12. Louis, Leo. "working principle of Arduino and u sing it." International Journal of
Control, Automation, Communication and Systems (IJCACS) 1.2 (2016): 21-29.
13. ARDUINO.CC, Arduino Introduction”, 2015 [Online] Available:
http://arduino.cc/en/Guide/Introduction. [Accessed: 25- Feb - 2015].
14. Arduino.cc, 'Arduino - Products', 2015. [Online]. Available:
http://arduino.cc/en/Main/Products. [Accessed: 25- Feb- 2015].
15. Kickstarter, 'ArduSat - Your Arduino Experiment in Space', 2015. [Online]. Available:
https://www.kickstarter.com/projects/575960623/ardusat-your-arduino-experiment-in-
space. [Accessed: 23- Feb- 2015]
16. Wikipedia, 'ArduSat', 2015. [Online]. Available: http://en.wikipedia.org/wiki/ArduSat.
[Accessed: 23- FEB- 2015].
17. ArduPilot Mega, 'ArduPilot Mega', 2015. [Online]. Available:
http://www.ardupilot.co.uk/. [Accessed: 23- Nov- 2015].
18. Morgan, Elijah J. "HC-SR04 ultrasonic sensor." (2014): 1-5.
19. Website link: https://electronicscoach.com/laser-diode.html
Retrival Date: 26,may,2022
20. Website link: https://www.watelectronics.com/lcd-16x2/
Retrival Date: 26,may,2022.
70
21.Website link: https://www.electronicshub.org/switches/
Retrival Date:26,may,2022.
22.Website link: https://nickelinstitute.org/en/about-nickel-and-its-applications/nickel-
in-batteries/a-guide-to-understanding-battery-specifications/ Retrival Date:26,may,2022
23. Website link: http://web.mit.edu/evt/summary_battery_specifications.pdf
Retrival Date:may,2022.
24. Arduino, S.A., 2015. Arduino. Arduino LLC, 372.
Article
Full-text available
Motion detection has become one of the great areas of research in the world. Many activities are carried out in the presence of motion. One of the research focus has been the use of Arduino Uno microcontroller, Ultrasonic sensor, passive infrared sensor and many others to sense and measure distances. The goal is to measure and monitor human activity remotely, and using less manpower as much as possible. This study aimed at designing a sensor that can easily measure how far the object is, monitor change of distances as the object approach and display the results in the Liquid Crystal Display (LCD), give a light coded signal and a sound alarm. The hardware utilized included the Arduino Uno on a bread board interfaced with LCD, LEDs, Buzzer and Ultrasonic sensor. The program to run the circuit was developed using Arduino IDE and stored at the memory of the Arduino microcontroller. The study demonstrated that the designed sensor could be used to accurately determine the position of an approaching object and display the distance readings on the LCD. Simultaneously the sensor display visual LED signals set and color coded as for instance, distances less than 150 cm, 70 cm and 40cm corresponding to Green, Blue and Red LED lights respectively, while at the same time producing sound signals n a sound buzzer. Thus, this method of distance sensing and measurement is efficient and assures measurements of small distances precisely. This distance sensing and measurement system can get wide applications where proximity detection is required e.g. in industries and traffic departments.
Article
Full-text available
In the paper structural diagram of the device and block scheme of microcontroller control algorithm for measuring distance have been proposed. The main characteristics of the proposed device are provided. The results of experimental tests are shown for measuring distance with consideration of environmental parameters. The results of experimental studies, presented in the work, confirm reliability of the parameter being measured.
Article
Full-text available
This paper describes an ultrasonic sensor that is able to measure the distance from the ground of selected points of a motor vehicle. The sensor is based on the measurement of the time of flight of an ultrasonic pulse, which is reflected by the ground. A constrained optimization technique is employed to obtain reflected pulses that are easily detectable by means of a threshold comparator. Such a technique, which takes the frequency response of the ultrasonic transducers into account, allows a sub-wavelength detection to be obtained. Experimental tests, performed with a 40 kHz piezoelectric-transducer based sensor, showed a standard uncertainty of 1 mm at rest or at low speeds; the sensor still works at speeds of up to 30 m/s, although at higher uncertainty. The sensor is composed of only low cost components, thus being apt for first car equipment in many cases, and is able to self-adapt to different conditions in order to give the best results.
Project review on ultrasonic distance measurement
  • Prakhar Shrivastava
  • Praveen Kumar
  • Ankit Tiwari
Shrivastava, Prakhar, Praveen Kumar, and Ankit Tiwari. "Project review on ultrasonic distance measurement." Int J Eng Tech Res. ISSN (2014): 2321-0869.
Distance measurement using ultrasonic sensor and NodeMCU
  • S Sunitha
Sunitha, S. "Distance measurement using ultrasonic sensor and NodeMCU." International Research Journal of Engineering and Technology 4.6 (2017): 1794-1797.
Obstacle detection using ultrasonic sensors
  • D S Vidhya
Vidhya, D. S., et al. "Obstacle detection using ultrasonic sensors." IJIRST-International Journal for Innovative Research in Science & Technology 2.11 (2016).
Distance Measurement of an Object by using Ultrasonic Sensors with Arduino and GSM Module
  • Ayush Soni
  • Ankish Aman
Soni, Ayush, and Ankish Aman. "Distance Measurement of an Object by using Ultrasonic Sensors with Arduino and GSM Module." International Journal of Science Technology & Engineering 4.11 (2018): 23-28.
Distance sensing with ultrasonic sensor and Arduino
  • N Latha
  • B Rama Anju
  • K Bharat Murthy
  • Kumar
Latha, N. Anju, B. Rama Murthy, and K. Bharat Kumar. "Distance sensing with ultrasonic sensor and Arduino." International Journal of Advance Research, Ideas and Innovations in Technology 2.5 (2016): 1-5.
working principle of Arduino and u sing it
  • Leo Louis
Louis, Leo. "working principle of Arduino and u sing it." International Journal of Control, Automation, Communication and Systems (IJCACS) 1.2 (2016): 21-29.
Arduino -Introduction
  • Arduino
  • Cc
ARDUINO.CC, "Arduino -Introduction", 2015 [Online] Available: http://arduino.cc/en/Guide/Introduction. [Accessed: 25-Feb -2015].