Ultrasonic sensor decision-making algorithm for mobile robot motion in maze environment

ABSTRACT


INTRODUCTION
In recent years, mobile robot applications have grown exponentially.To make mobile robots perform different types of indoor activities, a heuristic effort has been conducted.Due to their multifunctional applications and suitability to well-defined, structured environments, autonomous mobile robots have long remained at the center of many kinds of research [1].Another types of robot called robot arm used to teach children the writing as in [2] mobile robot used for survival [3].The main feature of the mobile robot has wheels that allow the robot to move freely unlike to robot arm that are used in service applications, where extensive, capabilities for autonomous mobility are necessary.Mobile robots are candidates for humanizing tasks due to the complicated surroundings [4].The sensor is a device that measures a physical property and response to the environment for example electro hystero graphy (EHG) sensor with electrodes linked to the abdomen is used for medical purposes [5].Another sensor called an ultrasonic sensor was measured the distance between the walls surrounding the robot.The behavior of mobile robots to avoid collisions is a crucial trait for effective motion planning [6].Azeta et al. [7] the navigation of a mobile robot has a low-cost of ultrasonic distance sensor.A Wi-Fi module, an Arduino Uno microcontroller, and an Arduino motor shield driver are used to create the system, which operates the robot using geared DC motors.Oleiwi [8] Raspberry Pi 3 model B is used to solve the control and surveillance of differential drive mobile robots via the internet.Therefore, the Raspberry Pi 3-based mobile robot may be A maze environment is a very complex environment since it contains many obstacles and so difficult problems that mobile robots move through it.To avoid obstacles while moving through the maze, many researchers solved this problem.Suryanarayana and Akhila [10] presented an autonomous maze solver robot using wall following and flood fill.The 4×4 maze construction, hardware development based on Arduino, and software development have been implemented.A mobile robot for obstacle avoidance is designed in [11] based on the thresholding method that uses three ultrasonic sensors and an Arduino Uno microcontroller.Musridho et al. [12] provided a line maze-solving algorithm for curving and zigzag path tracking using Arduino Uno.In another work, Vairavan et al. [13] presented an obstacle avoidance robot vehicle controlled by an ultrasonic sensor and Arduino microcontroller to be programmed using the Android app.Research by Wu et al. [14] used ultrasonic sensors in real-time implementation of obstacle avoidance for wheeled and used proportional-derivative (PD) controllerbased wall-following method for optimum path design.Rudzuan et al. [15] introduced an experimental attempt to minimize errors that occurred in following the path taken by a mobile robot redirects it to a stable target point.Mohammed et al. [16] proposed the integration of a line-tracking control algorithm and a simplified left-handed algorithm for a moving robot in a virtual maze.Research by Zhmud et al. [17] focused on the HC-SR04 ultrasound rangefinder with the STM32VLDISCOVERY evaluation board.A mobile rescue robot was presented in [18], [19] for the detection of human bodies in rescue operations during a disaster [19] using artificial intelligence.The researchers provided the design and implementation of electronic surveillance robots for video surveillance and living body detection [20], [21].Kulkarni et al. [21] used Arduino, android applications, and the internet.Robots that avoid obstacles have been successfully designed in several cases.Kumar et al. [22] introduced an autonomous and skillfully developed bot for labyrinths-solving, mapping, and localization using three infrared sensors for wall detection and obstacle detection for collision avoidance, for object picking and placing the objects by a robotic arm for cleaning its path.Kathe et al. [23] presented a direction envelope algorithm for processing the image and finding the path which runs faster because of pre-obtaining the maze data instead of going through the maze environment cell by cell.Combination between multiple-objective optimization and multiple non-holonomic mobile robots navigation for the purpose of path planning and control using an improved evolutionary algorithm and fuzzy logic controller, multi-objective optimization of path and trajectory planning [24], [25].
The main contribution of this work is suggesting a decision-making algorithm to solve maze problems when autonomous mobile robots move through it without any collision with the maze's wall.The ultrasonic sensor is used to avoid objects in the maze.The suggested conditions of measured distances give flexibility to the mobile robot during its motion path.This suggested path algorithm is too fast compared with related works.It completed the path from the start to the goal point and it is a suitable application for designing an autonomous mobile robot to send it to dangerous areas instead of sending people to these dangerous areas.This paper is organized in the following way.Section 2 outlines the suggested approach.For the ultrasonic sensor suggested decision-making algorithm of the mobile robot for obstacle avoidance in the maze with software and hardware parts.In addition, the ultrasonic operation and the speed equation are also described.Then, the proposed system based on software simulation and hardware implementation results of mobile robot obstacle avoidance in a maze environment is presented in section 3. Section 4 presented the contribution.Finally, section 5 illustrated the conclusion.

THE PROPOSED METHOD 2.1. The suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion
The suggested decision-making algorithm flowchart of the mobile robot through a maze environment and avoiding obstacles is demonstrated in Figure 1.The proposed flowchart begins with the initialization of the ultrasonic sensor, start point, servo motor, and DC motors.Then the mobile robot status is ON.Thenit can be reading the sensor distance between wood and ultrasonic.This sensor is attached to the micro servo motor.The rotation of micro servo motor rotates from 0 to 180° to move the ultrasonic sensor on all sides to enable it to read all distances.Before the mobile robot moves, it waits for 3 seconds to stabilize the distance readings of the sensor.If distance is ≤ 20 cm, the suggested decision of the right DC motor is rotated and mobile robot moving to left side where there is not obstacle.Another condition is if the distance between the wall and sensor is > 20 cm the decision of the left DC motor is rotated to move the mobile robot to the right side (no obstacle).The 20 distance was chosen between the sensor and object because it is the suitable distance to avoid the height of the obstacle which equals 20 cm whereas the high of a designed mobile robot is 20 cm.The mobile robot moves forward in maze environment.If the path is clear (no obstacle), the mobile robot stops and reaches the goal point.If the path is not clear (there is an obstacle), the mobile robot backs to the beginning steps as shown in Figure 1  The suggested system consists of an Arduino Uno microcontroller, HC-SR04 ultrasonic sensor, servo motor SG90, two geared DC motors, an L298N motor driver, and a power supply.Arduino Uno microcontroller controls all the processes to be carried out in the system.An ultrasonic sensor is implemented to calculate the distance between the obstacle and the mobile robot.To detect the right or left or forward obstacle, the micro servo motor is attached to an ultrasonic sensor that rotates from 0 to 180°.The two geared DC motors are driven by a motor driver called (L298N) which is used to drive the mobile robot.The lithium battery power supplies all components of the mobile robot with 9 volts.The lithium battery is used because it can be charged and long-time life.The block diagram of suggested obstacle avoidance and path planning design for autonomous mobile robot motion in a maze environment is presented in   Figure 3 shows an Arduino Uno R3 is used as the microcontroller [26].The circuit hardware consists of the components described in the block diagram section.The HC-SR04 ultrasonic sensor [27] trigger pin connects to pin A1 in Arduino, while the echo pin is tied to pin A2 in Arduino.Motor driver IC (L298N) for driving the two DC motors that are connected in such a way where the IN1 and IN2 for driving left DC motor 1 and IN3 and IN4 for driving the right DC motor 2 which are connected to Arduino Uno pins 4,5 and pins 6,7 respectively [10], [13], [28].OUT1 and OUT2 of L298N are connected to left DC motor 1 and, OUT3 and OUT4 are connected to right DC motor 2. Micro servo motor SG90 connected to pin 10 in Arduino Uno.The Lithium power supply is described in section 2.2.a.An ultrasonic sensor operation The principle of ultrasonic sensor operation consists of a transmitter that generates an ultrasonic wave called a trigger and a receiver that receives the echo [17] as can be seen in Figure 4.In this work, the distance between the wall and the ultrasonic sensor can be computed due to (1): The time is the time between the ultrasonic sensor and the object.The distance is divided by 2 because of sound speed from the echo (receiver) pin equals double because the sound wave travels forward and backward.The sound speed is 0.034 cm/μs so by rewriting (1), the distance in cm becomes: (2) Figure 4. Ultrasonic signal motion from the transmitter (trigger) to the receiver (echo) [17] b.Speed calculation The general equation of speed can calculate as ( 3): Where  is all distance of the path from the start to the goal points and T is all time from the start to the endpoint.

RESULTS AND DISCUSSION
The experimental mobile robot after connecting all hardware seen in Figure 5.It is programmed to avoid obstacles.The path planning from the starting location to the goal position of the mobile robot begins with avoiding the wood walls of the maze as shown in Figure 5.The dimension of the designed maze consists of 100 cm in width and 200 cm in length.The time for a mobile robot moving in this maze from the starting location to the goal position equals 1 minute.The high of a designed mobile robot is 15 cm.The steps of the experimental suggested decision-making algorithm for autonomous mobile robot from start to goal points are explained as: i) mobile robot standing on start point where the two DC motors have 0 (low) value in the suggested algorithm.An ultrasonic sensor checks the distance with Micro servo motor rotation on all sides for 3 seconds; ii) it rotates to the left side where the left DC=0 (low) and the right DC motor=1 (high).In this state, the distance between sensor and wood reached to ≤ 20 cm.This condition was verified as following distances 19 cm at 9 seconds, 17 cm at 17 seconds, 12 cm at 24 seconds, 17 cm at 46 seconds, and 15 cm at 53 seconds; and iii) the mobile robot rotates to the right side where the left DC=1 (high) and the right DC motor=0 (low).In this state, the distance reached to > 20 cm.This condition was verified as following distances 73 cm at 31 seconds, 69 cm at 38 seconds, 33 cm at 56 seconds, and 45 cm at 60 seconds (goal point).Then the mobile robot stopped after reaching the goal point 4. In the above three states of mobile robot, the goal point is evaluated by adding all these ultrasonic distances which are equal to 300 cm (goal) point shown in Figure 6.
From the results, it can be concluded that the ultrasonic sensor gives the distance reading of mobile robot motion that ranged between minimum distance=12 cm and maximum distance=73 cm and these distances are acceptable for turning and a moving mobile robot navigating a maze without collision.The  (3).All distance of motion from beginning position to the end position equals to 300 cm with time is 60 sec.These values are substituted in (3) so that the speed of the mobile robot equals 5 cm/sec.It turns out about 20 seconds per cm.The dimensions of the labyrinth are 100×200 cm 2 .For the case study for our designed maze, Figure 7 shows the yellow path of autonomous mobile robot motion from start to goal using the suggested decision-making algorithm in the real-designed maze environment.In the designed maze environment, the mobile robot waits for 3 sec.For checking all sides of the road.During robot's path from beginning location to the end location, it stopped 10 times to check its roadsides.If there is an obstacle, the mobile robot turns to another side without obstacle as described in the section above until it receives to the goal point of the maze environment.The mobile robot path starts from 0 cm and ends at 300 cm. Figure 6.The mobile robot distance path through maze vs time using the suggested decision-making algorithm Figure 7.The real designed maze environment of autonomous mobile robot motion path from start to goal using suggested decision-making algorithm Figure 8 shows the motion steps of the mobile robot from beginning point as seen in Figure 8(a) then moving toward Figure 8(b) and ending locations with 300 cm as in Figure 8(c) of the autonomous mobile robot avoiding wood walls in the real maze environment as explained in the steps of the experimental suggested decision-making algorithm.The comparison with related works is illustrated in Table 1.Table 1 presented six related works.These maze-solving technologies reduced the speed because it talked a long time through the maze environment.The sensors are used without servos but in this work, one ultrasonic sensor linked with a micro servo motor enables the mobile robot to rotate in all directions.In addition, our suggested algorithm is the fastest as compared with these related works.115 Table 1.Comparison with related work

CONCLUSION
A suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion has been implemented.From this suggested algorithm it can be concluded that: due to the ultrasonic distance result chosen between the wall and ultrasonic sensor and attached to the servo motor, the suggested algorithm is too suitable for motion-autonomous mobile robots to avoid the walls accurately and flexibly in a maze environment without any collision with the wood walls.This suggested algorithm implements quickly because the autonomous mobile robot completed its path motion in the maze at 60 seconds (1 minute) with a speed equal to 5 cm/sec.although the longest distance from beginning location=0 cm to the end location was 300 cm with a maze size of 100×200 cm 2 .The results are evaluated in Arduino language and simulated in MATLAB R2018b software.The application of this algorithm enables mobile robots to move in flexibly in any maze environment with 20 cm of obstacle height without collision with any obstacle.For the case study of designing our maze, A distance between obstacle and mobile robot's sensor ranged from 12 cm to 73 cm and it is suitable for mobile robot movement.This suggested algorithm is considered the fastest speed as compared with related works.An ultrasonic sensor decision-making algorithm for maze-based mobile robot motion is suggested.An ultrasonic sensor is attached to the micro servo motor to enable this sensor to detect all objects on all sides.So that this algorithm is a helpful tool that improves the ability of mobile robots avoiding avoid all obstacles successfully through the complex constructed maze environment.The designed small mobile robot is considered a suitable choice that is useful in many dangerous applications.


ISSN: 2302-9285Bulletin of Electr Eng & Inf, Vol. 13, No. 1, February 2024: 109-116 110 operated remotely through the internet, and the surveillance terminal (laptop or tap) can access the mobile robot's live streaming video[9] using artificial intelligence with fuzzy logic controller for a more complicated environment of known-dynamic barriers.

Figure 1 .
Figure 1.Flowchart of suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion

Figure 2 .
In this work, an open-source Arduino language is based on C++ and C languages used and this language is written in Arduino software 1.8.19 version and MATLAB R2018b.The pseucode explained in section 2.1.

Figure 2 .
Figure 2. Block diagram of the suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion

Figure 3 .
Figure 3. Schematic diagram of the suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion

Figure 5 .
Figure 5.The experimental mobile robot of the suggested ultrasonic sensor decision-making algorithm for maze-based mobile robot motion


ISSN: 2302-9285 Bulletin of Electr Eng & Inf, Vol. 13, No. 1, February 2024: 109-116 114 usual speed of robot movement from beginning position to the end position is evaluated due to

Figure 8 .
Figure 8.The mobile robot maze steps motion (a) from start point, (b) during its motion, and (c) moving toward goal point