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

2019 1st International Conference on Advances in Information Technology

RADAR based Object Detector using Ultrasonic


Sensor
Akshaya U Kulkarni1, Amit M Potdar2, Suresh Hegde3 and Vishwanath P Baligar4
School of Computer Science and Engineering
KLE Technological University
Hubli, India
1
akulkarni608@gmail.com, 2amitpotdar31@gmail.com, 3suresh11193@gmail.com and 4vpbaligar@bvb.edu

Abstract — Target/object detection, recognition, position, in bad weather safely. In remote sensing, it can be used to
movement speed, etc. is easy when the object is near or predict weather to take the necessary steps in case of natural
easily visible. But, the same doesn’t stand true especially disasters, to observe planetary positions in space, to track
when the object is far or not visible due to so many factors satellites, to guide ships in the water bodies or to discover
like weather conditions, day/night cycle, etc. Therefore, objects lying beneath them. In ground traffic control, it is used
Radio Detection And Ranging (RADAR) was invented, by police officials to detect speed of the vehicle, to detect
which uses radio waves to determine the range, angle, or obstacles, etc.
velocity of objects. But, it uses long time to detect, has The RADAR consists of a transmitter which produces an
short detection range, not target specific because of wide electromagnetic signal which is radiated into space by an
range, oversensitive, costly, etc. A cheaper, easy and antenna. When this signal strikes any object, it gets reflected
effective alternate solution is to use ultrasonic sensor in many directions. This reflected or echo signal is received by
which use sound waves for detection and ranging. the radar antenna which delivers it to the receiver, where it is
Therefore, this paper provides a method in which the processed to determine the geographical statistics of the
Ultrasonic Sensor (HC-SR04) acts as RADAR. The HC- object. The range is determined by the calculating the time
RS04 is connected to Servo Motor (SG90) for the taken by the signal to travel from the RADAR to the target
rotation/movement purpose. SIM808 module is also used and back. The target’s location is measured in angle, from the
to notify object detection via message/SMS. These direction of maximum amplitude echo signal, the antenna
components are connected to Arduino Uno and Raspberry points to. To measure range and location of moving objects,
Pi3 for being processed to detect and notify the object. Doppler Effect is used. Fig. 1 shows the working of RADAR:
Usually, the range of ultrasonic wave is 20kHz but here the
HC-SR04 range is 3cm to 4m as it is smaller in terms of
project usage. Advantages are: it is not affected by color or
transparency of objects, can be used in dark environments,
not highly affected by dust, dirt, or high-moisture
environments, etc. The results show the object detected
with its range/distance and angle in a java based GUI,
different ranges of object in cm at which it is detected and
the detection message sent to the admin.

Keywords – Object detection, RADAR, Ultrasonic Sensor,


Servo Motor, SIM808, SMS, GUI

I. INTRODUCTION
During old days (world wars), detecting, identifying,
tracking the object was done manually which was difficult.
Even for predicting the weather, it was difficult for a mere
human. As the water bodies are huge and what lies beyond
Fig. 1: RADAR System[9]
them isn’t visible, it was difficult for humans to travel or
explore. Therefore, to solve these and many problems, Radio RADAR can be used in weather condition to detect object, as
Detection And Ranging (RADAR) was invented. In military, it uses electromagnetic wave, it doesn’t need a medium to
its used to detect, identify the target or enemy or used to guide travel through, it has long range, flexible, etc. But it is costly,
missiles. In aircraft related field, it can control air traffic by not east to setup or handle, too close objects deviates the
identifying the aircraft’s position to guide it to land or fly even receiver, not target specific because of its wide range.

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 204

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.
2019 1st International Conference on Advances in Information Technology

But a better solution in means of handling and affording is al. In similar way, the servo motor is used to control the
available. Ultrasonic sensors measures the distance by using movement of the ultrasonic sensor which is attached to that
ultrasonic sound waves which are above the human audible servo motor.
range 20kHz. The sensor emits an ultrasonic wave and Security is the essential part in every field. To detect the
receives the wave reflected back from the target. Ultrasonic objects or intruders is a challenging task [1] as per the author
Sensors measure the distance to the target by measuring the Pooja Yadav using the low cost. IoT components like servo
time between the emission and reception. The advantages of motor, ultrasonic sensor etc. are much affordable devices to
ultrasonic sensors are that they are cheap, easy to setup and detect the object.
handle, can be interfaced with any IoT module, high Since the ultrasonic sensors are low cost devices, horizontal
frequency, sensitivity, penetrating power, great accuracy, array of ultrasonic sensors are used for the detection of objects
easily sense the nature, shape, orientation of the object, they [3] by A Patkar et al. Instead, single ultrasonic sensor with
are independent of light, smoke, color, dust, material, etc. servo motor can be used.
Therefore, they are used for liquid level control, car parking Road surface recognition is done using the radar and
system, distance measurement and almost all the applications ultrasonic signals [4] by Aleksandr Bystrov et al. In the similar
of RADAR. Therefore, in the proposed work, ultrasonic way the different objects with their distance can be found
sensor, HC-SR04 is used which is made to act as RADAR. using single ultrasonic sensor.
Fig. 2 shows the working of the HC-SR04: Ultrasonic sensors are used to measure distance since the
signal loss is less in [5] by Aleksandr Bystrov et al. Since
ultrasonic sensor can be used for distance measurement, we
can also detect the object distance.
Short range ground surveillance radar is developed to detect
the moving object using FMCW (Frequency Modulated
Continuous Wave)[6] by Eugin Hyun et al. Cost for this radar
is high. So, IoT component like ultrasonic sensor, servo motor
can be used to detect the objects.
A method is developed to calculate the space to park the
vehicle based on the width of the vehicle using ultrasonic
sensor [7] by Shao Y et al. Ultrasonic sensor can also be used
to detect the vehicles and their distance from the sensor.
Radar is developed using ultrasonic sensor to detect the object
and its distance inside an angle of 180 degree in [8] by Paulet,
M.V et al. These distance and angle of the object can also be
send as a message to the admin mobile using SIM808.
As all the papers discuss about RADAR instead of ultrasonic
sensor with any of the information sending modules like
SIM808, the proposed work provides easy and affordable
Fig. 2: Ultrasonic Sensor HC-SR04 System[10] solution.

The HC-SR04 uses sonar to determine the distance to an III. METHODOLOGY


object. The transmitter (trig pin) sends a signal: a high- This section gives brief explanation on the description of
frequency sound, when the signal finds an object, it is software and hardware, detailed connections setup, workflow.
reflected and the transmitter (echo pin) receives it. For the
RADAR like movement/rotation, servo motor SG90 is used. A. Experimental Setup
For notifying the object detection via SMS/message with its Far object detection is the task to be focused on, therefore
location, SIM808 can be used. As one can see that with these ultrasonic sensor (HC-SR04) is used instead of RADAR as it
cheap, lightweight, easy to setup and handle modules, the is cost effective and easy to handle. It produces sound waves
RADAR can be replaced and even then all the application can and whenever those waves hit an object, they are reflected
be handled. back detecting the object. For rotating the ultrasonic sensor in
The paper is organized in the manner with section II having 1800, servo motor (SG90) is used. Now, to process this data
discussion about the literature survey done. Then section III i.e. for conversion of data from analog to digital, Arduino Uno
gives brief explanation about the work done i.e. methodology. is used. To inform the the object detection via SMS/message,
Section IV analyzes the results. Section V concludes the SIM808 is used which is connected to Uno. Sensing and
article. processing of the data has been done but to monitor and
access, Raspberry Pi3 is used. So, all the hardware
II. LITERATURE SURVEY components like ultrasonic sensor, servo motor, SIM808 are
Several servo motors are used to control the manipulators to connected to Uno which intern is connected to the Pi3. Input
control the movement of robotic arms in [2] by Shih-An Li et

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 205

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.
2019 1st International Conference on Advances in Information Technology

devices like keyboard, mouse, monitor are connected to Pi3 C. Workflow


and for connecting all the devices jumper wires. After the connections are made, the code for object
All the physical devices/hardware connections are made but detection is run on the software Uno. Algorithm of the code is
without the software to monitor the output, results aren't explained and mentioned below.
possible. Initially Raspberry Pi3 requires Raspbian or Noobs
OS to be installed for interaction/interfacing. The software Algorithm 1 Object Detector using Ultrasonic Sensor
Arduino IDE is installed to program the code in C/C++. /* Input : ultrasonic sensor value in analog format
Another software used is the Processing IDE for creating the Output : distance/range, angle of the object if found with
GUI in java language. The code is for running the devices to sms/message to the admin
make the proposed work possible and to observe the */
output/results, i.e. to observe the object detected in the java 1: trigpin 11
based GUI by the help of HC-SR04 and to send SMS/message 2: echopin 12
from the SIM808. 3: procedure setup
B. Hardware Analogy 4: set trigpin as output
5: set echopin as input
Initially SD card containing Noobs or Raspbian OS is
6: set the baud rate to 9600
inserted in Pi3 as a storage purpose. Monitor, keyboards,
7: attach servo 9
mouse are connected to the Pi3. Insert a 4G sim card with
8: initialize SIM808
internet and SMS options enabled in the SIM808. Connect
9: end procedure
GPS and GSM antenna. Now, connect the
10: procedure loop
GND(Power/Analog In) of Uno to SIM808 GND, (Digital In)
11: for i in range(15, 165):
Tx(8) of Uno to Rx of SIM808, Rx(7) of Uno to Tx of
12: write servo i
SIM808, GND of HC-SR04 to GND(Power/Analog In) of
13: delay 30 millisec
Uno, Trig of HC-SR04 to 11 of Uno, echo of HC-SR04 to 12
14: distance functioncalculateDistance
of Uno, Vcc of HC-SR04 to 5v(Power/Analog In) of Uno and
15: for i in range(165, 15):
each of servo motor’s wire to 9, 5v, GND of Uno respectively.
16: write servo i
All these connections between Uno, ultrasonic sensor, servo
17: delay 30 millisec
motor, SIM808 are done through jumper wires. Now connect
18: distance functioncalculateDistance
Uno and Pi3 through USB cable. Then power up SIM808 and
19: end procedure
Pi3 by connecting to an adapter. Fig. 3 gives the detailed
20: procedure calculateDistance
connections in a pictorial representation:
21: write trigpin as low
22: delay 2 microsec
23: write trigpin as high
24: delay 10 microsec
25: write trigpin as low
26: duration set echopin as high
27: distance duration*0.034/2
28: print object detected
29: send range, angle of object via SMS
30: return distance
31: end procedure

Before the setup function, ultrasonic sensor’s trig pin and echo
pin connected to 11 and 12 of arduino are declared
(initialization). The setup function includes setting the
pinmode of trigpin as output and echopin as input. Defining
the pin at which the servo motor is attached (at 9). Then,
initializing SIM808 for its working through set of AT
commands like AT+CMGF=1 and AT+CGNSPWR=1 and
setting the baud rate to 9600. The loop function is for running
the part of the code n number of times. Here, the servo is
rotated from 15 to 165 and 165 to 15 degrees with the help of
for loop with delay of 30 milliseconds. Then calling the
Fig. 3: Hardware Connection Setup calculateDistance function for calculating the distance
measured by the Ultrasonic sensor for each degree. In this
function, initially the trigpin is low for 2 microseconds. Then,
trigpin is set high for 10 microseconds to send high frequency

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 206

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.
2019 1st International Conference on Advances in Information Technology

sound signals and again it is set to low for 2 millisconds. The


delays are for the echopin when set high to receive the signals Fig. 4 gives the framework of the proposed work in which the
which acts as a transmitter i.e. reading the echoPin and working of the system can be easily recognised. Fig. 5 gives
returning the sound wave travel time in microseconds to the the process flow of the work carried out which includes
variable duration. Then, the distance is calculated as: making connections, powering up the components, placing the
duration*0.034/2. If the object is in the range and detected, object infront of the sensor for detection at different set of
then through the AT command AT+CMGS = number, range ranges and if in range then mark it in red color, send range and
and angle of the object detected is sent via message/SMS. This angle of the object detected via message/SMS. Thus, the work
whole part is about detecting the object. provides easy and cheap method for object detection.
Next part of the code which is written in java is about the
processing the RADAR GUI to view the object detection. The
code contains importing the libraries for serial communication
and for reading the data from the serial port. Then, define the
serial object, variables for calculating distance, angle and
detecting object. Now, in setup function define the size of the
GUI in pixels, start the serial communication by defining the
COM port to which arduino is connected and read the data
from the serial port. In function draw, simulate motion blur,
slow fade of the moving line and call functions to drawRadar,
drawLine, drawText, drawObject. In function drawRadar, arc
lines and angle lines are drawn. In function drawObject, set
the range of the sensor to detect the object, calculate distance
and angle, mark the object detected in red color and fade it to
black color and if no object detected, then mark it in green
color. In function drawLine, lines at particular angles are
drawn and in drawText, required texts for displaying angles in
degrees, range in cm and detection of object is defined.

Fig. 5: Flowchart for Object Detection using Ultrasonic Sensor

IV. RESULT ANALYSIS


This section explains about the outcome of the work done.
Fig. 6 gives the screenshot of different sets of RADAR based
GUI. First image shows the green lines which depicts that no
object is kept infront of the sensor or it may be outside the
range with angle mentioned as 56o. Second image shows the
object detected in red color with the range in 8 cm and angle at
65o. Third image shows the object detected in red color fading
to black color as the arcs move (servo motor moves/rotates) in
Fig. 4: Framework of the proposed work range of 40 cm and angle at 100o. Fourth image shows the

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 207

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.
2019 1st International Conference on Advances in Information Technology

screenshot of the output of range and angle of the object


detected. Fig. 7 gives the screenshot of the message/SMS sent
to the given number when the object is detected with its range,
angle and timestamp.

(d) Output of Object Detection (distance & angle)


Fig. 6: Screenshot of RADAR based GUIs

(a) No Object Detected

(b) Object Detected

Fig. 7: Screenshot of the Object Detected SMS


The Table I shows the different set of test cases for object
detection in terms of distance and angles. The object is placed
in the range of 1 to 400 and above in cm to check whether it
gets detected by the sensor. For range 1cm and 400 above, the
object wasn’t detected which shows the sensor range. The
sensor ranges between 2 and 400 cm which is good enough for
this setup (also easy to setup). Whereas, in the case of angle, it
(c) Object Detected (fade) is fixed between 15 to 165 degrees (servo motor movement),
so, if the object is beyond 165 degrees and below 15 degrees,
the object won’t be detected.

TABLE I. TEST CASES (OBJECT DETECTION)


Test Case ID Test Case for Range of Result (Object
Object Detection (distance Detected –
(d) – cm and angle (a) - YES/NO)
degrees)
1 (d) 1 NO
2 (d) 2 YES

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 208

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.
2019 1st International Conference on Advances in Information Technology

3 (d) 50 YES [2] Li, S.A., Weng, C.W., Chen, Y.H., Lo, C.H., Yang, M.H.,
4 (d) 100 YES Lin, Y.C., Hsieh, M.H. and Wong, C.C., 2012, November.
5 (d) 200 YES
6 (d) 300 YES
Servo motor controller design for robotic manipulator.
7 (d) 400 YES In 2012 International Symposium on Intelligent Signal
8 (d) 400> NO Processing and Communications Systems (pp. 254-257).
9 (a) 15 to 165 YES IEEE.
10 (a) <15 and 165> NO [3] Patkar, A.R. and Tasgaonkar, P.P., 2016, April. Object
recognition using horizontal array of ultrasonic sensors.
V. CONCLUSION In 2016 International Conference on Communication and
Signal Processing (ICCSP) (pp. 0983-0986). IEEE.
In this paper, the work i.e. RADAR based Object Detector
[4] Bystrov, A., Abbas, M., Hoare, E., Tran, T.Y., Clarke, N.,
using Ultrasonic Sensor has been successfully carried out. It
gives solution for easy object detection with ultrasonic, Gashinova, M. and Cherniakov, M., 2014, October.
working like RADAR instead of using actual RADAR which Remote road surface identification using radar and
ultrasonic sensors. In 2014 11th European Radar
is costly and tough to handle. Other author’s work is mainly
Conference (pp. 185-188). IEEE.
focused on the either of the things. The work included IoT
[5] Wobschall, D., Zeng, M. and Srinivasaraghavan, B.,
devices and software for the connection. Data was processed
2005, February. An ultrasonic/optical pulse sensor for
by the Raspberry Pi3 computer and Arduino Uno board.
Object detection was done via the Ultrasonic sensor with servo precise distance measurements. In 2005 Sensors for
motor attached to the boards and the distance, angle, Industry Conference (pp. 31-34). IEEE.
[6] Hyun, E., Jin, Y.S., Ju, Y. and Lee, J.H., 2015,
timestamp of object detected was sent to the given number via
September. Development of short-range ground
SMS/message using SIM808 module. The results included
surveillance radar for moving target detection. In 2015
sample test cases to check range of the object detection. The
figures showed screenshot of the RADAR like GUI of object IEEE 5th Asia-Pacific Conference on Synthetic Aperture
detection in red color and green when no object detected with Radar (APSAR) (pp. 692-695). IEEE.
[7] Shao, Y., Chen, P. and Cao, T., 2018, July. A Grid
angles. Therefore, the work provides easy to setup and handle
Projection Method Based on Ultrasonic Sensor for
solution for object detection as there are lot of advantages of
Parking Space Detection. In IGARSS 2018-2018 IEEE
ultrasonic over RADAR as mentioned in the introduction
International Geoscience and Remote Sensing
section.
In future, higher range ultrasonic sensor can be used with 360o Symposium (pp. 3378-3381). IEEE.
angle rotation for large area coverage. Also, different types of [8] Paulet, M.V., Salceanu, A. and Neacsu, O.M., 2016,
October. Ultrasonic radar. In 2016 International
camera can be fixed to identify the object clearly. With the
Conference and Exposition on Electrical and Power
object detection SMS, the exact location (latitude & longitude)
Engineering (EPE) (pp. 551-554). IEEE.
can be messaged with the help of the SIM808 module.
[9] RADAR system, https://www.elprocus.com/wp-
content/uploads/2013/09/A-RADAR-System.jpg, 2013.
REFERENCES [Online; accessed 08-April-2019].
[10] Ultrasonic Sensor HC-SR04 System,
[1] Yadav, E.P., Mittal, E.A. and Yadav, H., 2018, February. https://randomnerdtutorials.com/complete-guide-for-
IoT: Challenges and Issues in Indian Perspective. In 2018 ultrasonic-sensor-hc-sr04/, 2013. [Online; accessed 08-
3rd International Conference On Internet of Things: April-2019].
Smart Innovation and Usages (IoT-SIU) (pp. 1-5). IEEE.

978-1-7281-3241-9/19/$31.00 © 2019 IEEE 209

Authorized licensed use limited to: University of Exeter. Downloaded on May 07,2020 at 22:44:13 UTC from IEEE Xplore. Restrictions apply.

You might also like