0% found this document useful (0 votes)
6 views

arduino awdhesh

The document outlines a project for creating a Line Following Robot using Arduino as part of the Teacher Assessment Examination for the academic session 2024-25. It details the components, working principles, implementation steps, and troubleshooting tips for the robot, which autonomously follows a line using IR sensors. The project serves as a practical demonstration of embedded systems, robotics, and automation.

Uploaded by

dharinikarande04
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

arduino awdhesh

The document outlines a project for creating a Line Following Robot using Arduino as part of the Teacher Assessment Examination for the academic session 2024-25. It details the components, working principles, implementation steps, and troubleshooting tips for the robot, which autonomously follows a line using IR sensors. The project serves as a practical demonstration of embedded systems, robotics, and automation.

Uploaded by

dharinikarande04
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Academic Session 2024-25 (ODD)

Teacher Assessment Examination (TAE-II): Creative Assignment Course:

Electronics Workshop-I (N-VSCET101P)

Name of Students: Awdhesh Chorghade Roll No.: (ET24005)


Semester/Section: 1st sem/1st year Date of Submission:10/12/24
ProblemStatement Line Follower Robot Using Arduino Evalu
ation

Description: Arduino is an open source microcontroller platform designed for creating


interactive and programmable projects. Its known for its simplicity and
versatility
,making it a popular choice for beginners and experienced makers.

Components: Actuators: Servo motor


Power Management: 7805 IC, regulates the voltage to stable
5VPower Source: Battery of 12V(lithium ion battery )

Working Principle: A Line Following Robot is an autonomous robot that follows a specific path,
usually a black line on a white surface or vice versa.
1. Line Detection:
o The IR sensors detect the difference in color (black or white)
on the surface.
o A black line absorbs IR light, while a white surface reflects
it.
o The IR sensor module has an IR LED and a photodiode.
When the photodiode detects the reflected light, it generates
a signal (HIGH or LOW) that tells the Arduino about the
presence of the line.
2. Decision Making:
o If both sensors detect white: Move FORWARD.
o If the left sensor detects black: Turn LEFT.
o If the right sensor detects black: Turn RIGHT.
o If both sensors detect black: This may indicate a junction
or stop signal, depending on the design.
3. Motion Control:
o The Arduino reads the sensor
o inputs and controls the motor
driver (L298N or L293D) accordingly.
o The motor driver allows the Arduino to provide enough
current and voltage to drive the DC motors.

Implementation:
Step 1: Gather Required Components

Step 2: Assemble the Robot Body


1. Chassis Setup:
o Attach the DC motors to the chassis.
o Connect the wheels to the DC motors.
o Attach the caster wheel (freely rotating support wheel) at the
back.
2. Component Placement:
o Mount the Arduino board on the chassis.
o Fix the IR sensor module at the front of the chassis.
o Attach the motor driver (L298N or L293D) to the chassis.

Step 3: Connect the Electronics


1. Connect IR Sensors:
o Place the two IR sensors on the front of the robot.
o Position them close to the ground to detect the black line
properly.
2. Connect Motor Driver:
o Connect the two DC motors to the
OUT1, OUT2, OUT3, and OUT4
pins of the L298N motor driver.
o Connect the INPUT pins of the motor driver to the
corresponding digital pins on the Arduino (e.g., D9, D10, D11,
D12).
3. Connect Power Supply:
o Connect a 9V or 12V battery to power the motor driver.
o Connect the 5V and GND of the Arduino to the motor
driver.
4. Sensor Connections:
o Connect the output pins of the IR sensors to the input pins
of the Arduino (e.g., D2 and D3).
o Power the IR sensors using the 5V and GND pins of the
Arduino.

Step 4: Write the Code Step 5: Upload the


Code
1. Open Arduino IDE on your computer.
2. Connect the Arduino board to your computer via a USB cable.
3. Copy and paste the code into the IDE.
4. Select the correct Board (Arduino UNO) and
Port.
5. Click Upload to transfer the code to the Arduino board.

Step 6: Power Up the Robot


1. Disconnect the USB cable and connect the external battery.
2. Turn on the robot using the power switch.
3. Place the robot on a surface with a clear
black line on a white background.

Step 7: Test the Robot


1. Line Detection:
o Place the robot on the track.
o Ensure the IR sensors are correctly positioned and can detect
the line.
2. Motor Movement:
o Observe if the robot moves forward, left, or right according to
the line's position.
o If the robot does not follow the line, check the sensor positions
and motor wiring.

Step 8: Troubleshooting
1. Robot not moving:
o Check if the motor driver is getting power.
o Check if the motors are connected properly.
2. Robot not detecting the line:
o Adjust the height of the IR sensors.
o Make sure the line is properly visible (use thick black tape on a
white background).
3. Robot not turning properly:
o Check the sensor alignment.
o Verify the motor wiring.
4. Random movement:
o There may be noise in the IR sensor signals.
o Use resistors to stabilize the input or add a capacitor.
Flowchart
Code: #define IR_SENSOR_RIGHT 11
#define IR_SENSOR_LEFT 12
#define MOTOR_SPEED 180

//Right motor
int enableRightMotor=6; int rightMotorPin1=7;
int rightMotorPin2=8;

//Left motor
int enableLeftMotor=5; int leftMotorPin1=9; int
leftMotorPin2=10;

void setup()
{
TCCR0B = TCCR0B & B11111000 | B00000010
;

// put your setup code here, to run once: pinMode(enableRightMotor,


OUTPUT); pinMode(rightMotorPin1, OUTPUT);
pinMode(rightMotorPin2, OUTPUT);

pinMode(enableLeftMotor, OUTPUT); pinMode(leftMotorPin1,


OUTPUT); pinMode(leftMotorPin2, OUTPUT);

pinMode(IR_SENSOR_RIGHT, INPUT); pinMode(IR_SENSOR_LEFT,


INPUT);
rotateMotor(0,0);
}

void loop()
{

int rightIRSensorValue = digitalRead(IR_SENSOR_RIGHT);


int leftIRSensorValue =
//If none of the sensors detects black line, then go straight
if (rightIRSensorValue == LOW && leftIRSensorValue == LOW)
{
rotateMotor(MOTOR_SPEED, MOTOR_SPEED);
}
//If right sensor detects black line, then turn right
else if (rightIRSensorValue == HIGH && leftIRSensorValue == LOW )
{
rotateMotor(-MOTOR_SPEED, MOTOR_SPEED);
}
//If left sensor detects black line, then turn left else if
(rightIRSensorValue == LOW && leftIRSensorValue == HIGH )
{
rotateMotor(MOTOR_SPEED, - MOTOR_SPEED);
}
//If both the sensors detect black line, then stop else
{
rotateMotor(0, 0);
}
}

void rotateMotor(int rightMotorSpeed, int leftMotorSpeed)


{

if (rightMotorSpeed < 0)
{
digitalWrite(rightMotorPin1,LOW); digitalWrite(rightMotorPin2,HIGH);
}
else if (rightMotorSpeed > 0)
{
digitalWrite(rightMotorPin1,HIGH); digitalWrite(rightMotorPin2,LOW);
}
else
{
digitalWrite(rightMotorPin1,LOW); digitalWrite(rightMotorPin2,LOW);
}

if (leftMotorSpeed < 0)
{
digitalWrite(leftMotorPin1,LOW); digitalWrite(leftMotorPin2,HIGH);
}
else if (leftMotorSpeed > 0)
{
digitalWrite(leftMotorPin1,HIGH); digitalWrite(leftMotorPin2,LOW);
}
else
{
digitalWrite(leftMotorPin1,LOW); digitalWrite(leftMotorPin2,LOW);
}
analogWrite(enableRightMotor, abs(rightMotorSpeed));
analogWrite(enableLeftMotor, abs(leftMotorSpeed));
}
Stimulation:

Development of
System
Conclusion: The development of a Line Following Robot using Arduino is a practical
demonstration of embedded systems, robotics, and automation. This project
introduces key concepts such as sensor integration,
motor control, and decision-making algorithms.

Remarks:
Faculty in charge

You might also like