0% found this document useful (0 votes)
28 views24 pages

Chapter 1 Overview of Line Detection and Obstacle Avoidance Robots

Uploaded by

hieuchuyenlc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views24 pages

Chapter 1 Overview of Line Detection and Obstacle Avoidance Robots

Uploaded by

hieuchuyenlc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

CHAPTER 1: OVERVIEW OF LINE DETECTION AND STATIC

OBSTACLE AVOIDANCE ROBOTS


I. ISSUES
Nowadays, robots are widely used in technology, science and engineering, etc and among
them, a prominent product of technology is the line detection and obstacle avoidance
robot. Static Obstacle Avoidance Line Robot is an autonomous robot that is capable of
following a path marked by lines while still detecting and avoiding obstacles in the
surrounding environment.

The Development History of Line-following and Obstacle-avoiding Robots


Line-following and static obstacle-avoiding robots are widely used in various fields such
as automation, smart transportation, manufacturing, and robotics competitions. These
robots can operate autonomously or navigate in complex environments to follow a
specific path or avoid obstacles. The history of their development can be divided into
several key stages:
- Early Stages (1960s – 1970s)
 The First Robots: In the 1960s and 1970s, research in robotics mainly focused on
developing theoretical foundations and basic robotic control systems. The first
line-following and obstacle-avoiding robots were primarily research models
created in laboratories and had limited practical applications.
 Simple Sensors: Robots in this period mainly used basic mechanical and optical
sensors to detect lines or identify obstacles. However, their ability to interact with
and respond to the environment was very limited.
- Development Phase (1980s – 1990s)
 Enhanced Processing Capabilities: During the 1980s and 1990s, robots began to
be equipped with a variety of sensors, including infrared sensors, ultrasonic
sensors, and light sensors. Control systems were also improved, with algorithms
such as PID (Proportional-Integral-Derivative) used to enable robots to more
effectively track lines and avoid obstacles.
 Industrial Applications: Line-following and obstacle-avoiding robots started to be
applied in industries like warehouse automation, where robots could move along
marked paths or rails to transport goods. Major companies like Toyota and Honda
began researching the use of robots for autonomous transportation within factories.
- Advanced Phase and Automation (2000s)
 Robots in Competitions: Robotics competitions, such as RoboCup or FIRST
Robotics, played a significant role in accelerating the development of these robots.
Competitors were tasked with designing robots capable of accurately following
lines and avoiding obstacles without major failures.
 Autonomous Vehicle Applications: Autonomous vehicles began to attract
significant attention in the 21st century. Line-following and obstacle-avoiding
systems became core technologies in the development of self-driving cars. These
vehicles used sensors like LIDAR, radar, and cameras to detect the environment
and localize themselves on the road.
 Advanced Sensors and Algorithms: Robots in this era were equipped with more
advanced sensors like LIDAR, fingerprint sensors, and cameras to improve their
ability to detect and interact with the environment. Machine learning and artificial
intelligence (AI) algorithms began to be applied, enabling robots to learn how to
navigate complex environments without needing to program every movement.
- Modern Phase and Sustainable Development (2010s – Present)
 Intelligent Sensors and AI: Modern robots are now equipped with even more
sophisticated sensors, such as high-resolution 3D cameras, infrared sensors, and
AI-driven systems. These enhancements allow robots to not only follow lines but
also understand complex scenarios like moving obstacles, terrain changes, or
human interactions.
 Widespread Industrial Use: Line-following and obstacle-avoiding robots have
become essential in industrial applications, particularly in logistics and warehouse
automation. They are used to transport goods autonomously in smart warehouses
and are also integrated into automated manufacturing lines, requiring minimal
human intervention.
 Self-driving Cars and Smart Traffic: The development of self-driving car
technology has brought forward the use of line-following and obstacle-avoiding
robots in real-world transportation systems. Major companies like Tesla, Google
(Waymo), and traditional car manufacturers are integrating these technologies to
create vehicles that can safely navigate complex road conditions with the help of a
combination of sensors and deep learning algorithms.
- Current Technology and Future Trends
 Automated Transport Robots: Modern line-following and obstacle-avoiding
robots are increasingly used outside industrial settings, including in autonomous
delivery services in urban environments or campus areas. These robots are
designed to carry goods or packages autonomously.
 AI and Deep Learning: With the growth of deep learning and AI, current robots
are not only capable of line-following but can also recognize obstacles, analyze the
surrounding environment, and make real-time decisions. These robots can learn
and improve their performance over time without needing hardware modifications.
 Human-Robot Interaction: Today, line-following and obstacle-avoiding robots
are designed to safely interact with humans. This is particularly important in
applications such as healthcare, education, and customer service, where robots
work alongside people in shared spaces.
Conclusion
The development history of line-following and obstacle-avoiding robots reflects the
ongoing advancements in robotics for autonomous movement and interaction with the
environment. From early research models to today's AI-driven systems, these robots have
become crucial tools in numerous industries and applications. In the future, they will
continue to evolve, becoming even more intelligent and capable of performing complex
tasks in diverse environments.

II. Line detection and static obstacle avoidance robot overview


1. Line Detection Robots
1.1. Definition: Line detection robots are designed to follow a predefined path
marked by lines on the ground, usually black lines on a white surface or vice
versa. They are commonly used in applications like automated guided vehicles
(AGVs) and educational robotics.
1.2. Key components:
- Sensors:
Infrared (IR) Sensors: Detect the contrast between the line and the surface.
Camera Systems: For more advanced applications, vision systems can analyze the path.
- Control Systems:
Microcontrollers or Microprocessors: Process sensor data and control motors to adjust the
robot's direction.
- Actuators:
Motors: Drive wheels based on the control signals.
- Algorithms:
PID Control: Adjusts the robot’s movement to stay on the line.
Thresholding: Differentiates between line and surface using sensor readings.
2. Static Obstacle Avoidance Robot
2.1. Definition: Static obstacle avoidance robots are designed to navigate an environment
while detecting and avoiding obstacles. They can be used in various settings, from
autonomous vehicles to household cleaning robots.
2.2. Key components:
Sensors:
Ultrasonic Sensors: Measure distance to obstacles using sound waves.
Lidar: Provides a detailed 3D map of the surroundings.
Infrared Sensors: Can detect obstacles nearby.
Camera Systems: For visual processing and navigation.
Control Systems:
Microcontrollers or Microprocessors: Analyze sensor data and make real-time decisions
about movement.
Actuators:
Motors: Control the robot’s movement based on the processed information.
Algorithms:
Reactive Navigation: Immediate responses to obstacle detection, often using simple rules
(e.g., turn left if an obstacle is detected on the right).
Path Planning Algorithms: More complex strategies like A* or Dijkstra’s algorithm to
navigate around obstacles.
Integration and Applications
- Integration: Many robots combine line detection and obstacle avoidance to create
more robust navigation systems. For example, a robot might follow a line while
being able to detect and avoid obstacles along its path.
- Applications:
Industrial Automation: AGVs following paths in warehouses.
Home Robotics: Vacuum robots that navigate around furniture while following set
paths.
Research and Education: Platforms for teaching robotics and programming
concepts.
Challenges
Environmental Variability: Changes in lighting or surface can affect sensor performance.
Complex Obstacles: More complex environments require advanced algorithms for
effective navigation.
Sensor Limitations: Each sensor type has its own strengths and weaknesses, necessitating
careful selection and integration.
In summary, line detection and obstacle avoidance robots are essential in various
industries and research areas, leveraging sensor technology and algorithms to navigate
effectively in their environments.

Why use a 4-wheel static line-detecting and obstacle-avoiding robot instead of a 3-


wheel or 2-wheel one?
Using a line-following and obstacle-avoidance robot with four wheels offers several
advantages over two or three wheels. Here are some specific reasons:
- Greater Stability: A four-wheeled robot has a sturdier structure, maintaining
stability while moving and turning, especially on uneven surfaces.
- Flexible Control: With four wheels, the robot can easily pivot and change
direction without needing to turn its entire body, enhancing control and tracking
efficiency.
- Improved Obstacle Navigation: A four-wheeled robot can more easily overcome
small obstacles, thanks to better weight distribution and traction.
- Even Weight Distribution: Having four wheels helps the robot distribute its
weight more evenly, reducing the risk of tipping or losing balance during
movement.
- Increased Speed and Performance: A four-wheeled robot can achieve higher
speeds and maintain better performance, particularly in scenarios requiring rapid
directional changes.
 In summary, a four-wheeled robot provides enhanced stability, flexibility, and
higher performance, making it more effective for line following and obstacle
avoidance.

3. Research objectives
Research and build a robot model to detect lines and avoid obstacles
Research and develop robots in applications of technology
4. Object and scope of research
 Regarding object

a, Line Detection Robots:


Robots capable of detecting and following a marked path (line) on a surface, using
infrared sensors, optical sensors, or cameras.
Control methods and algorithms employed to keep the robot on the line, including PID
control and other control algorithms.
b, Obstacle Avoidance Robots:
Robots capable of identifying and avoiding obstacles in their surroundings, using
ultrasonic sensors, lidar, or cameras.
Processing and decision-making algorithms, such as reactive navigation or path planning.
 Scope
a, Sensors and Technology:
Researching different types of sensors (infrared, ultrasonic, lidar) and their operational
principles.
Optimizing the use of sensors to enhance the detection capabilities of lines and obstacles.
b, Control Algorithms:
Developing and improving control algorithms to enhance the robot's performance in line
following and obstacle avoidance.
Investigating machine learning and artificial intelligence techniques to improve real-time
decision-making capabilities.
c, Environmental Modeling:
Analyzing environmental factors that affect the robot's performance, such as lighting,
surface types, and spatial structures.
Researching various real-world scenarios (such as factories, warehouses, or public
spaces).
d, Practical Applications:
Examining practical applications of line detection and obstacle avoidance robots in fields
such as industry, transportation, services, and education.
Evaluating the impact of this technology on work efficiency and safety in various working
environments.
5. Research methods
 theoretical research method
a, Definition: Theoretical research method is a method of collecting information through
reading books, newspapers, and documents with the aim of selecting basic concepts and
ideas as the basis for the theory of the topic, forming scientific hypotheses, predicting the
properties of the research object, and building initial theoretical or experimental models.
b, Sensors and Devices
Using infrared (IR) sensors and Ultrasonic sensor to detect line, measure distance and
identify the location of static obstacles.
c, control algorithms
using Arduino program
Implement algorithms based on distance measurements from sensors to determine
alternative movement directions when an obstacle is detected. For example, if the robot
senses an obstacle in front, it may turn left or right depending on the surrounding space.
d, Modeling and simulation
Develop mathematical models to simulate the behavior of the robot while following lines
and avoiding static obstacles
Utilize simulation software (solidwork, fritzing,…) to test and adjust control algorithms in
a virtual environment, allowing for the exploration of multiple scenarios without requiring
a physical robot.
The theoretical research on line-following and static obstacle-avoiding robots not only
contributes to the development of robotic technology but also finds applications in various
practical fields such as automation, logistics, and smart systems. The integration of theory
and experimentation is key to improving and enhancing the performance of these systems.
 Experimental research method
a, Definition: The experimental method is a research method used in science and research
to collect data and test hypotheses or solve proposed problems. It is a process used by
researchers to test the accuracy and validity of assumptions and inferences through
conducting experiments, observing and collecting actual data.
b, Define Experimental Objectives
Set specific goals for the experiment, such as the ability to follow a line accurately,
performance in obstacle avoidance, or speed of movement.
c, Design the Robot System
Select Sensors: Choose appropriate sensors (infrared sensors, ultrasonic sensors) for line
detection and obstacle avoidance.
Configure Hardware: Build the robot with the necessary chassis, motors, and control
circuits.
d, Program Control Algorithms
Develop and program control algorithms for the robot, including:
Line Following: Control motors based on signals from the sensors
Obstacle Avoidance: Process signals to determine distance and decide on movement
direction. (
e, Design the Test Environment
Create a simulated testing environment that includes:
A clearly marked line with varying colors or reflectivity.
Obstacles placed in various positions and shapes to test obstacle avoidance capabilities.
f, Conduct Experiments
Perform Tests: Run the robot through designated paths to collect data on performance in
different scenarios.
Record Data: Log parameters such as speed, completion time, and success rate in line
following and obstacle avoidance.
g, Analyze Results
Analyze the collected data to evaluate:
 Accuracy in line following.
 Effectiveness in obstacle avoidance.
Compare results against the initial objectives set.
h, Optimize and Adjust

CHAPTER 2: THEORETICAL BASIS


2.1. General introduction to line detection and obstacle avoidance robots
Line detection and obstacle avoidance robots are an exciting area of robotics that
combines cutting-edge sensors and intelligent algorithms. This documentation aims to
provide a comprehensive guide to understanding the principles, techniques, and
integration of these two critical functionalities. Together, we will explore the challenges
and solutions involved in building a successful line detection and obstacle avoidance
robot.
2.1.1. Line Detection
a, Principles of line detection
Line detection is the fundamental capability of a line following robot. By understanding
the principles of line detection, including light sensing and reflection, we can develop
effective algorithms for our robot to follow lines accurately.
b, Sensors and techniques for line detection
There are various sensors and techniques available for line detection, including infrared
sensors, color sensors, and camera-based systems. Each has its advantages and
drawbacks, and we will explore their characteristics to make informed choices for our
robot. Here, we use infrared and ultrasonic sensors to track lines.

Figure 1: infrared sensor

Figure 2: Ultrasonic sensor

c, Algorithm for line following


The algorithm for line following dictates how our robot detects and adjusts its path based
on the line detected. From basic proportional control to more complex algorithms, we will
cover the various approaches to ensure smooth and precise line following.
2.1.2. Obstacle avoidance
a, Challenges in obstacle avoidance
Obstacle avoidance is a critical capability for robots to navigate unpredictable
environments. We will explore the challenges faced, such as sensor limitations and
dynamic obstacle detection, and discuss strategies to overcome them.
b, Sensors and techniques for obstacle detection
A wide array of sensors can be utilized for obstacle detection, including ultrasonic
sensors, infrared sensors, and LIDAR. This section will detail the technologies available
and the pros and cons of each, empowering us to select the most suitable sensor for our
robot.

Figure 3: Obstacle avoidance path simulation

c, Algorithm for obstacle avoidance


An effective obstacle avoidance algorithm is vital for a robot's safety and navigation. This
section will cover different strategies such as reactive and predictive algorithms,
providing insights into their implementation and benefits.
d, Integration of Line Detection and Obstacle Avoidance
The successful integration of line following and obstacle avoidance algorithms is key to
building a versatile robot. We will explore approaches to seamlessly combine these
functionalities, enabling the robot to navigate complex environments while following
lines.
Once the integration is complete, thorough testing and fine-tuning are crucial to ensure
optimal performance. This section will guide you through the testing process and provide
tips for adjusting parameters and refining the integrated system.
2.1.3. Conclusion
Line detection and obstacle avoidance are fundamental capabilities in robotics. We have
explored the principles, sensors, algorithms, and integration of these functionalities,
equipping you with the knowledge to build your own efficient and intelligent line
detection and obstacle avoidance robot.
2.2. Operation principle
2.2.1 Line detection principle
- Light Sensors: The robot typically employs light sensors (such as photoresistors or
infrared sensors) to detect the color of the surface beneath it. When the robot moves over
a black line (often black tape), the sensor recognizes this and sends a signal to the
controller.
- Signal Processing: The controller (usually a microcontroller) receives the signal from
the sensor and decides the next action, such as adjusting the robot's direction to keep it on
the path.
2.2.2 Obstacle Avoidance Principle
- Ultrasonic or Infrared Sensors: The robot uses these sensors to detect the distance to
surrounding obstacles. When a sensor detects an obstacle at a close range, it sends a signal
to the controller.
- Control Algorithm: The controller processes the information from the sensors to adjust
the robot's movement direction, such as turning left or right to avoid a collision.
2.2.3. Integration of Both Principles
The line-following obstacle-avoiding robot can integrate both principles. When the robot
is following the line but detects an obstacle, it will pause or adjust its direction to avoid a
collision, and then return to its line-following task.
2.2.4 Control algorithms
a, Commonly used control algorithms, such as ARDUINO
- Arduino is an open-source platform used for developing electronic projects.
This platform includes both a physical programming board (commonly referred to as a
microcontroller) and an IDE (Integrated Development Environment) software that runs on
your computer, used to write and upload code to the physical board.

- Arduino has become very popular among beginners getting acquainted with
electronics. Unlike most previous programming boards, Arduino does not require a
separate hardware programmer to upload new code—you simply use a USB cable.
Furthermore, the Arduino IDE utilizes a simplified version of the C++ programming
language, making it easier to learn programming.
Figure 4: Arduino R3 Microcontroller

- The Arduino hardware and software are designed for teachers, students,
designers, enthusiasts, hackers, beginners, and anyone interested in creating interactive
objects or environments. Arduino can connect to buttons, LEDs, motors, speakers, GPS
devices, cameras, the internet, and even your smartphone or TV.

- This flexibility, along with the fact that the Arduino software is free, its
hardware is relatively inexpensive, and both hardware and software are easy to learn,
has created a large and active community. This community has contributed and
published numerous tutorials and code for a wide variety of projects based on the
Arduino platform.
- There are many types of Arduino boards that can be used for different
purposes. Some boards may look slightly different from the one below, but most
Arduinos share a majority of the following common components:

- Each Arduino board needs a method to connect to a power source. The


Arduino UNO can be powered via a USB cable from your computer or from a wall power
supply (such as a power adapter) connected through a barrel jack. In the illustration, the
USB connection port is labeled (1) and the barrel jack is (2).
 GND (3): Stands for "Ground." There are multiple GND pins on the Arduino, and
any of them can be used to ground the circuit.
 5V (4) & 3.3V (5): As the names suggest, the 5V pin provides a voltage of 5 volts,
while the 3.3V pin provides a voltage of 3.3 volts. Most basic components used
with Arduino operate at either 5V or 3.3V.
 Analog (6): The area labeled 'Analog In' (from A0 to A5 on the UNO) contains the
analog input pins. These pins can receive signals from analog sensors (such as
temperature sensors) and convert those signals into numerical values that we can
read.
 Digital (7): Above the analog pins are the digital pins (from 0 to 13 on the UNO).
These pins can be used for both digital input (for example, to check if a button is
pressed) and digital output (such as powering an LED).

 PWM (8): You may notice a tilde (~) next to some of the digital pins (specifically
pins 3, 5, 6, 9, 10, and 11 on the Arduino UNO). These pins function as regular
digital pins but can also be used for a feature called Pulse Width Modulation
(PWM). We have a detailed guide on PWM, but for now, you can understand that
these pins can simulate analog output (such as dimming and fading an LED).
 AREF (9) : The abbreviation for Analog Reference. Typically, you can leave this
pin unconnected. However, it is sometimes used to set an external reference
voltage (from 0 to 5 volts) as the upper limit for the analog input pins

b, Line Detection:
- When the left sensor detects a line (high signal), the robot turns left.
- When the right sensor detects a line, the robot turns right.
- If neither sensor detects a line, the robot turns back.
c, Obstacle Avoidance:
- If the ultrasonic sensor detects an obstacle at a certain distance (e.g. less than 20
cm), the robot stops and determines the direction of rotation.
- The robot can turn left or right depending on the location of the obstacle, or turn
back and find a new direction.
- To sum up, the line-following obstacle-avoidance robot utilizes a combination of
sensors to detect the path and obstacles, a controller to process signals, and adjust
its movement. This operation allows the robot to autonomously navigate along a
predefined path while avoiding collisions with obstacles.
CHAPTER 3: SYSTEM MODELING
Kinematics of Line Detection and Static Obstacle Avoidance Robot
In robotics, line detection and static obstacle avoidance are two critical functionalities for
autonomous navigation. These behaviors often rely on sensors, algorithms, and control
strategies to allow the robot to follow a line while avoiding obstacles in its path. Below is
an explanation of the kinematics and key components of a robot designed for both tasks.
1. Kinematic Model of the Robot
The kinematic model describes the motion of the robot with respect to time, without
considering forces or mass. In a robot designed for line detection and static obstacle
avoidance, the typical kinematic model is based on differential drive, where two wheels
(or motors) control the robot's velocity.
a. Differential Drive Kinematics
A robot with a differential drive system typically has two wheels located on either side of
the robot. The kinematic equations for a differential drive robot can be expressed as:
 x(t)x(t)x(t): the robot's position along the x-axis (forward/backward).
 y(t)y(t)y(t): the robot's position along the y-axis (left/right).
 θ(t)\theta(t)θ(t): the orientation of the robot (heading angle with respect to the x-
axis).
Let the two wheels have the following linear velocities:
 vLv_LvL: linear velocity of the left wheel.
 vRv_RvR: linear velocity of the right wheel.
The robot's linear velocity vvv and angular velocity ω\omegaω are given by:
v=vL+vR2v = \frac{v_L + v_R}{2}v=2vL+vR ω=vR−vLL\omega = \frac{v_R - v_L}
{L}ω=LvR−vL
Where LLL is the distance between the two wheels (the axle length).
The robot's motion can be described by the following differential equations:
dxdt=vcos⁡(θ)\frac{dx}{dt} = v \cos(\theta)dtdx=vcos(θ) dydt=vsin⁡(θ)\frac{dy}{dt} = v \
sin(\theta)dtdy=vsin(θ) dθdt=ω\frac{d\theta}{dt} = \omegadtdθ=ω
These equations describe how the robot's position and orientation change with respect to
time based on the velocities of the left and right wheels.
2. Line Detection
Line detection is often achieved using sensors like infrared (IR) sensors, color sensors, or
cameras that can detect a visible line (e.g., a black line on a white surface). The robot
needs to follow this line while maintaining its orientation relative to the path.
a. Line Following Control Algorithm
The primary challenge in line detection is to keep the robot on the path while adjusting its
trajectory. A common approach to line following is to use a feedback control algorithm
like Proportional-Integral-Derivative (PID) control.
 Proportional (P): The robot adjusts its direction based on how far it deviates from
the center of the line.
 Integral (I): The robot accounts for accumulated errors over time, helping to
eliminate drift.
 Derivative (D): The robot anticipates the direction of the error and makes
corrections faster.
Given a sensor reading, the control algorithm adjusts the robot's steering (turning the
wheels) to correct for deviations from the line.
The general line-following logic includes:
1. Sensor Feedback: The robot uses its sensors (e.g., a set of IR sensors) to detect
whether it is off-center from the line.
2. Error Calculation: The sensor readings provide a measure of the robot’s error in
terms of lateral displacement from the line.
3. Adjustments: The robot adjusts its speed or steering angle to bring it back onto the
line.
A simple proportional controller can be expressed as:
Steering Correction=Kp⋅Error\text{Steering Correction} = K_p \cdot \
text{Error}Steering Correction=Kp⋅Error
Where:
 KpK_pKp is a proportional gain constant.
 Error\text{Error}Error is the lateral displacement from the center of the line.
The robot continuously adjusts its steering to minimize this error, keeping it on the line.
3. Static Obstacle Avoidance
Static obstacle avoidance ensures the robot can detect and avoid objects in its path, which
may include walls, barriers, or other obstacles. This is typically achieved using sensors
like ultrasonic sensors, LiDAR, or cameras that provide distance measurements to
obstacles.
a. Sensor-based Obstacle Detection
The robot’s sensors detect the distance to obstacles. If the distance is below a predefined
threshold, the robot needs to make an adjustment to avoid the obstacle.
b. Obstacle Avoidance Algorithms
There are various algorithms for obstacle avoidance, but a commonly used one is the
Potential Field Method or Bug Algorithm.
1. Potential Field Method:
o In this method, obstacles are treated as "repulsive" forces and the target (or
line) as an "attractive" force. The robot moves in the direction of the overall
force (the sum of the attractive and repulsive forces).
o The robot will avoid obstacles by moving away from them while still being
drawn towards the target line.
The control law for motion based on this potential field can be written as:
Ftotal=Fattractive+FrepulsiveF_{\text{total}} = F_{\text{attractive}} + F_{\
text{repulsive}}Ftotal=Fattractive+Frepulsive
Where:
o FattractiveF_{\text{attractive}}Fattractive is the force drawing the robot
toward the line.
o FrepulsiveF_{\text{repulsive}}Frepulsive is the force that repels the robot
from obstacles.
2. Bug Algorithm:
o The robot follows the line until it detects an obstacle. If an obstacle is
detected, the robot follows the perimeter of the obstacle until it finds a way
to continue along the line.
o The "bug" algorithm can be implemented using a simple rule: if an obstacle
is detected, turn and move around it until the robot can safely proceed along
the line.
c. Obstacle Avoidance Behavior
The behavior of the robot in the presence of obstacles is as follows:
1. Detection: The robot scans the environment for obstacles using sensors (e.g.,
ultrasonic or LiDAR).
2. Avoidance Decision: If an obstacle is detected in front of the robot, it computes a
new direction to avoid the obstacle. This may involve turning or moving backward.
3. Movement: The robot executes the movement necessary to avoid the obstacle,
while maintaining its goal of line-following (if possible).
4. Resume Line Following: After avoiding the obstacle, the robot reorients itself and
resumes following the line.
4. Integrated Line Following and Obstacle Avoidance
In an integrated system, the robot must continuously balance line following and obstacle
avoidance. The robot follows the line while monitoring for obstacles. If an obstacle is
detected, it switches to an avoidance mode, navigating around the obstacle, then resumes
line following once the path is clear.
The integration of these behaviors can be achieved with a state machine or a priority
system:
 If an obstacle is detected, the obstacle avoidance behavior takes priority,
temporarily interrupting the line following.
 Once the obstacle is avoided, the robot returns to line following mode.
A typical behavior loop for such a robot might look like:
1. Sense Line: Continuously check for deviations from the line.
2. Sense Obstacle: Continuously check for obstacles in front of the robot.
3. Decision:
o If no obstacle is detected, follow the line using the line following control
algorithm.
o If an obstacle is detected, switch to obstacle avoidance mode and navigate
around the obstacle.
4. Repeat: Once the obstacle is avoided, switch back to line-following mode.
Conclusion
In summary, the kinematics of a robot designed for line detection and static obstacle
avoidance relies on the differential drive model, which allows for control of the robot's
forward movement and turning. Line detection is handled by sensor feedback and control
algorithms like PID, while obstacle avoidance is typically achieved using potential fields
or other path planning algorithms. By integrating these two behaviors, the robot can
autonomously follow a line while avoiding obstacles in its environment.
3.1 System block diagram design
3.1.1. Definition
System block diagram design is the process of building a visual model to describe the
major components of a system and the relationships between them. Block diagrams help
analyze, communicate, and design the processes, information flows, and functions of a
system in a clear and understandable way.
Flowcharts are commonly used in engineering, project management, software
development, and many other fields to describe processes, information systems, or
complex operating mechanisms.
3.1.2 Using fritzing to design electronic circuit
Fritzing is an open source software designed specifically for people who need to create
electronics projects, especially hardware libre, and those who do not have access to the
necessary documentation. It can also be used to implement your designs, record examples
for tutorials, etc. In addition, this tool has a large community behind it that is always
updated or ready to help if you run into problems. It can even be a great tool for
classrooms, for both electronics students and teachers, for users who want to share and
record their prototypes, and even for professionals.

Figure 5 wiring diagram

The electronic circuit consists of an arduino sensor controller, an H-bridge circuit, 4 servo
motors, 3 infrared sensors, 1 battery and 1 ultrasonic sensor.
3.2. Sensor analysis and selection
3.2.1. Infrared sensor
Infrared sensor has the English name Infrared Sensor,
abbreviated IR Sensor. Infrared sensor is an electronic device
that can emit or receive infrared radiation from the
environment around them. The structure includes a light-
emitting diode (LED) and a receiver. When an object
approaches the sensor, the LED device will actively emit
infrared radiation and reflect it back to the object so that the
receiver can detect it.

3.2.2. Ultrasonic sensor


Ultrasonic sensor is an electronic sensor device, used to
measure the distance of a target object by emitting
ultrasonic waves, then the reflected sound is converted
into an electrical signal. The signal will be processed
and reported at the output. The transmitter of the sensor
is capable of producing sound by using piezoelectric
crystals. The receiver has the role of receiving sound to
and from locations.
The ultrasonic sensor consists of 3 main components: Transmitter (transmits sound wave
signal), receiver (receives sound source after transmission), sound wave processor. The
wave processor is integrated inside the sensor. After receiving the feedback signal, it will
immediately analyze and calculate to give the distance between the transmitting points
and the wave point touching the object through the time the wave reaches the object and
the transmission speed of the ultrasonic wave. Finally, this information will be converted
into an analog signal and transmitted to a signal reader circuit that converts it into a logic
signal and displays the information to the user.
Using an ultrasonic sensor placed at the front of the vehicle, above the infrared sensor,
which detects static obstacles and avoids obstacles

3.3. Controller analysis and selection


Use Arduino Uno for programming
Basic parameters of Arduino Uno R3
Microcontroller Atmega 328 ( 8 bit)
operating voltage 5V ( USB powered)
Operating frequency
Current consumption
Limited input voltage

Reason choose Arduino uno r3


Using the Arduino Uno R3 to design and control a line-following robot and an obstacle-
avoidance robot offers numerous advantages due to its features. Here's why it's a suitable
choice for such applications:
- Ease of Use and Learning
The Arduino Uno R3 is one of the most popular microcontroller boards, with extensive
documentation and a large support community. This makes it an excellent platform for
beginners and developers who want to quickly prototype and build robots without delving
deeply into complex hardware design.
- Scalability and Flexibility
Arduino Uno offers a good number of General Purpose Input/Output (GPIO) pins, which
allow you to easily connect a variety of sensors and actuators. For line-following and
obstacle-avoidance robots, you typically need:
 Line sensors (e.g., infrared or optical sensors).
 Obstacle sensors (e.g., ultrasonic or infrared sensors).
The Arduino Uno R3 can interface with these sensors and process the input to control the
robot’s motors effectively.
- Low Cost
The Arduino Uno R3 is relatively inexpensive compared to other microcontroller boards
or robotic systems. This makes it a cost-effective solution for academic projects, DIY
enthusiasts, or prototype development.
- Programming Flexibility
Arduino uses a simplified C/C++ programming environment, making it accessible for
developers of all skill levels. You can easily implement algorithms such as:
 Line-following algorithms: Process input from line sensors to control motors and
follow a line path.
 Obstacle-avoidance algorithms: Use input from ultrasonic or infrared sensors to
detect and avoid obstacles in real-time.
- Motor Control and Expansion Modules
The Arduino Uno R3 can easily interface with motor driver modules such as L298N,
allowing control over various types of motors (DC motors, servos, or stepper motors).
This capability is crucial for building mobile robots with movement precision.
Conclusion
The Arduino Uno R3 is an ideal platform for building line-following and obstacle-
avoidance robots due to its ease of use, affordability, scalability, and the extensive support
from the Arduino ecosystem. Its versatility in interfacing with various sensors and
actuators, combined with its low power consumption and sufficient processing
capabilities, makes it a perfect choice for educational, hobbyist, and even professional
robotics projects.

Figure 6 Connect the pins to the arduino


3.4. Modeling and Simulation

Utilizing solidwork software to draw 3d drawings and details in the form of


decomposed projections to better understand and easily visualize the shape of the robot.

You might also like