Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

ULTRASONIC DISTANCE SENSOR

TECHNICAL REPORT

STUDENT NAME:

STUDENT ID:

COURSE EXAMINER:

DATE: 21 - 04 - 2020

ASSESSMENT: TERM PAPER – TECHNICAL REPORT

NAME OF UNIVERSITY
Table of Contents

Introduction...........................................................................................................................................2
Construction & Working Principle..........................................................................................................2
Distinctive Features................................................................................................................................2
HC-SR04 Module....................................................................................................................................3
Application in Mechatronics System......................................................................................................3
Conclusion..............................................................................................................................................4
References..............................................................................................................................................5

Table of Figures

Figure 1 Ultrasonic Sensor.....................................................................................................................2


Figure 2 HC-SR04 Module......................................................................................................................3
Figure 3 HC-SR04 Module Timing Diagram............................................................................................3
Figure 4 Obstacle Avoidance Robot.......................................................................................................3
Figure 5 Obstacle Avoidance Robot Circuit Diagram.............................................................................4

1|Page
Introduction

Ultrasound is an amazing discovery of science which plays wonderful role in various applications.
The waves of this sound are termed as ultrasonic waves and their frequency is over 20,000 Hz.
These are inaudible to humans as human hearing range is between 20 and 20,000 Hz. This report is
consisted of the fundamental and technical description of ultrasonic distance measurement sensor
along with an application in an Arduino Microcontroller based control system.

Construction & Working Principle

Ultrasonic distance sensor is constructed of a transmitter and


receiver of ultrasonic waves which are connected to a control
circuit. Transmitter is composed of either piezoelectric
transducers or magnetostrictive transducer. Former works at
high frequencies while following inverse piezoelectric effect
and latter works at low frequencies where its principle is
based upon change in the magnetic material length. At
receiving end, ultrasonic waves which are reflected back from
obstacle, are converted to electric signal. (Latha, Murthy &
Kumar, 2016) Figure 1 Ultrasonic Sensor

When this sensor is triggered through an attached microcontroller, a few ultrasonic pulses are sent
by transmitter at frequency beyond 20 kHz and the time is measured till their receiving after
echoing back from obstacle. That time is then converted to distance using the following relation:

distance=speed ×time (1)


speed of sound waves∈dry air at 20 ℃=343 m/s (2)

As the total distance travelled by the sound waves is twice of the distance to be measured, so:

distance travelled∈meters=travelling time∈seconds ×343 /2 (3)

Distinctive Features

1) Ultrasonic distance sensor is robust which increases its utility in aggressive environments.
2) Since it works through sound propagation, it can be used in almost all kinds of
environments. (Vidhya et al., 2016)
3) It measures distance from object on the basis of travelling time of ultrasonic waves which
makes its accuracy independent of object color rendering, design and surface type.
4) It is not sensitive to dirt as it cleans itself through vibration.
5) It is proved to be reliable and versatile for various engineering applications including robot
movement control, vehicle control and medical applications. (Vidhya et al., 2016)

2|Page
HC-SR04 Module

HC-SR04 is an ultrasonic distance measurement module which


can be interfaced with Pic18f4550, Atmega16 and Arduino
Uno as well ("Obstacle Avoiding Robot using Arduino", 2017).
It has an ultrasonic transmitter, receiver and control circuit
while having four pins to get powered and communicate with
microcontroller. Distance measurement range is 2cm to
400cm with resolution of 3mm. This module is powered up by
5V DC voltage and works at 15mA. In order to operate it, Vcc
and Gnd pins are
connected to 5 V DC and Figure 2 HC-SR04 Module
ground respectively whereas Trig and Echo are connected to
GPIOs of microcontroller. (Czernek et al., 2016)

To execute a distance measurement, the Trig


pin is set to high state for at least 10 µs. The
sensor subsequently sends a sonic burst of
eight 40 kHz pulses and sets Echo pin to high
state. If there is some obstacle in the range of
sensor module, sonic burst reflects back and
gets detected by ultrasonic receiver. Echo pin is
set to low upon receiving of burst. The time
taken by pulse to leave and return back is Figure 3 HC-SR04 Module Timing Diagram
measured through the time of Echo pin at high
state.

This time is found to be 150μs to 25ms in case of obstacle within module’s range whereas it is
about 38ms in case of no obstacle. (Vidhya, Rebelo, D’Silva, Fernandes & Costa, 2016)

Total distance can be measured using the equation (3):


distance travelled∈meters=time of high state at Echo pin×343 /2 (4)

Application in Mechatronics System

Obstacle avoidance robot is an application of ultrasonic


distance sensor in Mechatronics systems. Such robots can be
used for housekeeping work like vacuum cleaning in a room
without touching any wall or furniture. They can also be
utilized in environments where human involvement is
dangerous and needed to be avoided. ("Obstacle Avoiding
Robot using Arduino", 2017)

A small obstacle avoidance robot is shown in figure 4


whose electric circuit components are listed below: Figure 4 Obstacle Avoidance Robot

3|Page
1. Arduino Uno Microcontroller
2. HC-SR04 Distance Measurement Module
3. IC-L293D Motor Driver
4. Tower Pro SG90 Servo Motor
5. 2 Geared Motors for Two Wheels
6. Batteries With Holder and Push Button

The circuit diagram to connect all these components is drawn on fritzing software and it is shown in
figure 5. When the robot is turned on after circuit completion, both of its motors run in the same
direction and it starts moving forward. The ultrasonic sensor continuously measures the gap
between the robot and the reflective surfaces in its range.

Distance measurement calculation is fed to Arduino where the distance is compared with a preset
value. For instance, preset value is 20 cm; if the distance from the obstacle comes out to be less
than 20cm, Arduino will stop the geared motors and activate the servo motor to measure the
distance in the left and right sides of the robot. If the distance on right side is greater than that on
the left side, the robot will turn right by running its right motor in the reverse direction.

Similar to this, if the distance comes out to be more on left side of the robot, it will take left turn by
Figure 5 Obstacle Avoidance Robot Circuit Diagram

activating the left motor in reverse direction. Robot will keep on repeating this process to make its
way while avoiding obstacles.

Conclusion

4|Page
Ultrasonic distance sensor is discussed in this technical report along with its application in an
obstacle avoidance robot. A commonly used HC-SR04 module is considered which generates sonic
burst of 40kHz to measure distance. It is an inexpensive sensor with distance measurement range
of 2cm to 4m. It is interfaced with Arduino Uno to continuously measure distance around robot in
the considered application. Arduino then control robot wheels motors on the basis of this
information.

References

Latha, N. A., Murthy, B. R., & Kumar, K. B. (2016). Distance sensing with ultrasonic sensor and
Arduino. International Journal of Advance Research, Ideas and Innovations in
Technology, 2(5), 1-5.
Czernek, W., Margas, W., Wyżgolik, R., Budzan, S., Ziębiński, A., & Cupek, R. (2016). GPS and
ultrasonic distance sensors for Autonomous Mobile Platform. Studia Informatica, 37(4A), 51-
67.
Vidhya, D. S., Rebelo, D. P., D’Silva, C. J., Fernandes, L. W., & Costa, C. J. (2016). Obstacle detection
using ultrasonic sensors. International Journal for Innovative Research in Science &
Technology, 2(11), 316-320.
Obstacle Avoiding Robot using Arduino. Electronics Hub. (2017). Retrieved 18 April 2020, from
https://www.electronicshub.org/obstacle-avoiding-robot-arduino/.s

5|Page

You might also like