Ultrasonic Signal Implementation in Arduino-Based Obstacle Robot Control System

The results of the distance calculation used to control the movement of the robot, hanse the robot is able to avoid unknown obstacles. This obstacle robot divided into 3 parts, namely Arduino Uno as a controller, L298N driver as a motor/wheel controller and ultrasonic sensor HC-SR04 as a sending and receiving device for ultrasonic signals. The ultrasonic sensor design on the obstacle robot placed at the front of the robot with the obstacle position in front. From the data analysis, the obstacle robot can determine the accuracy level of the detected distance and can stop according to the detected obstacle distance. The test results show that the obstacle robot is less accurate in detecting the obstacles in front of it, as evidenced by the test results that there is an average error of 0.118. The obstacle robot made using an ultrasonic sensor, so it is less accurate in reading the presence of a obstacle in front of it. In the test results, the biggest error is when the robot is at a distance of 30 cm, where the robot stops at a distance of 24 cm so that there is an error of 6 cm that missed.


Introduction
R Robot is a set of mechanical devices that can perform physical tasks, either human supervision and control, or using predefined programs. The robot that is the topic of this research is a type of obstacle robot or in other words a robot that can move from place to place. Obstacle robots are robotic constructions whose characteristics are having actuators in the form of wheels to move the entire robot body, so that the robot can move positions from one point to another.
From the industrial side, robots have achieved great success, such as manipulator robots, humanoid robots, and android robots that used by large companies. But despite all the success that has been achieved, this robotic robot has one fundamental drawback, namely limited mobility, therefore obstacle robots are present and able to travel around the entire automotive company without using a steering wheel, performing their abilities wherever as effectively as possible. The application of ultrasonic signals has been widely carried out, especially in the robot industry.
The following are some previous studies in the application of ultrasonic signals: [3], in his thesis entitled "Design of a Fire Extinguishing Car Robot Based on the ATmega 252 Microcontroller", which discusses the use of light sensors and ultrasonic sensors in controlling car robots for the purpose of finding points. fire and extinguish it; [4], in his thesis entitled * Corresponding author : deni.laksono@trunojoyo.ac.id "Design of a Moving Object Tracking Car Robot Based on PA (Proportional -Derivative) Controller Using the ATmega 8535 Microcontroller".
Inspired by this, this research will develop a obstacle robot that controlled using Arduino Uno as its control, L298N driver as a motor controller and ultrasonic sensor HC-SR04 as a distance sensor to detect the distance to the surrounding obstructions. The results of the distance reading will used as information to control the movement of the robot obstacle such as stopping based on the distance of the detected obstacle.

Description
In this section, we will explain about the obstacle robot, Arduino Uno R3, Sensor HC-SR04 and Motor Driver L298N.

Obstacle Robot
R Obstacle robot is a robot that can move freely because it has a movement tool to change positions and avoid an obstacle. In general, and an obstacle robot distinguished by a locomotion system or a propulsion system. Locomotion is movement across a flat surface. All of this adjusted to the terrain traversed and by the tasks assigned to the robot. The following is a classification of robots according to the type of locomotion.

Wheeled car robot
Wheels are the oldest, easiest and most efficient technique for moving a robot across a flat surface. Wheels are often chosen, because they provide good traction, are easy to obtain and use, and easy to attach to the robot. Traction is a variable of the wheel material and the surface traversed by the wheel. Softer wheel material has a large traction coefficient, and this large traction coefficient provides greater friction, and increases the power required to drive the motor.

Legged robot
The legged robot is very easy to adapt to uncertain terrain, for example to climb stairs. That cannot separate from research conducted by imitating the gait of various living things, including humans. It is also an important part of biological research and biorobotics. Bipedalism is an ideology in which organisms move with two legs or locomotion (legs). Robot research on bipedal robots is very intensive, like what Honda did, which created ASIMO (Advanced Step in Innovative Mobility).

Arduino Uno R3
Arduino Uno R3 is an open source electronic circuit board in which there is an Atmel microcontroller chip output. Arduino Uno R3 is a board based on the ATmega328. Arduino Uno R3 has 14 digital input / output pins (6 of which can be used as PWM outputs), 6 analog input pins using a 16 MHz crystal, including pins A0 to A5, USB (Universal Serial Bus) connection, power jack, ICSP header and reset button. The analog pin on the Arduino Uno R3 has an analog reference voltage (Aref) of 5 volts. The shape of the Arduino Uno R3 board seen in Figure 1.

Sensor HC-SR04
The HC-SR04 is an ultrasonic sensor that used to measure the distance between an obstacle and the sensor. The pin configuration and display of the HC-SR04 sensor shown in Figure 2.C-SR04. HC-SR04 has 2 main components as its constituent, namely ultrasonic transmitter and ultrasonic receiver. The function of the ultrasonic transmitter is to emit ultrasonic waves with a frequency of 40 KHz then the ultrasonic receiver captures the reflected ultrasonic waves that hit an object. The travel time of ultrasonic waves from the transmitter to the receiver is proportional to 2 times the distance between the sensor and the reflected plane as shown in Figure 3. The principle of distance measurement using the HC-SR04 ultrasonic sensor is that when a trigger pulse given to the sensor, the transmitter will start emitting ultrasonic waves, at the same time the sensor will produce a TTL (Time to Live) output. The reflection generated by an object then the time measurement stopped by producing a down transition TTL output. If the measurement time is t and the speed of sound is 340 m/s, then the distance between the sensor and the object can be calculated using equation (1) below.
where, s = Distance between sensor and object (m) t = Ultrasonic wave travel time from transmitter to the receiver(s)

Driver Motor L298N
I IC L298N is an IC type H-bridge capable of controlling inductive loads such as relays, solenoids, DC motors and stepper motors. The L298N IC consists of logical transistors (TTL) with NAND gates that function to make it easier to determine the direction of rotation of a dc motor or stepper motor. The advantage of this L298N motor driver module is in terms of precision in controlling the motor so that the motor is easier to control. The pinout image and its description seen in Figure 4. The description of the L298N motor driver pinout seen in Table 1.

Design of System
In this section, it explained: 1) design of HC-SR04 with Arduino Uno R3, 2) Design of L298N with Arduino R3, 3) Design with DC motor, 4) Design of the whole system.

Design HC-SR04 with Arduino R3
Circuit connect the Arduino and ultrasonic sensor, where the VCC pin on the sensor connected to a 5 Volt voltage source on the Arduino, then the trigger pin on the sensor is connected to pin 4 on the Arduino, the echo pin on the sensor is connected to pin 2 on the Arduino,and the GND pin on the sensor. Conected to the GND pin on the Arduino, seen in Figure 5. or 11 stops the motor. Logic inputs 01 and 10 will rotate in clockwise or counter clockwise direction. Give a HIGH value to pins 1 and 9 (corresponding to two motors) for the motor to start operating. When the pin assigned a HIGH value, the corresponding driver activated. On the other hand, when the value is LOW, the motor will stop. The L293D driver circuit seen in Figure 6.

Design with DC Motor
In this study, two 5V dc motors used as the right wheel and the left wheel of the obstacle robot. These two motors connected to the L298N motor driver and the Arduino Uno R3 board supplied with VCC 5 V and VCC 12 V from the battery. Furthermore, the L298N driver will issue a voltage to control forward, backward, turn left, turn right and stop the dc motor. The circuit seen in Figure 7.

All Sistem Design
The entire obstacle robot system consists of Arduino Uno R3, L298N Motor Driver, ultrasonic sensor HC-SR 04, two 5v dc motors, 5V battery seen in Figure 8 below.

Result and Analysis
The obstacle robot test is done by setting the robot with a PWM value = 255 and a distance of 5 cm, 10cm, 15cm, 20cm, 25cm, and 30cm between the robot and the obstacle in front of it. Then the robot is run and reads the presence of a obstacle in front of it after that it stops right at a predetermined distance. After that, the distance between the robot and the obstacle was measured, the test results are shown in table 1.  Based on table 2 shows the average error rate of the robot when it detects a obstacle in front of it, it can be seen in the direct measurement results that the average error is 0.118.

Conclutions
From the results of this study, several conclusions can be drawn: 1. Obstacle robot uses ultrasonic sensor with type HC -SR04, arduino uno, L298N motor driver and DC gearbox motor. 2. The test results show that the obstacle robot is less accurate in detecting the obstacle in front of it, as evidenced by the test results that there is an average error of 0.118. 3. The obstacle robot is made using an ultrasonic sensor, so it is less accurate in reading the presence of a obstacle in front of it.
4. In the test results, the biggest error is when the robot is at a distance of 30 cm, where the robot stops at a distance of 24 cm so that there is an error of 6 cm that is missed.