Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor and Arduino Microcontroller
Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor and Arduino Microcontroller
2pangankenji21998@gmail.com
3senecabrando@gmail.com
4
velascovincent@gmail.com
Abstract— Obstacle avoidance and detection is one of the The Robotics Revolution. More importantly, it will have an
applications in designing mobile robots. This technology irrevocable impact on all our lives and the lives of the future.
introduces the robots with senses and tries to adapt in unfamiliar
environment with damaging itself. This project is design to build Robotics in today's world is a fast-growing and interesting
an autonomous robot that acts a stand-alone system, complete
with its own controller. An obstacle-avoiding robot is a type of
field. The robot has sufficient intelligence to cover the
autonomous mobile robot that avoids collision with unexpected maximum space available. Autonomous Intelligent Robots are
obstacles using ultrasonic sensors for its movement. This robotic robots capable of performing desired tasks in unstructured
vehicle is built, using a micro-controller of AT mega 328 families. environments without continuous human guidance. The
Using an ultrasonic sensor, any obstacle before it is detected and detection of obstacles is the primary requirement of this
a command is sent to the microcontroller. The Arduino board autonomous robot [4].
was selected as the microcontroller platform and its software Obstacle avoidance Robot is designed by avoiding
counterpart. The Arduino Software version 1.8.9 was used to collisions to navigate the robot in an unknown environment.
verify, upload or carry out the programming. This obstacle Obstacle in the path avoiding robot senses obstacle, avoiding
avoidance robot uses two drive tires are driven by two DC
motors. The integration of one ultrasonic sensor provides high
it and restarting its running. There are some very popular
accuracy in detecting obstacle by detecting or observing its robot navigation methods such as wall-following, edge
environment and the commands is Arduino program based. The detection, line-following, and much more. A more general and
hardware used in this project was easily accessed in online commonly used method for the avoidance of obstacles is
shopping platform and it is widely available and inexpensive that based on the need for the robot to stop in front of an obstacle.
makes the robot easily accessible. [1].
The module has two screw terminal blocks for the motor A
and B, and another screw terminal block for the ground pin,
the Vcc for the motor, and a 5v pin that can be either an input
or an output.
MATERIALS
Quantity Material
Power Supply: + 5v DC 1 Ultrasonic Sensor
Quiescent Current: <2mA 1 L298N Driver
Working Current: 15mA 1 Servo Motor
Ranging Distance: 2 cm – 400cm (1-13 ft) 1 Arduino Uno
1 Sensor Shield
SERVO MOTOR
20 Male and Female connecting wires
4 1.5V AA Battery
Servo Motor is a tiny, lightweight engine with high
output power. Servo can rotate about 180 degrees (90 in each 1 9V Battery
direction) and works just like standard types but smaller. The COSTING
researcher may use any servo code, hardware or library to Quantity Material Cost
control the servos. 1 2wd chassis kit 1,300.00
1 PVC Floor (Casing) 35.00
4 1.5 AA Battery 48.00
1 9V Battery 35.00
20 Connecting Wires 140.00
TOTAL: 1,558.00
L298N DRIVER
WORKING PRINCIPLE
The obstacle avoidance robot's flow chart work. It initially
checks the obstacle within 30 cm. If there is an obstacle, it The obstacle avoidance robotic vehicle uses ultrasonic
stops moving and turns left and right and checks if there is an sensors for its movements. A microcontroller of 8051 family
object closer than 30 cm. The check has two possible results, is used to achieve the desired operation. The motors are
yes or no. Yes, that means there is an object closer than 30 cm. connected through motor driver IC microcontroller.
No meaning that within 30 cm there is no object detected. If The ultrasonic sensor is attached in front of the robot.
there is nothing within 30 cm, the robot can move forward as Whenever the robot is going on the desired path the ultrasonic
the path is clear. If there is something closer than 30 cm, the sensor transmits the ultrasonic waves continuously from its
robot must avoid obstacles. sensor head. Whenever an obstacle comes ahead of it the
First the robot turns left and right, takes a reading, turns left ultrasonic waves are reflected back from an object and that
and right, and takes a reading. Another check occurs to see information is passed to the microcontroller. The
what direction is the best way to go. If left is the way to go it microcontroller controls the motors left, right, back, front
has to turn back to the left and then go forward. If right is the based on ultrasonic signals. In order to control the speed of
way to go the robot, simply moves forward as it is already each motor pulse width modulation is used (PWM).
facing in the right direction.
The wheel output does not move when the switch is turned
on. Because it is not fixed by soldering the output pins of the
said wheel. We change pin configuration from pin 8,9,10 to
pin 11,12,13. The servo motor didn't work. The servo motor
just stays stiff; it can't move any left or right direction. So we
change the configuration of the servo pin from Pin 0 to Pin 3.
The servo motor moved from the initial position to a large
degree of turn to the left. So we change the servo's position,
realizing that it is not in its correct initial center position and
we turn the entire servo motor and approximately find the
center for it to have an equal left and right turn of directions.
While making the packaging, the input for 9v supply to the
arduino board is changed due to the bulky input plug that
would hinder the packaging. We solder it directly to the board
of the arduino. After soldering the 9v input supply directly to
the arduino board. The arduino doesn't work well and is
implemented on automatic reset. So we created a switch for
the 9v battery and placed a reset button outside the Arduino
board by correcting the 9v and ground supply push button in
series and the reset pin in the arduino board. Above all, when
it didn't work well, we found the remedy for the motor and
servo problem easily. This is through the mismatch arduino
code. There is a mismatch in the arduino code and
connections to the configuration of the hardware pin. Make
sure that the pin configuration in the arduino code and the pin
configuration are connected. Hardware problems are harder to
analyse but it’s worth it.
V. CONCLUSIONS
The goal or the function of this project is to developed an
obstacle avoidance robotic vehicle using ultrasonic sensor and
arduino microcontroller.
The Arduino Software version 1.8.9 was used to verify,
upload or carry out the programming. This platform was used
for data processing and it is the software counterpart that
helped to communicate with the robot to send parameters for
guiding movement.
Ultrasonic distance sensors that provided a wider field of
//Define all the connections maps to the L298N
detection were used for obstacle detection. When the robot is
#define enA 13
placed with obstacles in the unknown environment, the robot #define in1 12
avoids the obstacle. #define in2 11
We have considerations for improvement in order to #define in3 7
#define in4 6
optimize the robot's movement. It will cost more money and
#define enB 5
time to implement the modification, however. One of the #define servoPin 2
recommendations for modification was to use a proximity
sensor attached to the back class Motor{
This project benefits us from learning more and exploring
int enablePin;
both hardware and software. It can therefore be used for int directionPin1;
educational advantages, research implementation or industrial int directionPin2;
implementation. It helped us to learn programming for
public:
microcontrollers using C++ and Arduino version 1.8.9
software platform. This helps us develop communication, //Method to define the motor pins
technical skills, creativity, and teamwork. Motor(int ENPin,int dPin1,int dPin2){
enablePin = ENPin;
ACKNOWLEDGMENT directionPin1 = dPin1;
directionPin2 = dPin2;
First and Foremost, praises and thanks to God the Almighty };
Father, for his shower of blessings throughout our research //Method to drive the motor 0~255 driving forward. -1~-255 driving
work to complete the research successfully. backward
void Drive(int speed){
To Engr. Lalaine Jean Ballais, our instructor who shared his if(speed>=0){
knowledge about this project and inspires us to finish this digitalWrite(directionPin1, LOW);
digitalWrite(directionPin2, HIGH);
project. }
else{
To the ideas shared to us by the access of internet and to the digitalWrite(directionPin1, HIGH);
authors of their books and journals. Our heartfelt gratitude to digitalWrite(directionPin2, LOW);
you all. speed = - speed;
}
analogWrite(enablePin, speed);
And lastly to our fellow ECE 4A students for their advices }
and for their constant encouragement to finish this project. };