SlideShare a Scribd company logo
Universal Journal of Control and Automation 6(1): 13-18, 2018 http://www.hrpub.org
DOI: 10.13189/ujca.2018.060102
Wheeled Mobile Robot Obstacle Avoidance
Using Compass and Ultrasonic
Yousef Moh. Abueejela*
, Haithem A. Ali
Control Engineering Department, College of Electronic Technology, Bani Walid, Libya
Copyright©2018 by authors, all rights reserved. Authors agree that this article remains permanently open access under
the terms of the Creative Commons Attribution License 4.0 International License
Abstract This paper presents the use of ARDUINO
board to control an autonomous mobile robot (AMR) for
navigation purpose. The wheeled robot is capable to
perform two tasks. The first task is to move autonomously
to the north direction. And the second task is to avoid
collision with unexpected static and moveable obstacles.
The robot uses two sensors to navigate and avoid the
obstacle, a digital compass HMC5883L uses to detect the
north direction and update the situation of the robot during
its movement. And the ultrasonic sensor uses to avoid
nearest obstacles on the robot way. C language used to
program the system to do its mission and installed to the
ARDUINO board. The results obtained show that the robot
was able to navigate and move to the north and avoid
obstacles in the outdoor environment.
Keywords Digital Compass Sensor HMC5883L,
Ultrasonic Sensor, Autonomous Robot, Avoidance,
Arduino, Navigation
1. Introduction
An autonomous mobile robot (AMR) is defined as a
wheeled vehicle that capable of moving in an environment
autonomously. Autonomous is the ability of moving and
navigate without assistance from external operator, with
the availability of internal or external sensors that get
information of the environment.
The most common external sensors are (ultrasonic, laser,
infrared, etc.) to detect obstacles and measure the distance
between the obstacle and the robot. The AMR is equipped
with a set of motorized actuators and some of sensors to
help it to move and navigate. In order to control its motion,
usually, there is an on-board computer to command the
motors to take place, based on reference inputs and the data
gathered by the sensors.
When autonomous robots navigate within outdoor
environments (open space), they have to be endowed the
ability to move through the environments, to move without
collision with obstacles, and follow the direction with the
help of (compass, GPS or camera). The basic concept of
this project report is to design robot which can move to the
north direction and avoid any obstacle on its way without
human guidance or control. Arduino Mega 2560 was used
as the “brain” to control the system of the robot [1-3, 6].
Figure 1 shows the prototype system.
The robot composes the following sensors and
actuators:
 One ultrasonic range finder mounted in front of
the mobile robot to detect obstacles and provide
information to the controller.
 One servomotor attached to the ultrasonic to rotate
the ultrasonic from 0 degree to 180 degree.
 Digital compass sensor type HMC5883L to
provide information about the direction of the
robot to the controller.
 An infra-red to switch ON/OFF the robot
remotely.
14 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic
Figure 1. System Prototype of the WMR
2. Problem Statement
One of the wheeled mobile robot problems in outdoor
environment is how to choose its path to move from point
to point, and how can get the capability to avoid
unexpected obstacles around or on its way. Therefore, one
of the solutions proposed for this issue is presented by
choosing ultrasonic sensor and digital compass sensor to
give the robot the ability to move freely in unknown
environment. The compass sensor is used to detect the path
for the robot, and the ultrasonic sensor is used to help the
robot to avoid any obstacle in front the robot while moving.
3. Methodology
The wheeled mobile robot prototype is divided into two
main stages which are the hardware and software. The
hardware consists many parts (chassis, wheels, DC motors,
sensors and on board controller). Each part tested in real
time and implemented separately, and then integrated
together to construct the robot system. Software part was
done by using C language with ARDUINO interface board.
In this section, input devices, output devices and
mechanical structure will be discussed and introduce.
3.1. System Block Diagram
Figure 2 shows the complete system diagram of wheeled
mobile robot and its controller board with two inputs
(ultrasonic and digital compass). The ARDUINO
controller was used as the main brain of the whole system;
it receives the data from the input devices and updates the
outputs devices. The target point for the system is the North
Direction; so that the digital compass sensor used to feed
back the controller with the mobile robot direction.
Furthermore, ultrasonic sensors proposed to complete the
navigation of robot driving to avoid the robot to hit the
walls or obstacles.
The prototype robot consists of a combination of
electronic, electrical and mechanical parts, the whole
system proposed are:
• Input Devices are used to start, gather information
about the system and the outdoor environment,
which consists switch (remote control IR), sensors
(ultrasonic sensor and Digital Compass), in order to
feed the controller (Microcontroller) by
information about the surrounding environment to
take the decision.
• The ARDUINO board is an integrated circuit that
contains a processor, memory and a programmable
input and output pins. The controller is the brain of
the robot, stores and sends programmed tasks to
other parts of the main robot.
• Output Devices are the actuators that convert an
electrical signal into mechanical movement; the
types of actuators are:
Servo motor to rotate the ultrasonic sensor from (0-180
degree), and
Universal Journal of Control and Automation 6(1): 13-18, 2018 15
Figure 2. System Architecture of the WMR
Figure 3. Ultrasonic Transmission/Reflecting signal with an Object
Figure 4. Ultrasonic Transmission/Reflecting signal with an Object
 Two DC motors attached with two wheels to drive
the robot.
3.2. Ultrasonic Sensor and Limitation
An ultrasonic sensor HC – SR04 transmits ultrasonic
waves into the air and detects reflected waves from an
object as shown in Figure 3, ultrasonic provides 2cm –
400cm non-contact measurement function. The distance
between the robot and the obstacle is determined by
𝑑 =
𝑣𝑡
2
(1)
Where:
d: is the distance measured.
t: is the time traveling from the sensor the object.
v: is the sound velocity on air.
Ultrasonic measurement has some limitations; in case of
the surface is perpendicular to the ultrasonic sensor, the
ultrasonic waves are reflected and will be detected by
receiver then the object can be selected as shown in
Figure3, while only a small percentage of the waves is
scattered in other directions. However, if the surface is
tilted by an large angel as shown in Figure 4 , then the
obstacle will not been detected [4,5,10].
The surface structure of the obstacle effects on the
amount of reflected waves. Furthermore, the size of the
irregularities on the surface should be comparable to the
16 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic
wavelength of the incident waves [5].
𝜆 =
𝑣
𝑓
=
340
40 000
= 8.5 𝑚𝑚 (2)
Where
λ is the wavelength,
v is sound velocity in air ( 340 m/s),
ƒ is ultrasonic sound frequency 40KHz
Another problem arises when the angle (θ) is greater
than 15 degree from the perpendicular line of sensor’
sender, in this case the object may not detect by the robot.
The problem can be minimizing by using servomotor drive
to rotate the sensor by extra degrees while the robot move.
3.3. Digital Compass and Limitations
Digital compass is a surface-mount, multi-chip module
designed for low field magnetic sensing with a digital
interface. The HMC5883L includes 12-bit ADC that
enables 1° to 2° compass heading accuracy.
Unfortunately, the digital compass affect by the ultrasonic
waves, so that, we found the best way to avoid that is to
make the two sensors work in sequence with delay 2
seconds. Another limitation of the compass sensor is
affected by the magnetic fields when the robot approaching
magnetic field or be above the dc motors.
3.4. Kinematics Model of the Mobile Robot
Kinematics is the study of the mathematics of motion
without considering the forces that affect the motion. It
deals with the geometric relationships that govern the
system. It develops a relationship between control
parameters and the behavior of a system in space [3,7,8].
The model of the robot is as shown in Figure5. The linear
speed of the right and the left wheel ( 𝑣𝑟, 𝑣𝑙 ) are related
to the angular speed as follows:
𝑣𝑟 = 𝑟𝜔𝑟 (3)
𝑣𝑙 = 𝑟𝜔𝑙 (4)
Where:
r: is the radius of the wheel.
ωr and ωl: angular velocity of the right and left wheels.
The total linear and angular speed of the robot can be
calculated as equations (5) and (6). The robot in a state of
motion must always rotate about a point that lies
somewhere on the common axis of its two wheels. This
point is often called the Instantaneous Centre of Curvature
(ICC). In order to derive the differential drive equations,
the model shown in Figure 5 is used.
Figure 5. The representation of a wheeled mobile robot
𝑣 =
𝑣 𝑟(t)+ 𝑣𝑙(t)
2
(5)
𝑅 =
𝑣(𝑡)
𝜔(𝑡)
=
𝐷
2
( 𝑣 𝑟 (𝑡)+ 𝑣𝑙 (𝑡))
( 𝑣 𝑟 (𝑡)− 𝑣𝑙 (𝑡))
(6)
Where:
v, ω: is the velocity and angular velocity of the robot
R: instantaneous radius of curvature (ICC).
S: is the robot curvature travel.
There are three cases of the robot motion we could
define, as shown in Figure 6.
If 𝑣𝑙 = 𝑣𝑟 , then we have forward linear motion in a
straight line. R becomes infinite, and there is effectively no
rotation θ is zero [3,9].
If 𝑣𝑙 > 𝑣𝑟, then we have right rotation with R
If 𝑣𝑙 < 𝑣𝑟, then we have left rotation with R.
Figure 6. Robot cases of rotations
Universal Journal of Control and Automation 6(1): 13-18, 2018 17
4. Experimental Results
In this section, we present experiments results and
algorithm illustration of the presented techniques .When
the system starts, servo motor rotates the ultrasonic sensor
with five corners as shown in Figure 8, and at every angle
the robot calculate the distance of nearest obstacle, and
then compares the distances to know where the obstacles
are, after that the robot getting its direction by using
compass sensor and looking for the desired path by
calculating the angle of steering, Figure 7 shows the
flowchart of the process.
4.1. Testing the Ultrasonic Distance Sensor
To get accurate distance measurement, we send a very
short HIGH signal of 10 microseconds (µS) to the Trigg
pin. After 3 seconds, the sensor should return a HIGH
signal again to measure another value. We found that, this
procedure was done to avoid an unstable measuring duo to
multi reflected waves from the surrounding, and we get a
perfect stable value which is 15cm.
Figure 7. Flowchart of wheeled mobile robot
Figure 8. Ultrasonic mounted with the Servo motor
18 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic
4.2. Testing the Digital Compass Sensor
During the experiments and results, we found that the
digital compass must be lie far from the DC motors and
avoid activate it with ultrasonic sensor at the same time. So
that, after the ultrasonic deactivate we should wait 1 second
and then start reading compass data.
4.3. System Implementation and Running
After the operation of the system, the robot scans the
surrounding environment to detect nearest obstacle if the
obstacle distance is greater than 15cm the robot will move
forward. Otherwise the robot will take a decision to true
left or right as shown in Figure 9 to avoid the obstacle and
search again for the North direction.
Figure 9. Robot motion
5. Technical Specification
Table 1. Technical specifications of the prototype
Item Description
Robot Size 11.5cm (L) × 10.5cm (W) × 8.5cm (H)
Robot Weight 0.48 Kg
Robot Power 12 volt
Max Speed 7cm/s
No. of Wheels 2 with one caster at front
Wheel Radius 3.5cm
No. of Sensors 2
Type of Sensor Digital compass and ultrasonic
Dc Motor velocity 200 rad/sec
6. Conclusions
This paper discusses the implementation and designing
of wheeled mobile robot for navigation and obstacle
avoidance. The system proposed was successfully done for
navigation and avoidance using digital compass sensor and
ultrasonic sensor, these sensors and the effect of their
limitations on the navigation and obstacle avoidance were
discussed. The experimental results show that the outdoor
autonomous mobile robot was able to realize the
autonomous navigation and avoidance task.
Acknowledgements
This work has been supported by Control Engineering
Department, College of Electronic Technology Bani
Walid.
REFERENCES
[1] Chung L. C., Bohan W., Yong C. Huang, “Ultra Sonic
Range Finding FOR Distance Measuring in Coal mining,”
IJRET of International Journal of Research in Engineering
and Technology, 03, pp. 313-316 ,Nov 2013.
[2] Guan S., Youtong Z., Dongdong W., “Detection and
Control of a Wheeled Mobile Robot Based on Magnetic
Navigation,”, IEEE of International conference on
mechatronics and automation, pp. 18-25 ,Feb 2013
[3] D. Hanafi, Youse Moh. Abueejela, Mohamad F. Zakaria,
“Wall Follower Autonomous Robot Development
Applying Fuzzy Incremental Controller,” Intelligent
Control and Automation, 2013, 4, pp. 1497-150, Jul 2005.
[4] Pifu Z.,Jason G.,Evangelos E., Peter H., “Navigation with
IMU/GPS/Digital Compass with Unscented Kalman
Filter,”, IEEE of International conference on mechatronics
and automation, pp. 18-25 ,Feb 2013.
[5] Johann B., Yoram K., “Obstacle Avoidance with Ultrasonic
Sensor,” IEEE of robotics and automation, Vol. 4, No. 2,
Aprill 1988.
[6] Wesam J. and Safa K.,” designed an autonomous wheeled
mobile robot for wall follower.” B.Sc., Dept. Cont. Eng.,
Collage of Electronics Technology, Baniwaled, 2011.
[7] Xi Li, Byung-Jae Choi, “Design of Obstacle Avoidance
System for Mobile Robot using Fuzzy Logic Systems,”
IJSH of International Journal of Smart Home, Vol. 7, No. 3,
May, 2013.
[8] S.A.S.Yapa, and etc., “Autonomous Obstacle Avoiding
Differential Wheel Driven Robot,” SAITM Research
Symposium on Engineering Advancements 2014.
[9] M. Niţulescu, “Theoretical Aspects in Wheeled Mobile
Robot Control,” 2008 IEEE.
[10] Mohamed Abdellatif and Osama A. Montasser, “Using
Ultrasonic Range Sensors to Control a Mobile Robot in
Obstacle Avoidance Behavior.” Ain Shams University,
Faculty of Engineering Cairo, Egypt 2010.

More Related Content

PDF
Bauldree_Hui_ATAV_Report
PDF
Digitization of Speedometer Incorporating Arduino and Tracing of Location Usi...
PDF
Implementation of pid control to reduce wobbling in a line following robot
PDF
IRJET- Design and Implementation of Automatic Traction System
PDF
Automatic Train Collision and Accidence Avoidance system
PPTX
PPTX
Geasture Control Robotic Arm
PDF
Automatic Railway Gate Control System Using Android
Bauldree_Hui_ATAV_Report
Digitization of Speedometer Incorporating Arduino and Tracing of Location Usi...
Implementation of pid control to reduce wobbling in a line following robot
IRJET- Design and Implementation of Automatic Traction System
Automatic Train Collision and Accidence Avoidance system
Geasture Control Robotic Arm
Automatic Railway Gate Control System Using Android

What's hot (20)

PDF
Content server
PDF
Maze solving robot
PPTX
RAILWAY TRACK GEOMETRY SURVEYING SYSTEM
PDF
Smart railway crossing embedded with automated platform bridge
PDF
Automatic Train Control System using Wireless Sensor Networks
PDF
Modeling, Simulation, and Optimal Control for Two-Wheeled Self-Balancing Robot
PDF
Project report for railway security monotorin system
PDF
A new method to prevent accidents in railways using microcontroller based on
PDF
Railway Security Project .
PPTX
Automatic Railway Track Brake Detection System
PPTX
Line following using maze simulator
PDF
9783319609270 c2
PDF
Automotive report
DOCX
Seminar Report On ACD i.e. Anti collision Devices by Tarun khnaeja ( 09034406...
PPTX
Micromouse Presentation no video
PDF
Implementation of pid control to reduce wobbling in a
PPTX
Implementation of automatic railway platform
PDF
Autonomous Eye
PPTX
Automatic railway track crack detector
Content server
Maze solving robot
RAILWAY TRACK GEOMETRY SURVEYING SYSTEM
Smart railway crossing embedded with automated platform bridge
Automatic Train Control System using Wireless Sensor Networks
Modeling, Simulation, and Optimal Control for Two-Wheeled Self-Balancing Robot
Project report for railway security monotorin system
A new method to prevent accidents in railways using microcontroller based on
Railway Security Project .
Automatic Railway Track Brake Detection System
Line following using maze simulator
9783319609270 c2
Automotive report
Seminar Report On ACD i.e. Anti collision Devices by Tarun khnaeja ( 09034406...
Micromouse Presentation no video
Implementation of pid control to reduce wobbling in a
Implementation of automatic railway platform
Autonomous Eye
Automatic railway track crack detector
Ad

Similar to Wmr obstacle avoidance using compass and ultrasonic (20)

PDF
Two wheeled self balancing robot for autonomous navigation
PDF
Impediment detection robot using Arduino
PDF
Design and Development of a Semi-Autonomous Telerobotic Warehouse Management ...
PDF
Design_and_implementation_of_line_follow.pdf
PDF
Design and Fabrication of Obstacle Avoiding Robotic Vehicle
PDF
Autonomous navigation robot
PPTX
First fare 2010 lab-view sensors for frc robots
PDF
Ijetcas14 308
PDF
Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...
PDF
IRJET - The Line Follower -and- Pick and Place Robot
PPTX
Self Obstacle Avoiding Rover
DOCX
Final report obstacle avoiding roboat
PDF
F0554050
PDF
Design, Implementation and Control of a Humanoid Robot for Obstacle Avoidance...
PDF
Design, Implementation and Control of a Humanoid Robot for Obstacle Avoidance...
PDF
IRJET- Simultaneous Localization and Mapping for Automatic Chair Re-Arran...
PDF
Design and implementation of path planning algorithm for wheeled mobile robot...
PDF
Design and implementation of path planning algorithm for wheeled mobile robot...
PPT
Total station and its application to civil engineering
DOCX
color tracking robot
Two wheeled self balancing robot for autonomous navigation
Impediment detection robot using Arduino
Design and Development of a Semi-Autonomous Telerobotic Warehouse Management ...
Design_and_implementation_of_line_follow.pdf
Design and Fabrication of Obstacle Avoiding Robotic Vehicle
Autonomous navigation robot
First fare 2010 lab-view sensors for frc robots
Ijetcas14 308
Design and Implementation of a Real Time Obstacle Avoiding Subsumption Contro...
IRJET - The Line Follower -and- Pick and Place Robot
Self Obstacle Avoiding Rover
Final report obstacle avoiding roboat
F0554050
Design, Implementation and Control of a Humanoid Robot for Obstacle Avoidance...
Design, Implementation and Control of a Humanoid Robot for Obstacle Avoidance...
IRJET- Simultaneous Localization and Mapping for Automatic Chair Re-Arran...
Design and implementation of path planning algorithm for wheeled mobile robot...
Design and implementation of path planning algorithm for wheeled mobile robot...
Total station and its application to civil engineering
color tracking robot
Ad

Recently uploaded (20)

PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Safety Seminar civil to be ensured for safe working.
PPT
Project quality management in manufacturing
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Sustainable Sites - Green Building Construction
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Geodesy 1.pptx...............................................
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
DOCX
573137875-Attendance-Management-System-original
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Embodied AI: Ushering in the Next Era of Intelligent Systems
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Safety Seminar civil to be ensured for safe working.
Project quality management in manufacturing
Internet of Things (IOT) - A guide to understanding
Model Code of Practice - Construction Work - 21102022 .pdf
Sustainable Sites - Green Building Construction
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Geodesy 1.pptx...............................................
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
additive manufacturing of ss316l using mig welding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Fundamentals of safety and accident prevention -final (1).pptx
573137875-Attendance-Management-System-original
Automation-in-Manufacturing-Chapter-Introduction.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...

Wmr obstacle avoidance using compass and ultrasonic

  • 1. Universal Journal of Control and Automation 6(1): 13-18, 2018 http://www.hrpub.org DOI: 10.13189/ujca.2018.060102 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic Yousef Moh. Abueejela* , Haithem A. Ali Control Engineering Department, College of Electronic Technology, Bani Walid, Libya Copyright©2018 by authors, all rights reserved. Authors agree that this article remains permanently open access under the terms of the Creative Commons Attribution License 4.0 International License Abstract This paper presents the use of ARDUINO board to control an autonomous mobile robot (AMR) for navigation purpose. The wheeled robot is capable to perform two tasks. The first task is to move autonomously to the north direction. And the second task is to avoid collision with unexpected static and moveable obstacles. The robot uses two sensors to navigate and avoid the obstacle, a digital compass HMC5883L uses to detect the north direction and update the situation of the robot during its movement. And the ultrasonic sensor uses to avoid nearest obstacles on the robot way. C language used to program the system to do its mission and installed to the ARDUINO board. The results obtained show that the robot was able to navigate and move to the north and avoid obstacles in the outdoor environment. Keywords Digital Compass Sensor HMC5883L, Ultrasonic Sensor, Autonomous Robot, Avoidance, Arduino, Navigation 1. Introduction An autonomous mobile robot (AMR) is defined as a wheeled vehicle that capable of moving in an environment autonomously. Autonomous is the ability of moving and navigate without assistance from external operator, with the availability of internal or external sensors that get information of the environment. The most common external sensors are (ultrasonic, laser, infrared, etc.) to detect obstacles and measure the distance between the obstacle and the robot. The AMR is equipped with a set of motorized actuators and some of sensors to help it to move and navigate. In order to control its motion, usually, there is an on-board computer to command the motors to take place, based on reference inputs and the data gathered by the sensors. When autonomous robots navigate within outdoor environments (open space), they have to be endowed the ability to move through the environments, to move without collision with obstacles, and follow the direction with the help of (compass, GPS or camera). The basic concept of this project report is to design robot which can move to the north direction and avoid any obstacle on its way without human guidance or control. Arduino Mega 2560 was used as the “brain” to control the system of the robot [1-3, 6]. Figure 1 shows the prototype system. The robot composes the following sensors and actuators:  One ultrasonic range finder mounted in front of the mobile robot to detect obstacles and provide information to the controller.  One servomotor attached to the ultrasonic to rotate the ultrasonic from 0 degree to 180 degree.  Digital compass sensor type HMC5883L to provide information about the direction of the robot to the controller.  An infra-red to switch ON/OFF the robot remotely.
  • 2. 14 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic Figure 1. System Prototype of the WMR 2. Problem Statement One of the wheeled mobile robot problems in outdoor environment is how to choose its path to move from point to point, and how can get the capability to avoid unexpected obstacles around or on its way. Therefore, one of the solutions proposed for this issue is presented by choosing ultrasonic sensor and digital compass sensor to give the robot the ability to move freely in unknown environment. The compass sensor is used to detect the path for the robot, and the ultrasonic sensor is used to help the robot to avoid any obstacle in front the robot while moving. 3. Methodology The wheeled mobile robot prototype is divided into two main stages which are the hardware and software. The hardware consists many parts (chassis, wheels, DC motors, sensors and on board controller). Each part tested in real time and implemented separately, and then integrated together to construct the robot system. Software part was done by using C language with ARDUINO interface board. In this section, input devices, output devices and mechanical structure will be discussed and introduce. 3.1. System Block Diagram Figure 2 shows the complete system diagram of wheeled mobile robot and its controller board with two inputs (ultrasonic and digital compass). The ARDUINO controller was used as the main brain of the whole system; it receives the data from the input devices and updates the outputs devices. The target point for the system is the North Direction; so that the digital compass sensor used to feed back the controller with the mobile robot direction. Furthermore, ultrasonic sensors proposed to complete the navigation of robot driving to avoid the robot to hit the walls or obstacles. The prototype robot consists of a combination of electronic, electrical and mechanical parts, the whole system proposed are: • Input Devices are used to start, gather information about the system and the outdoor environment, which consists switch (remote control IR), sensors (ultrasonic sensor and Digital Compass), in order to feed the controller (Microcontroller) by information about the surrounding environment to take the decision. • The ARDUINO board is an integrated circuit that contains a processor, memory and a programmable input and output pins. The controller is the brain of the robot, stores and sends programmed tasks to other parts of the main robot. • Output Devices are the actuators that convert an electrical signal into mechanical movement; the types of actuators are: Servo motor to rotate the ultrasonic sensor from (0-180 degree), and
  • 3. Universal Journal of Control and Automation 6(1): 13-18, 2018 15 Figure 2. System Architecture of the WMR Figure 3. Ultrasonic Transmission/Reflecting signal with an Object Figure 4. Ultrasonic Transmission/Reflecting signal with an Object  Two DC motors attached with two wheels to drive the robot. 3.2. Ultrasonic Sensor and Limitation An ultrasonic sensor HC – SR04 transmits ultrasonic waves into the air and detects reflected waves from an object as shown in Figure 3, ultrasonic provides 2cm – 400cm non-contact measurement function. The distance between the robot and the obstacle is determined by 𝑑 = 𝑣𝑡 2 (1) Where: d: is the distance measured. t: is the time traveling from the sensor the object. v: is the sound velocity on air. Ultrasonic measurement has some limitations; in case of the surface is perpendicular to the ultrasonic sensor, the ultrasonic waves are reflected and will be detected by receiver then the object can be selected as shown in Figure3, while only a small percentage of the waves is scattered in other directions. However, if the surface is tilted by an large angel as shown in Figure 4 , then the obstacle will not been detected [4,5,10]. The surface structure of the obstacle effects on the amount of reflected waves. Furthermore, the size of the irregularities on the surface should be comparable to the
  • 4. 16 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic wavelength of the incident waves [5]. 𝜆 = 𝑣 𝑓 = 340 40 000 = 8.5 𝑚𝑚 (2) Where λ is the wavelength, v is sound velocity in air ( 340 m/s), ƒ is ultrasonic sound frequency 40KHz Another problem arises when the angle (θ) is greater than 15 degree from the perpendicular line of sensor’ sender, in this case the object may not detect by the robot. The problem can be minimizing by using servomotor drive to rotate the sensor by extra degrees while the robot move. 3.3. Digital Compass and Limitations Digital compass is a surface-mount, multi-chip module designed for low field magnetic sensing with a digital interface. The HMC5883L includes 12-bit ADC that enables 1° to 2° compass heading accuracy. Unfortunately, the digital compass affect by the ultrasonic waves, so that, we found the best way to avoid that is to make the two sensors work in sequence with delay 2 seconds. Another limitation of the compass sensor is affected by the magnetic fields when the robot approaching magnetic field or be above the dc motors. 3.4. Kinematics Model of the Mobile Robot Kinematics is the study of the mathematics of motion without considering the forces that affect the motion. It deals with the geometric relationships that govern the system. It develops a relationship between control parameters and the behavior of a system in space [3,7,8]. The model of the robot is as shown in Figure5. The linear speed of the right and the left wheel ( 𝑣𝑟, 𝑣𝑙 ) are related to the angular speed as follows: 𝑣𝑟 = 𝑟𝜔𝑟 (3) 𝑣𝑙 = 𝑟𝜔𝑙 (4) Where: r: is the radius of the wheel. ωr and ωl: angular velocity of the right and left wheels. The total linear and angular speed of the robot can be calculated as equations (5) and (6). The robot in a state of motion must always rotate about a point that lies somewhere on the common axis of its two wheels. This point is often called the Instantaneous Centre of Curvature (ICC). In order to derive the differential drive equations, the model shown in Figure 5 is used. Figure 5. The representation of a wheeled mobile robot 𝑣 = 𝑣 𝑟(t)+ 𝑣𝑙(t) 2 (5) 𝑅 = 𝑣(𝑡) 𝜔(𝑡) = 𝐷 2 ( 𝑣 𝑟 (𝑡)+ 𝑣𝑙 (𝑡)) ( 𝑣 𝑟 (𝑡)− 𝑣𝑙 (𝑡)) (6) Where: v, ω: is the velocity and angular velocity of the robot R: instantaneous radius of curvature (ICC). S: is the robot curvature travel. There are three cases of the robot motion we could define, as shown in Figure 6. If 𝑣𝑙 = 𝑣𝑟 , then we have forward linear motion in a straight line. R becomes infinite, and there is effectively no rotation θ is zero [3,9]. If 𝑣𝑙 > 𝑣𝑟, then we have right rotation with R If 𝑣𝑙 < 𝑣𝑟, then we have left rotation with R. Figure 6. Robot cases of rotations
  • 5. Universal Journal of Control and Automation 6(1): 13-18, 2018 17 4. Experimental Results In this section, we present experiments results and algorithm illustration of the presented techniques .When the system starts, servo motor rotates the ultrasonic sensor with five corners as shown in Figure 8, and at every angle the robot calculate the distance of nearest obstacle, and then compares the distances to know where the obstacles are, after that the robot getting its direction by using compass sensor and looking for the desired path by calculating the angle of steering, Figure 7 shows the flowchart of the process. 4.1. Testing the Ultrasonic Distance Sensor To get accurate distance measurement, we send a very short HIGH signal of 10 microseconds (µS) to the Trigg pin. After 3 seconds, the sensor should return a HIGH signal again to measure another value. We found that, this procedure was done to avoid an unstable measuring duo to multi reflected waves from the surrounding, and we get a perfect stable value which is 15cm. Figure 7. Flowchart of wheeled mobile robot Figure 8. Ultrasonic mounted with the Servo motor
  • 6. 18 Wheeled Mobile Robot Obstacle Avoidance Using Compass and Ultrasonic 4.2. Testing the Digital Compass Sensor During the experiments and results, we found that the digital compass must be lie far from the DC motors and avoid activate it with ultrasonic sensor at the same time. So that, after the ultrasonic deactivate we should wait 1 second and then start reading compass data. 4.3. System Implementation and Running After the operation of the system, the robot scans the surrounding environment to detect nearest obstacle if the obstacle distance is greater than 15cm the robot will move forward. Otherwise the robot will take a decision to true left or right as shown in Figure 9 to avoid the obstacle and search again for the North direction. Figure 9. Robot motion 5. Technical Specification Table 1. Technical specifications of the prototype Item Description Robot Size 11.5cm (L) × 10.5cm (W) × 8.5cm (H) Robot Weight 0.48 Kg Robot Power 12 volt Max Speed 7cm/s No. of Wheels 2 with one caster at front Wheel Radius 3.5cm No. of Sensors 2 Type of Sensor Digital compass and ultrasonic Dc Motor velocity 200 rad/sec 6. Conclusions This paper discusses the implementation and designing of wheeled mobile robot for navigation and obstacle avoidance. The system proposed was successfully done for navigation and avoidance using digital compass sensor and ultrasonic sensor, these sensors and the effect of their limitations on the navigation and obstacle avoidance were discussed. The experimental results show that the outdoor autonomous mobile robot was able to realize the autonomous navigation and avoidance task. Acknowledgements This work has been supported by Control Engineering Department, College of Electronic Technology Bani Walid. REFERENCES [1] Chung L. C., Bohan W., Yong C. Huang, “Ultra Sonic Range Finding FOR Distance Measuring in Coal mining,” IJRET of International Journal of Research in Engineering and Technology, 03, pp. 313-316 ,Nov 2013. [2] Guan S., Youtong Z., Dongdong W., “Detection and Control of a Wheeled Mobile Robot Based on Magnetic Navigation,”, IEEE of International conference on mechatronics and automation, pp. 18-25 ,Feb 2013 [3] D. Hanafi, Youse Moh. Abueejela, Mohamad F. Zakaria, “Wall Follower Autonomous Robot Development Applying Fuzzy Incremental Controller,” Intelligent Control and Automation, 2013, 4, pp. 1497-150, Jul 2005. [4] Pifu Z.,Jason G.,Evangelos E., Peter H., “Navigation with IMU/GPS/Digital Compass with Unscented Kalman Filter,”, IEEE of International conference on mechatronics and automation, pp. 18-25 ,Feb 2013. [5] Johann B., Yoram K., “Obstacle Avoidance with Ultrasonic Sensor,” IEEE of robotics and automation, Vol. 4, No. 2, Aprill 1988. [6] Wesam J. and Safa K.,” designed an autonomous wheeled mobile robot for wall follower.” B.Sc., Dept. Cont. Eng., Collage of Electronics Technology, Baniwaled, 2011. [7] Xi Li, Byung-Jae Choi, “Design of Obstacle Avoidance System for Mobile Robot using Fuzzy Logic Systems,” IJSH of International Journal of Smart Home, Vol. 7, No. 3, May, 2013. [8] S.A.S.Yapa, and etc., “Autonomous Obstacle Avoiding Differential Wheel Driven Robot,” SAITM Research Symposium on Engineering Advancements 2014. [9] M. Niţulescu, “Theoretical Aspects in Wheeled Mobile Robot Control,” 2008 IEEE. [10] Mohamed Abdellatif and Osama A. Montasser, “Using Ultrasonic Range Sensors to Control a Mobile Robot in Obstacle Avoidance Behavior.” Ain Shams University, Faculty of Engineering Cairo, Egypt 2010.