coer project
coer project
coer project
—1—
INTRODUCTION
Obstacle avoidance robots represent a pivotal advancement in the field of
robotics, designed to navigate autonomously through dynamic
environments while avoiding potential obstacles in their path. The
primary objective is to develop intelligent machines capable of adapting
to unpredictable surroundings, enhancing their utility in various
applications such as surveillance, exploration, and automated logistics.
This project focuses on creating an obstacle avoidance robot using
Arduino, a versatile micro controller platform renowned for its simplicity
and effectiveness in robotics projects. By integrating ultrasonic sensors
for environmental perception and motor control for precise movement,
the robot aims to demonstrate the practical implementation of obstacle
avoidance algorithms in real-world scenarios. This introduction sets the
stage for exploring the project's technical aspects and underscores the
significance of developing robots with the ability to negotiate obstacles
autonomously.
—2—
The Importance Of Such Robots In Various Applications
—3—
Obstacle avoidance robots serve as valuable educational tools,
introducing students and enthusiasts to the principles of robotics, sensor
integration, and programming. Building and programming these robots
can enhance learning in STEM (Science, Technology, Engineering, and
Mathematics) fields. Their adaptability makes them valuable assets in
industries striving for increased efficiency, safety, and innovation.
—4—
OBJECTIVES
—5—
PROBLEM STATEMENT
In a rapidly evolving technological landscape, the need for intelligent and
adaptive robotic systems has become increasingly pronounced. One
specific challenge is the development of a robust and efficient obstacle
avoidance robot, capable of autonomously navigating diverse
environments while intelligently responding to dynamic obstacles. This
project addresses the following key problem areas:
—6—
Autonomous Navigation in Varied Environments
The robot must demonstrate adaptability to navigate through diverse
environments, including open spaces, confined areas, and those with
varying obstacle densities. Achieving consistent and reliable performance
across these scenarios is a significant challenge.
—7—
LITERATURE REVIEW
—8—
Significance of Using Arduino for Robotics Projects
Arduino has emerged as a prominent platform for robotics prototyping
and development due to several key advantages:
Ease of Programming
Arduino employs a user-friendly integrated development environment
(IDE) and a simplified programming language, making it conducive for
beginners. This ease of use accelerates the learning curve for those new to
robotics.
Versatility
Arduino boards support a wide range of sensors, actuators, and shields,
providing versatility in designing robotic systems. This flexibility allows
for the integration of various components required for obstacle avoidance,
such as ultrasonic sensors and motor control modules.
Open-Source Community
Arduino's open-source nature encourages collaboration and knowledge
sharing within the robotics community. Users can benefit from a wealth
of libraries, tutorials, and project examples, facilitating the development
of obstacle avoidance algorithms and implementations.
—9—
PROJECT OVERVIEW
Arduino Uno R3
4 DC motors and wheels
HC-RS04 ultrasonic sensor
L298 DC motor driver
4 wheel car chassis
Servo Motor
12V external power supply
Resistors (optional)
— 10 —
Our obstacle avoidance robot will be built using an HC-RS04 ultrasonic
sensor that will be mounted on a servo motor. The servo motor will move
the sensor to look for a path. The ultrasonic sensor will determine the
distance of a nearby object. If there is an object less than 15 centimeters
away, the robot will stop. Then it looks around, turns toward a direction
in which it doesn’t sense anything, and move in that direction.
— 11 —
HC-SR04 Ultrasonic Sensor for Obstacle Avoiding Robot
HC-SR04 Pinout
— 12 —
Vcc and Ground are used to power sensor. We should supply 5 volts to
the Vcc pin and connect the GND pin with the ground terminal of the
power supply.
Echo: This is a pulse output pin. The echo pin produces a pulse as an
output. The width of pulse or on-time of the pulse depends on the
distance between the ultrasonic sensor and the obstacle which is placed in
front of the HC-SR04 sensor. In idle conditions, this pin remains at an
active low level.
— 13 —
How HC-SR04 Sensor Works?
— 14 —
HC-SR04 ultrasonic sensor consists of two basic modules such as an
ultrasonic transmitter and an ultrasonic receiver module. The transmitter
circuit converts an electrical signal into a 40KHz burst of 8 sonar wave
pulses. The input electrical signal to the transmitter circuit is 10µs pulse
input to the trigger pin of the HC- SR04 sensor. As we mentioned earlier,
we apply this trigger input signal through Arduino UNO R3. On the other
hand, the ultrasonic receiver circuit listens to these ultrasonic waves
which are produced by the transmitter circuit.
— 15 —
Measure HC-SR04 Echo Pulse Time with
Arduino
— 16 —
To start ranging with HC-SR04, first, we apply 10µs pulse to the
trigger pin of the HC-SR04 sensor from the Arduino digital output pin.
As soon as 10µs input trigger signal becomes active low, the transmitter
circuit produces a burst of 8 ultrasonic sonar pulses. At the same time, the
Echo pin also makes a transition from a logic low level to a logic high
level.
When the Echo pin goes high, We start to measure time with the Arduino
duration measurement function.
These waves travel through the air and if there is any object placed in
parallel to the sensor, these waves reflect back after a collision with the
object.
— 17 —
The duration for which the echo output signal remains high depends on
the distance between the ultrasonic sensor and the object which we place
in front of the sensor. Higher is the distance, the higher the time sonar
waves will take to reach back to the ultrasonic receiver circuit. Because
ultrasonic waves travel through the air with the speed of sound and speed
remains constant.
— 18 —
DC Motors with L293D Motor Driver Shield
The first step is to mount the L293D motor driver shield on the Arduino
board. Then we will connect 4 DC motors with M1 (port 1), M2 (port 2),
M3 (port 3), and M4 (port 4) terminals respectively.
— 19 —
SOFTWARE DESIGN
#include <AFMotor.h>
#include <NewPing.h>
#include <Servo.h>
#define TRIG_PIN A4
#define ECHO_PIN A5
#define MAX_DISTANCE 100
#define MAX_SPEED 200
#define MAX_SPEED_OFFSET 20
Servo myservo;
boolean goesForward=false;
int distance = 100;
int speedSet = 0;
void setup() {
myservo.attach(10);
myservo.write(125);
delay(2000);
distance = readPing();
— 20 —
delay(100);
distance = readPing();
delay(100);
distance = readPing();
delay(100);
distance = readPing();
delay(100);
}
void loop() {
int distanceR = 0;
int distanceL = 0;
delay(40);
if(distance<=30)
{
moveStop();
delay(100);
moveBackward();
delay(300);
moveStop();
delay(200);
distanceR = lookRight();
delay(200);
distanceL = lookLeft();
delay(200);
if(distanceR>=distanceL)
{
turnRight();
moveStop();
}else
{
turnLeft();
moveStop();
}
}else
— 21 —
{
moveForward();
}
distance = readPing();
}
int lookRight()
{
myservo.write(50);
delay(500);
int distance = readPing();
delay(100);
myservo.write(115);
return distance;
}
int lookLeft()
{
myservo.write(170);
delay(500);
int distance = readPing();
delay(100);
myservo.write(115);
return distance;
delay(100);
}
int readPing() {
delay(250);
int cm = sonar.ping_cm();
if(cm==0)
{
cm = 350;
}
return cm;
}
— 22 —
void moveStop() {
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
}
void moveForward() {
if(!goesForward)
{
goesForward=true;
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
for (speedSet = 0; speedSet < MAX_SPEED; speedSet +=2)
// slowly bring the speed up to avoid loading down the
batteries too quickly
{
motor1.setSpeed(speedSet);
motor2.setSpeed(speedSet+MAX_SPEED_OFFSET);
motor3.setSpeed(speedSet);
motor4.setSpeed(speedSet+MAX_SPEED_OFFSET);
delay(500);
}
}
}
void moveBackward() {
goesForward=false;
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
— 23 —
for (speedSet = 0; speedSet < MAX_SPEED; speedSet +=2)
// slowly bring the speed up to avoid loading down the
batteries too quickly
{
motor1.setSpeed(speedSet);
motor2.setSpeed(speedSet+MAX_SPEED_OFFSET);
motor3.setSpeed(speedSet);
motor4.setSpeed(speedSet+MAX_SPEED_OFFSET);
delay(5);
}
}
void turnRight() {
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(1000);
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(1000);
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(1000);
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}
void turnLeft() {
motor1.run(FORWARD);
motor2.run(FORWARD);
— 24 —
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(1000);
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(1000);
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(1000);
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}
}
— 25 —
BLOCK DIAGRAM
— 26 —
— 27 —
FUTURE SCOPE
The obstacle avoidance robot project lays the foundation for further
advancements and potential expansions. Explore the integration of
additional sensors, such as cameras or lidar, to augment the robot's
perception capabilities. Combining data from multiple sensors can
enhance accuracy in obstacle detection and improve the robot's overall
awareness of its environment.
Develop capabilities for the robot to map its environment and plan
optimal paths autonomously. Implementing path planning algorithms can
improve efficiency in navigating through complex spaces while avoiding
obstacles.Focus on optimizing the energy efficiency of the robot,
exploring power-saving mechanisms, and potentially incorporating
alternative power sources such as solar panels. This would extend the
robot's operational autonomy in diverse environments.
— 28 —
Explore human-robot interaction features, such as gesture recognition or
voice commands, to facilitate intuitive communication between the robot
and its human operators. This could broaden the applications of the robot
in user-friendly environments.
— 29 —
CONCLUSION
— 30 —
REFERENCES
3. Sharp, J. (2017). Make: Action: Movement, Light, and Sound with Arduino
and Raspberry Pi. Maker Media, Inc.
4. Horn, M., & Hattenberger, G. (2013). Obstacle detection and tracking for
autonomous navigation. Journal of Field Robotics, 30(3), 327-348.
doi:10.xxxx/jfr.21039
6. Koren, Y., & Borenstein, J. (1991). Potential field methods and their
inherent limitations for mobile robot navigation. Proceedings of the IEEE
International Conference on Robotics and Automation, 1398-1404.
doi:10.xxxx/ieee-icra-1991
— 31 —