0% found this document useful (0 votes)
17 views13 pages

PIA IntroMecatronica

The document outlines a project to develop a line-following robot as part of an integrative learning product at Universidad Autonoma de Nuevo Leon. The project aims to create a robot that autonomously follows a trajectory using mechanics, electronics, and software, detailing objectives, materials, development steps, results, and conclusions. Key findings include effective use of infrared sensors and Arduino for motor control, resulting in a functional robot capable of navigating various surfaces and conditions.

Uploaded by

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

PIA IntroMecatronica

The document outlines a project to develop a line-following robot as part of an integrative learning product at Universidad Autonoma de Nuevo Leon. The project aims to create a robot that autonomously follows a trajectory using mechanics, electronics, and software, detailing objectives, materials, development steps, results, and conclusions. Key findings include effective use of infrared sensors and Arduino for motor control, resulting in a functional robot capable of navigating various surfaces and conditions.

Uploaded by

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

UNIVERSIDAD AUTONOMA DE NUEVO LEON

FACULTAD DE INGENIERIA MECANICA Y ELECTRICA

Introduction to mechatronics

ILP – Integrative Learning Product


Line - follower robot competition

Name ID Career
Darío Israel Barrera Martínez 2067873
Javier Kalid Flores Edgar 2177781 IMC
Yareidy Michell Silverio Gaspar 2115243

Professor: Daniela Turrubiates Gutierrez


Group: 002
November/19/2024

Index
Objectives 2
Introduction 4
List of materials 5
Development 6
Steps: 6
Systems 8
Results 10
Conclusions 11
References 12

Objectives

The main objective of this project is to successfully create a line-following robot by applying
knowledge in mechanics, electronics and/or software that can autonomously detect and follow
a trajectory marked on the ground in the shortest possible time. Other secondary objectives
include:

2
• Create a robot that can accurately follow a drawn line on a variety of surfaces, including
regular and irregular curves.

• Maximize robot speed while maintaining stability and line tracking accuracy.

• Ensure stable operation with sensors that adapt to changes in light and environment and
perform consistently regardless of external factors.

• Controls up to two DC motors with a 48:1 ratio and uses H-bridge motor control for precise
motion.

• Efficiently manage power consumption by using two 9V non-rechargeable batteries, one


of which powers the motor while the other powers the controller.

• Create a lightweight, compact chassis that accommodates all components while


maintaining stability during operation.

• Perform extensive testing to fine-tune sensors and control algorithms for optimal running
performance.

3
Introduction

In our recent project, we embarked on an exciting journey to


develop a line follower robot, a task that initially seemed
straightforward but quickly revealed itself to be a complex
challenge. As first-time builders in the realm of robotics, we
approached the project with enthusiasm and confidence, only
to encounter a series of difficulties that tested our problem-
solving skills and perseverance. Despite these challenges,
we successfully completed the robot by the deadline, gaining
invaluable experience along the way.

Throughout this process, we delved into the fundamental


components of robotics, including sensors, actuators, and
controllers. Each element played a crucial role in our project's success, offering us hands-
on experience with technologies that were previously unfamiliar. This introduction will
explore our journey, the lessons learned, and the innovative solutions we implemented to
overcome obstacles. Join us as we reflect on our experiences in creating a line follower
robot and the insights we gained into the fascinating world of robotics.

4
List of materials

• Chassis components:
- Base platform (plastic)
- 2 Yellow rims (65mm diameter with a tolerance of ±3mm).
- 1 idler wheel.

• Motors:
- 2 hobby gear motors (model specific details as required): The two DC
motors drive the wheels of the robot, providing movement. Their speed and
direction can be controlled based on sensor input processed by the Arduino.

• Sensors:
- 2 IR sensors (for line detection): Are essential for detecting the line that the
robot is intended to follow. They work by emitting infrared light, which
reflects off the surface below and returns to the sensor. This allows the robot
to differentiate between the line and the surrounding area based on the
intensity of the reflected light.

• Microcontroller
- Arduino UNO R3: serves as the brain of your robot. It processes input from
the IR sensors and controls the motors based on this data. Its
programmability allows for complex decision-making algorithms that can
optimize performance.
- Arduino shield: Are expansion boards that connect to Arduino boards,
adding different features. They simplify project enhancements without
complex wiring.

• Power supply:
- 2 batteries 9V non-rechargeable battery to power the motor and to power
the control system: Provides the necessary power to both the
microcontroller and motors. A reliable power source is critical for consistent
performance; insufficient power can lead to sluggish movement or erratic
behavior

• Miscellaneous components:
- Protoboards for circuit assembly
- Connection Cables
- Mounting and fixing components.

5
Development

Steps:
These steps outline the development of our line follower robot, detailing the processes
we undertook, the challenges faced, and the solutions implemented. Our project involved
studying infrared (IR) sensors, integrating an Arduino shield for motor control, and coding
the system to achieve effective line-following behavior.

Step 1: Studying IR Sensor Behavior

The first phase of our project focused on understanding the behavior of IR sensors. We
conducted experiments to observe how these sensors detect changes in surface color—
specifically, distinguishing between black and white surfaces. This foundational
knowledge was crucial as it directly influenced our design and programming decisions.

Key Findings:

- Sensitivity: The IR sensors were highly sensitive to light variations, allowing us to


effectively differentiate between the line (black) and the background (white).

- Placement: Proper sensor alignment was essential for accurate detection, leading us to
experiment with various mounting angles to optimize performance.

Step 2: Implementing the Arduino Shield

In the second step, we integrated an Arduino shield designed for controlling motors. This
shield served as both a motor driver and a controller for our robot's system. The shield
simplified connections and provided an efficient way to manage power and signals
between the Arduino and the motors.

Components Used:

- Arduino Board: The core microcontroller for programming and control.

- Motor Driver Shield: Facilitated control over motor speed and direction.

- IR Sensors: Provided input for line detection.

Step 3: Coding the Control System

The final step involved programming the Arduino to respond to sensor inputs and control
the motors accordingly. Below is the code developed for this purpose:

void setup() {
// Initialize serial communication
Serial.begin(9600);

6
// Pin configuration
pinMode(7, INPUT); // Left IR sensor
pinMode(9, INPUT); // Right IR sensor
pinMode(2, OUTPUT); // Motor control pin
pinMode(5, OUTPUT); // Left motor speed
pinMode(4, OUTPUT); // Left motor direction
pinMode(6, OUTPUT); // Right motor speed
}

void loop() {
// Main loop code
int Left_Tra_Value = digitalRead(7);
int Right_Tra_Value = digitalRead(9);
int Black = 1;

// Motor control based on sensor values


if (Left_Tra_Value != Black && Right_Tra_Value != Black) {
// Both sensors detect white
digitalWrite(2, HIGH);
analogWrite(5, 70); // Increase left motor speed
digitalWrite(4, LOW);
analogWrite(6, 70); // Increase right motor speed
}
else if (Left_Tra_Value == Black && Right_Tra_Value != Black) {
// Only right sensor detects black
digitalWrite(2, LOW);
analogWrite(5, 90); // Increase left motor speed
digitalWrite(4, LOW);
analogWrite(6, 90); // Increase right motor speed
}
else if (Left_Tra_Value != Black && Right_Tra_Value == Black) {
// Only left sensor detects black
digitalWrite(2, HIGH);
analogWrite(5, 120); // Increase left motor speed
digitalWrite(4, HIGH);
analogWrite(6, 120); // Increase right motor speed
}
else if (Left_Tra_Value == Black && Right_Tra_Value == Black) {
// Both sensors detect black
digitalWrite(2, LOW);
analogWrite(5, 0); // Stop left motor
digitalWrite(4, HIGH);
analogWrite(6, 0); // Stop right motor
}

Code Explanation:

7
- Setup Function: Initializes serial communication and configures pins for sensors and
motors.

- Loop Function: Continuously reads sensor values and adjusts motor speeds based on
detected colors. Logic ensures that the robot follows the line by responding dynamically
to changes in its environment.

Systems
The control system of our line follower robot is built around an Arduino shield, which
simplifies the integration of motors and sensors. This system allows the robot to
autonomously follow a line by processing input from infrared (IR) sensors and controlling
the motors accordingly.

Components of the Control System

1. IR Sensors:
• The robot is equipped with two IR sensors positioned at the front. These
sensors detect the color of the surface beneath them, distinguishing
between black (the line) and white (the background).
• The sensors provide digital signals to the Arduino, indicating whether they
detect black or white.

2. Arduino Shield:
• The Arduino shield used in this project is designed specifically for motor
control, allowing for easy connection and control of DC motors without
requiring additional components like a separate motor driver.
• This shield can control multiple motors and is equipped with features that
simplify wiring and programming.

3. DC Motors:
• The motors are responsible for driving the robot. The Arduino shield controls
their speed and direction based on sensor inputs.

Control Logic

The control logic implemented in the Arduino code is designed to respond dynamically to
sensor readings, enabling effective line-following behavior. Here’s how it works:

• Setup Phase:
• The setup () function initializes serial communication and configures pins for
IR sensors and motor controls.

• Loop Phase:
• The loop () function continuously reads values from the IR sensors:
• If both sensors detect white, the robot moves forward.
• If only the left sensor detects black, it turns right by adjusting motor
speeds.
• If only the right sensor detects black, it turns left.

8
• If both sensors detect black, it stops to prevent going off course.

Explanation of Control Mechanism

• Motor Control: The shield allows for precise control over each motor's speed and
direction through PWM (Pulse Width Modulation) signals. This enables smooth
operation and responsive adjustments based on sensor input. The shield
distributes the current and ground connections evenly to the whole circuit, allowing
for a faster and more organized cable layout, as well as a more optimized energy
management.
The shield also allowed for speed control directly within the arduino code, instead
of relying on an external component such as a motor H bridge.

• Sensor Feedback Loop: The continuous reading of sensor values creates a


feedback loop that allows the robot to adapt its movements in real-time. This
feedback relied heavily on the sensitivity of the infrared sensors, which were tuned
to only detect the predetermined line. Once these feedback loops were initiated,
the robot would only come to a full stop once it detected blackb on both sensors at
the same time, this being the mark that determines the circuit

9
Results

As proposed initially, the structure of the project was made as lightweight as possible, to
minimize the strain of the wheels, as well as ensure proper functioning of the sensors.
When executed, the robot functioned properly, closely following the line deemed as the path,
and was even able to overcome uncertainties such as really closed corners.
The code permitted the robot to turn rapidly and in tight spaces, but one downside that can be
noted is the battery consumption since it depleted the units relatively quickly due to the energy
demand required to make the engines work at said rate.

10
Conclusions

Line follower robots (LFRs) utilize specific techniques to detect and follow lines based on
the principles of light reflection. To exploit this property, infrared (IR) sensors are
employed due to their precision in detecting light variations. In our project, three IR
sensors are strategically placed on either side of the robot and in the middle of it to identify
the line beneath it.

The development of our LFR has been an enriching and educational experience that
deepened our understanding of robotics and automation. Initially approached with
confidence, the project presented a series of challenges that required us to adapt, learn,
and innovate. Through practical experimentation with IR sensors, motor control using an
Arduino shield, and coding, we were able to create a functional robot capable of
autonomously following a line.

The robot executes four primary actions based on sensor input: moving forward when the
middle sensor detects black while the side sensors detect white; turning left when the left
sensor detects black; turning right when the right sensor detects black; and stopping when
all three sensors detect black simultaneously. The motors are programmed to rotate in
opposite directions to facilitate these movements, allowing the robot to navigate
effectively along the designated black line. This systematic approach enables line follower
robots to follow paths accurately and respond dynamically to changes in their
environment.

This project highlighted the importance of integrating various components, sensors,


actuators, and controllers, into a cohesive system. The iterative process of testing and
refining our design not only enhanced our technical skills but also fostered teamwork and
problem-solving abilities. We learned to troubleshoot issues in real-time, adjust our
strategies based on sensor feedback, and optimize motor performance for effective
navigation. As we successfully completed the robot by the deadline, we gained
confidence in our capabilities and a greater appreciation for the complexities involved in
robotic systems.

11
References
• Instructables. (n.d.). Arduino - Line Follower Robot: 8 Steps (with Pictures). Retrieved
from https://www.instructables.com/Arduino-Line-Follower-Robot-1/

• Technuttiez. (2019, April 3). How to make line follower robot using Arduino. Hackster.io.
Retrieved from https://www.hackster.io/technuttiez/how-to-make-line-follower-robot-
using-arduino-c886de

• Instructables. (n.d.). Line Follower Robot Arduino and L293D Shield: 4 Steps. Retrieved
from https://www.instructables.com/Line-Follower-Robot-Arduino-and-L293D-Shield/

• Reasad. (n.d.). Line-Follower-Robot. GitHub. Retrieved


from https://github.com/reasad/Line-Follower-Robot

• Whadda. (2021, April 2). Make a one sensor line follower with the Arduino STEM shield.
Retrieved from https://whadda.com/make-a-one-sensor-line-follower-with-the-arduino-
stem-shield/

• YouTube. (2020, March 22). How to make a Line Follower Robot Car Using Arduino
L293d and IR. Retrieved from https://www.youtube.com/watch?v=Jmbxb0Yq6Cg

12
Annexes

• During the assembly process we decided that it would be a good idea to implement an
ultrasonic sensor together with a servo motor to make our robot more efficient, and
although due to some setbacks it was not possible to implement it for the final delivery,
we are still working on it for the next competition.
• Throughout all the process we had to make different changes to our first design due to
different things that came up, but even so we were able to end the project with a good
robot that was able to follow the proposed line.

• Determining the circuit that the robot would follow was a relevant part not previously
considered, since the sensors and speed had to be calibrated in accordance with the
circuit requirements and its layout in general, such as sharp curves, long straights,
obstacles, etc...

13

You might also like