Project tutorial
HOW TO MAKE a Arduino LINE FOLLOWER ROBOT ( ADJUSTABLE SP...

HOW TO MAKE a Arduino LINE FOLLOWER ROBOT ( ADJUSTABLE SP... © CC BY

so in this tutorial i am going to show you how too buld a line follower robot with adjustable speed

  • 179 views
  • 0 comments
  • 3 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
09507 01
Soldering iron (generic)
02m7851 40
Extraction Tool, 6 Piece Screw Extractor & Screwdriver Set

Apps and online services

About this project

so in this tutorial i am going to show you how too buld a line follower robot with adjustable speed

Step 1:

A Line Follower Robot, as the name suggests, is an automated guided vehicle, which follow a black line Usually, the line is the path in which the line follower robot goes and it will be a black line on a white surface but the other way (white line on a black surface) is also possible.

Step 2: ​Componets Needed

1.arduino uno

2.l298 motor driver

3.7.4 volt li.ion battery

4.3*ir sensor modules

5.2*bo motors

6.wheels

Step 3: Circuit Daigram

Step 4: Working of Arduino Line Follower Robot

The working of the project is very simple bot will detect the black line on the surface and move along that line.

we need sensors to detect the line. For line detection logic, we used two IR Sensors, which consists of IR LED and Photo diode. They are placed in a reflective way i.e. side – by – side so that whenever they come in to white surface, the light emitted by IR LED will be detected by Photo diode . reflection of the white surface is high, the infrared light emitted by IR LED will be maximum reflected and will be detected by the Photo diode.

In case of black surface, which has a low reflection, the light gets completely absorbed by the black surface and doesn’t reach the photo diode.Using the same principle, we will setup the IR Sensors on the Line Follower Robot such that the two IR Sensors are on the either side of the black line on the floor.

Step 5: Code

code and circuit

Code

ec_lfr_with_variable_speed.inoArduino
code
 int S_A = 11;  //speed motor a
int M_A1 = 2; //motor a = +
int M_A2 = 3; //motor a = -
int M_B1 = 4; //motor b = -
int M_B2 = 5; //motor b = +
int S_B = 10;  //speed motor b

int R_S = A0; //sincer R
int S_S = A1; //sincer S
int L_S = A2; //sincer L

void setup() 
{
pinMode(M_B1, OUTPUT);
pinMode(M_B2, OUTPUT);
pinMode(M_A1, OUTPUT);
pinMode(M_A2, OUTPUT);
pinMode(S_B, OUTPUT);
pinMode(S_A, OUTPUT);

pinMode(L_S, INPUT);
pinMode(S_S, INPUT);
pinMode(R_S, INPUT);

}
void loop()
 

{
 int X = analogRead(A3);
analogWrite(S_A,X); 
analogWrite(S_B,X);
if ((digitalRead(L_S) == 0)&&(digitalRead(S_S) == 1)&&(digitalRead(R_S) == 0)){forword();}
if ((digitalRead(L_S) == 1)&&(digitalRead(S_S) == 1)&&(digitalRead(R_S) == 1)){forword();}
if ((digitalRead(L_S) == 0)&&(digitalRead(S_S) == 0)&&(digitalRead(R_S) == 0)){forword();}

if ((digitalRead(L_S) == 1)&&(digitalRead(S_S) == 1)&&(digitalRead(R_S) == 0)){turnLeft();}
if ((digitalRead(L_S) == 1)&&(digitalRead(S_S) ==0)&&(digitalRead(R_S) == 0)) {turnLeft();}

if ((digitalRead(L_S) == 0)&&(digitalRead(S_S) == 1)&&(digitalRead(R_S) == 1)){turnRight();}
if ((digitalRead(L_S) == 0)&&(digitalRead(S_S) == 0)&&(digitalRead(R_S) == 1)){turnRight();}


}

void forword(){
digitalWrite(M_A1, LOW);
digitalWrite(M_A2, HIGH);
digitalWrite(M_B1, HIGH);
digitalWrite(M_B2, LOW);  
}


void turnRight(){
digitalWrite(M_A1, HIGH);
digitalWrite(M_A2, LOW);
digitalWrite(M_B1, HIGH);
digitalWrite(M_B2, LOW);  
}

void turnLeft(){
digitalWrite(M_A1, LOW);
digitalWrite(M_A2, HIGH);
digitalWrite(M_B1, LOW);
digitalWrite(M_B2, HIGH);
}

void Stop(){
digitalWrite(M_A1, LOW);
digitalWrite(M_A2, LOW);
digitalWrite(M_B1, LOW);
digitalWrite(M_B2, LOW);
}

Custom parts and enclosures

bot wheels
3d printed bot wheels

Schematics

circuit
circuit
bot wheels
wheels of bot

Comments

Similar projects you might like

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 8,708 views
  • 0 comments
  • 53 respects

Simple Line Follower Robot with PCB Design

Project tutorial by Jithin Sanal

  • 722 views
  • 0 comments
  • 6 respects

Line Follower Robot - PID Control - Android Setup

Project tutorial by MJRoBot

  • 35,325 views
  • 10 comments
  • 46 respects

Scriba Robot - A Printing Robot

Project in progress by RobinB

  • 2,141 views
  • 0 comments
  • 7 respects

Easiest Line Follower Robot

Project tutorial by Zubayer Al Billal Khan

  • 31,017 views
  • 14 comments
  • 48 respects

PID Control Line Follower Robot

Project tutorial by Team KittenBot

  • 26,259 views
  • 5 comments
  • 36 respects
Add projectSign up / Login