Beruflich Dokumente
Kultur Dokumente
i
List of Figures
ii
1.0 Title
OBSTACLE AVOIDING ROBOT
2.0 Introduction
1
2.2 Obstacle Avoiding Robot
Obstacle Avoiding Robot is a robot that will avoid obstacles by way of reversing and twisting
to find another way when the distance sensor acts as a robot's eye detects obstacles. When the
obstacle avoiding robot detects obstacles, the robot will move backwards and rotate randomly
either to the left or right. The movement backwards period is also random between 0.5 seconds
to 1 second. The robot will rotate left or right at random. Robot rotating time is also random at
0.5 seconds to 1.5 seconds. This robot is also graced with a flashing light. There are three LEDs
on the robot. The third flashing pattern of the three LEDs is also random. The time each LED
flashes is also at random.
Robot’s eye use ultrasonic sensor HC-SR04. This ultrasonic distance sensor uses ultrasonic
wave technology to determine the distance of the object in front of it. Animals such as bats and
dolphins also use the same concepts as using sound to determine the distance of the object in
front of them. HC-SR04 ultrasonic sensors offer tracking ranges from 2cm to 400 cm. HC-
SR04's ultrasonic distance sensor function is not affected by sunlight or rust-coloured objects
detected as infrared light based sensors. This sensor comes with ultrasonic wave transmitters
and wave receiver modules.
2
Figure 3: The way sensor detects the barrier
3
3.0 Problem Statement
Nowadays, robotic technologies have become more important since a lot of industry is trying
to improve their machinery weapons. This technology has developed year by year to make sure
an excellent result. Recently, by time goes by, a lot of mechanical robots have been invented
to help peoples running their daily life. Obstacles Avoidance Mobile Robot is actually a simple
collision avoidance machines. Besides that, its future development is very big to explore. By
using this simple collision avoidance system, a lot of new and variety mobile robot with
multiple functions can be invented. Real-time obstacle avoidance is one of the key issues to
successful applications of mobile robot systems. All mobile robots feature some kind of
collision avoidance, ranging from primitive algorithms that detect an obstacle and steer the
robot short of it in order to avoid a collision, through sophisticated algorithms, that enable the
robot to detour obstacles. The latter algorithms are much more complex, since they involve not
only the detection of an obstacle, but also some kind of quantitative measurements concerning
the obstacle's dimensions. Once these have been determined, the obstacle avoidance algorithm
needs to steer the robot around the obstacle and resume motion toward the original target.
4
4.0 Objectives
The aim of this project is to design a mobile robot with an ability to avoid obstacles. This
mobile robot will react with the surrounding to avoid any collision with obstacles. Ultrasonic
sensor will be the input for the whole process.
5
5.0 Methodology
M3*30 screws 4
M3*8 screws 10
Encoder 2
M3 nut 10
Rocker switch 1
6
Tire 2
Universal wheel 1
Battery box 1
Chassis 1
Gear motor 2
7
USB cable 1
Bread board 1
8
5.2 Programming Algorithm and Flowchart
Algorithm: Flowchart:
1) Start.
2) Switch is on otherwise go back to starting START
point.
3) Initialize the input port (P7) & output port
(P6).
4) Robot moves in forward direction
5) If an obstacle is present robot will reverse in CHECK
SWITCH ON
left or right direction.
6) Robot continues to go forward in other
direction
7) Switch off
INITIALISING I/O
8) Stop PORT
ROBOT GOES IN
FORWARD DIRECTION
IS OBSTACLE
DETECTED
SET DIRECTION OF
ROBOT IN REVERSE
EITHER LEFT OR RIGHT
STOP
9
5.3 Coding Arduino
#include <NewPing.h>
#define TRIGGER_PIN 7
#define ECHO_PIN 6
#define MAX_DISTANCE 200 //Jarak maksimum : 400-500cm.
#define IN1 11
#define IN2 10
#define IN3 9
#define IN4 8
#define LED_RED 4
#define LED_YELLOW 3
#define LED_GREEN 2
int distance;
bool directionMove;
int counterA;
int counterB;
int counterC;
int randomA;
int randomB;
int randomC;
void setup()
{
Serial.begin(9600);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
pinMode(IN3,OUTPUT);
pinMode(IN4,OUTPUT);
pinMode(LED_RED,OUTPUT);
pinMode(LED_YELLOW,OUTPUT);
pinMode(LED_GREEN,OUTPUT);
10
randomA = random(10,30);
randomB = random(10,30);
randomC = random(10,30);
}
void loop()
{
delay(50);
distance = sonar.ping_cm();
Serial.print("Ping: ");
Serial.print(distance);
Serial.print("cm");
directionMove = !directionMove;
11
}
counterA++;
if(counterA == randomA)
{
red_condition = !red_condition;
digitalWrite(LED_RED,red_condition);
counterA = 0;
randomA = random(5, 15);
}
counterB++;
if (counterB == randomB)
{
yellow_condition = !yellow_condition;
digitalWrite(LED_YELLOW, yellow_condition);
counterB = 0;
randomB = random(5, 15);
}
counterC++;
if (counterC == randomC)
{
green_condition = !green_condition;
digitalWrite(LED_GREEN, green_condition);
counterC = 0;
randomC = random(5, 15);
}
}
12
5.4 Costing
Total RM154.60
13
6.0 Arduino Library
Step 3: Include the library by clicking Sketch >> Include Library >> Add.ZIP Library
14
Step 4: Choose the downloaded Library file and click open to include it.
Step 5: Wait for the message “Library added to your libraries. Check include library menu”,
this shows that the distance sensor library has successfully added into Arduino IDE.
15
7.0 Assembly process
16
7.1 Hardware Assembly
Step 1: Install the tires together with the motors as shows in the picture
17
7.2 Electronic Part Assembly
1. Module below is known as motor driver L298N. It acts exactly like the engine of a
car. The module operates the motor and tyre.
3. Component below is the power switch. It functions as to switch on or off the robot
18
4. Build the circuit below by using the remaining parts that are given. Checks each
connection carefully. After this our motor will operate forward smoothly.
19
5. Build an avoidance obstacle robot by following the circuit above. The robot will
avoids any obstacle by reversing and turning and finding another way as the
Ultrasonic Sensor guides as it eyes. Soldering is necessary to hold the wires firmly
20
Figure 7: Testing the Ultrasonic Sensor
21
8.0 Discussion
Based on this project, we learned that how to use Arduino properly and its coding based
on project that we created, and to design and implement an Obstacle Avoiding Robot prototype
by using Arduino Uno and using Ultrasonic sensor. Ultrasonic sensor on the front of the robot
reads input of the algorithm that created. Algorithm is created by implement in the main
controller which is PIC microcontroller. Output of this system which is the dc motor can reflect
with the input from the sensor is developed. The main controller will trigger an input to the dc
motor to change the steering wheel to the correct direction when an obstacle is detected. Thus,
the obstacle can be avoided.
This developed robot platform was not designed for specific task but as a general
wheeled autonomous platform. It can therefore be used for educational, research or industrial
implementation. Research on obstacle avoidance robot at the polytechnic level can help
students to develop communication, technical skills and teamwork. The design of such robot
is very flexible and various methods can be adapted for another implementation.
Obstacle Avoidance Robot has a vast field of application. They can be used as services
robots, for the purpose of household work and so many other indoor applications. Equally they
have great importance in scientific exploration and emergency rescue, there may be places that
are dangerous for humans or even impossible for humans to reach directly, then we should use
robots to help us. Nowadays, even in ordinary environments, people require that robots to
detect and avoid obstacles. For example, an industrial robot in a factory is expected to avoid
workers so that it won’t hurt them.
From the experiment, there are several pros and cons that can be discuss in the overall
usage of Obstacle Avoidance Robot. Pros can we can discuss are it demands very low
computational load, and can be implemented on low-cost microcontrollers, it is capable to
avoid any kind of static obstacles, and even some moving obstacles, like walking humans, it
requires low cost sensors which is ultrasonic sensor, it can be easily adapted for other sensors,
like rotating laser rangers, and it perform very well on narrow corridors.
22
The major weaknesses are those common for the majority of purely reactive algorithms
such as it is far from being optimal, the motion is not smooth, it requires a higher level path
planner to perform reasonably well in maze-type environments, motion is attempted even if
there is no path to goal, failure is possible even when a valid path to goal exists, and It is
vulnerable to sensor noise; This problem is partly solved with this algorithm because it
considers the readings of all sensors when computing the rebound angle.
23
9.0 Conclusion
The completed project has not reach its maximum potential. However we feel grateful
because the coding for the Arduino run successfully. The most critical part in this project was
the coding. In addition, there is also a lot more enhancement that can be applied to our robot
such as adding more sensors for more effective response such as putting up more ultrasonic
sensor in the left and right in our robot so that it can manoeuvre and avoid obstacle at left and
right side, we could also add a camera to capture image and recording videos, high
performance battery for longer lifetime performance if we have enough budget to upgrade
our project to become a high end product. The aesthetic value will need to be considered and
valued if it is planned for manufacture and distribute into the market. The safety aspect is also
important to make sure the robot will not break down easily and prevent injuries to the users.
However, we need more time to do research on how to apply the upgrades mentioned above.
During the assembly of our mini robot, we could understand the function of PDB
(Power Distribution Board) which is task to distribute the power to the motor. The PDB will
receive the signal from Arduino board that act as the brain of the robot. It was able to avoid
obstacle is due to the Ultrasonic sensor that shoot the ultrasonic ray at the front.
24
10.0 Recommendation
For future improvement, we will improvise the robot to make the robot smart enough to detect
all objects in any position of room. Next, we will make sure to make the robot smarter such
that the robot can cleans any room, it will save the information about obstacle and its location
and if the user want to clean a room it just will restore information and it will clean faster.
25
11.0 References
1. Eleczone, N. (2018). Arduino Kit Obstacle Avoiding Robot Pengelak Halangan | Nadi
Eleczone Solutions. [online] Nadi Eleczone Solutions. Available at:
https://www.nadieleczone.com/ulasan-produk/arduino-kit-obstacle-avoiding-robot-
pengelak-halangan/ [Accessed 5 Dec. 2018].
2. Author, N. (2018). Arduino Uno. [online] En.wikipedia.org. Available at:
https://en.wikipedia.org/wiki/Arduino_Uno [Accessed 5 Dec. 2018].
26