Implementation of a basic Sonar of Echolocation for Education in Telecommunications

Currently, having a sonar of echolocation in an electronic lab is complicated due to the high cost of its implementation, which is why it is proposed the implementation of a basic sonar, using agile technologies such as the Arduino, which will be used to implement this paper, also it has a servomotor and an ultrasonic sensor, which is responsible for detecting the distance where the objects are located. The Arduino will be in charge of controlling the servomotor movements which have to be between 15 and 165 degrees, in addition, it will send the information through the serial port to a computer, in which the data will be processed and displayed using the Processing software. Keywords—Arduino; processing software; sonar; ultrasonic sensor; servomotor


I. INTRODUCTION
The sonar of echolocation isn't new, since it was used in the second world war with the purpose of locating the location or positioning of the enemy, it was also used in the navy for the measurement of distance for enemy targets; sonar is a complex system that uses several elements such as signal processing, data processing, parameter detection and estimation, among others, so having a sonar in the telecommunications laboratories is important since it can have great benefits in the education such as: studying the process of finding objects, tracking mobile objects in addition to image processing; however, having a sonar in the laboratories isn't possible due to its high cost, so the purpose of this research is to implement a basic sonar based on current technologies, to be used in the laboratories of the institutions that require it.
The paper consists of the implementation of a basic sonar based on agile technologies such as Arduino, for the laboratories of the universities and institutions that require it, for this purpose an Arduino, an ultrasonic sensor, a servomotor and a buzzer will be used; the system has the ability to detect objects through ultrasonic pulses, in addition to displaying them through a computer.Also, implement this technology, making a laboratory with low-cost resources for education at universities.

II. METHODOLOGY
The paper is based on the basic sonar principles, which is to emit an electromagnetic or acoustic wave and detect the reflected return from a distant surface; the signal of a sonar is generated in the transmitter, it radiated in the direction of an object where it is reflected towards the receiver, the same one that processes and obtains the information that can be the distance, speed, direction and characteristics of the object [1], [2], [3].
For this paper, the piezoelectric effect that is sensitive to the direction will be used, because the voltage produces a defined polarity in the voltage [4], while the compression produces an opposite one.So, if a voltage is applied to the piezoelectric transducer, the crystal changes in its dimensions, which causes a change of pressure in the surrounding medium (air), and vice versa, when the crystal is subjected to a change of pressure appear electrical charges at their ends, where a potential difference is created.So, this type of transducer can function as an ultrasonic emitter or receiver.
The main components of the system can be seen in Figure 1, where we see a general scheme of the connection of the servomotor and ultrasonic sensor to the Arduino, in addition to the serial communication with the computer.

A. Description of Principal Components 1) Arduino one:
The Arduino one (Figure 2) is the computer of the circuit which controls the operation of the servomotor and the transmission and reception of the pulses of shots towards the sensor [5], also intercommunicates with the PC thought the USB cable recognizing it, as a serial port, and thus of this way we can visualize graphs, executing it in the software Processing.www.ijacsa.thesai.org2) Servomotor: A Micro Servo 9g SG90 from Tower Pro as we can see in Figure 3 was used for this paper.These motors work with a PWM signal, with a working pulse between 1 ms and 2 ms and a period of 20 ms (50 Hz) [6].This data tells us the maximum speed at which we can move the servomotor with Arduino.We can only change position every 20 ms.This will depend on the type and brand of our servomotor.
It is necessary to take into account, the angle of rotation of the servomotor, in this case, it allows us to make a sweep between -90º and 90º [3].It means that is a 180º angle of rotation.Although the servomotor can move with a resolution of more than 1 degree, this is the maximum resolution that we will achieve due to the limitation of the PWM signal that is capable of generating Arduino One. 3) Ultrasonic sensor: We chose this device because it is a very cheap sensor, this sensor emits a pulse of sound at a high frequency not audible by the human ear, the sonar waves bounce back to the sensor.Since we know the speed of sound in air (343.2m / s), we can calculate the distance with e = v * t. (space = speed per time).The measurement range of the sensors usually ranges from a few centimeters to several meters.The most common, like the HC-SR04, have 4 pins (see Figure 4).Two of them are for the connection (Vcc and GND) and the other two pins are the Trigger and the Echo [7].When a high level (HIGH, 5V) of at least 10 μs is provided to the "Trig" pin, the ultrasonic module emits a series of 8 pulses at a high frequency (40 KHz) and then sets its "Echo" output to HIGH.If the signal encounters an obstacle, it will be reflected and captured by the sensor module.At the moment of catching the rebound signal, the module will change its "Echo" output from HIGH to LOW.Therefore, in the "Echo" output, a high-level pulse (HIGH) has been maintained with a duration equal to the time used by the signal in going from the sensor to the obstacle and returning.The pulse width varies approximately between 150 μs and 25 ms.If there is no obstacle, the width of the echo pulse will be around 38 ms.www.ijacsa.thesai.org

B. System Implementation
The system is implemented in a basic way, in order to demonstrate its operation, in addition to the aforementioned components, the necessary code is developed both for the arduino and the coding in Processing, for the graphic visualization of the data.Flow diagrams that better explain the respective coding were constructed and one can see it in Figure 5.For the Arduino, after declaring the variables, the servomotor must be positioned and then send the instructions for the ultrasonic sensor to perform the distance measurement, for which the following code was implemented, with which the servo could be positioned between 15 and 165 degrees [8] A flow diagram of the system is going to be show next because we need to follow steps in order to make a paper reliable for future works.
In order to get the servomotor to return to a previous position, the parameters of the for loop must be changed (int t = 165; t> 15; t--), thereby achieving the aforementioned; the function calculate_distance () sends a high pulse of 10 us for the trigger pin, and receives the response pulse for the echo pin, measuring the duration of it, after knowing the time it takes the answer to apply the following formula to know the distance recorded at a given moment.

(
) • is the time it takes the pulse and "distance" is the distance between the sensor and the test object, the number 0.0343 represents the speed of sound expressed in cm / us in the formula.

III. RESULTS
The implemented circuit (Figure 6) was verified by us, the connection of the components before supplying power to the circuit, through the USB cable connected to the serial port of the PC.The ultrasonic sensor was mounted on the servomotor, a small cardboard was used and it was fixed with glue.By performing the tests, the graphic should look similar to the image in Figure 7.
As we can see in Figure 7, the graphic is shown in a bad location, so it was necessary to modify the code to center the image on the screen.With respect to the detection of the object is fulfilling the objective, the distance in which the object is located is shown on the screen.www.ijacsa.thesai.org

IV. DISCUSSION
The design of this device is very simple, the main purpose of detecting objects at different distances was achieved by visualizing it in a graph in a PC where the reader can see the distance and the location angle of the object, the Arduino card one that has different applications to perform all types of papers and the HC-SR04 ultrasonic sensor in charge of measuring the distance at the moment that receives the echo of a transmitted signal.
The use of Arduino one has an endless number of applications, several papers can be carried out, the Arduino and Processing codes are easy to program since the C ++ language is well known within the programs, besides the codes are free on the internet with some modifications to the program you can get.Based on the sonar principles and the development of the classes learned during my professional career, it was possible to finish this wonderful paper.
The recommendation is that amplifiers can be used to obtain greater distances and even other graphic visualization programs to improve and develop future work.

V. CONCLUSIONS
It was possible to build a system that can help to learn the basic concepts of the technology involved in sonars, with our system, we can teach students the concepts of object detection, signal processing, among other concepts that involve the sonars; This paper shows that it is possible to design low cost prototypes, which are possible to implement in the telecommunications laboratories of the interested institutions.
As a conclusion, the steps and also the process that we follow to make this paper was long.It's really important for students to always follow the steps because they will improve their capabilities of understand the process in different ways.

TABLE I .
CHARACTERISTICS OF THE ARDUINO ONE Fig. 2. Arduino One Controller.

TABLE II .
CHARACTERISTICS OF THE HC-SR04 ULTRASONIC SENSOR