Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Create an Autonomous Line-Following Robot with Arduino UNO

Components and supplies

Create an Autonomous Line-Following Robot with Arduino UNO
Arduino UNO
×1
BO motor
×1
wheels
×1
ir sensor
×1
Create an Autonomous Line-Following Robot with Arduino UNO
Texas Instruments Dual H-Bridge motor drivers L293D
×1
Create an Autonomous Line-Following Robot with Arduino UNO
Custom PCB
×1
Create an Autonomous Line-Following Robot with Arduino UNO
9V battery (generic)
×1

Apps and online services

Create an Autonomous Line-Following Robot with Arduino UNO
Arduino IDE

About this project

Let's make a fully autonomous robot using Arduino and IR sensors. It can follow a black line on white surface. Watch video for more!

Components used:

  • Piece of cardboard/ Acrylic sheet
  • Arduino Uno
  • IR sensor
  • BO motor
  • Wheels
  • Caster wheel
  • L293d IC
  • PCB
  • Flexible wire
  • Battery
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO

Fix all components on acrylic sheet and make a chassis as shown in pictures.

Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO

Now make all connection As per the circuit Diagram bellow.

Create an Autonomous Line-Following Robot with Arduino UNO

you can make this circuit on dotted pcb like this.

Create an Autonomous Line-Following Robot with Arduino UNO

or can use this type of professional looking PCB.

Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO
Create an Autonomous Line-Following Robot with Arduino UNO

you can order PCB for this Shield from here https://www.pcbway.com/project/shareproject/How_to_Make_Arduino_Based_Edge_Avoiding_Robot.html

or for ready made shield contact us on: https://www.facebook.com/STROniXTechnologies

Now it's time to program this robot. upload this program to arduino and all done.

//program by Shubham Shinganapure on 05-08-2019
//
//for Line Following Robot using 2IR sensors
int lm1=8; //left motor output 1
int lm2=9; //left motor output 2
int rm1=10; //right motor output 1
int rm2=11; //right motor output 2
int sl=13; //sensor 1 input (left)
int sr=12; //sensor 2 input (right)
int SlV=0;
int SrV=0;
int led=A0;
void setup()
{
pinMode(lm1,OUTPUT);
pinMode(lm2,OUTPUT);
pinMode(rm1,OUTPUT);
pinMode(rm2,OUTPUT);
pinMode(led,OUTPUT);
pinMode(sl,INPUT);
pinMode(sr,INPUT);
sTOP();
}
void loop()
{
SlV=digitalRead(sl);
SrV=digitalRead(sr);
if(SrV==LOW && SlV== LOW)
{
ForWard();
}
if(SrV==HIGH && SlV== LOW)
{
Left();
}
if(SrV==LOW && SlV== HIGH)
{
Right();
}
if(SrV==HIGH && SlV== HIGH)
{
sTOP();
}
}
void ForWard()
{
digitalWrite(lm1,HIGH);
digitalWrite(lm2,LOW);
digitalWrite(rm1,HIGH);
digitalWrite(rm2,LOW);
}
void BackWard()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,HIGH);
digitalWrite(rm1,LOW);
digitalWrite(rm2,HIGH);
}
void Left()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,HIGH);
digitalWrite(rm1,HIGH);
digitalWrite(rm2,LOW);
}
void Right()
{
digitalWrite(lm1,HIGH);
digitalWrite(lm2,LOW);
digitalWrite(rm1,LOW);
digitalWrite(rm2,HIGH);
}
void sTOP()
{
digitalWrite(lm1,LOW);
digitalWrite(lm2,LOW);
digitalWrite(rm1,LOW);
digitalWrite(rm2,LOW);
}

For more subscribe my youtube channel:



Code

  • line follower robot
line follower robotArduino
//program by Shubham Shinganapure on 05-08-2019
//
//for Line Following Robot using 2IR sensors  
int lm1=8; //left motor output 1
int lm2=9; //left motor output 2
int rm1=10;  //right motor output 1
int rm2=11;  //right motor output 2
int sl=13;    //sensor 1 input (left)
int sr=12;    //sensor 2 input (right)
int SlV=0;
int SrV=0;
int led=A0;
void setup()
{
 pinMode(lm1,OUTPUT);
 pinMode(lm2,OUTPUT);
 pinMode(rm1,OUTPUT);
 pinMode(rm2,OUTPUT);
 pinMode(led,OUTPUT);
 pinMode(sl,INPUT);
 pinMode(sr,INPUT);
sTOP();
}
void loop()
{
 SlV=digitalRead(sl);
 SrV=digitalRead(sr);
 if(SrV==LOW && SlV== LOW)
 {
  ForWard();
   }
 if(SrV==HIGH && SlV== LOW)
 {
  Left();
   }
 if(SrV==LOW && SlV== HIGH)
 { 
 Right();
  }
    if(SrV==HIGH && SlV== HIGH)
 {
  sTOP();
   }
}
void ForWard()
 {
  digitalWrite(lm1,HIGH);
  digitalWrite(lm2,LOW);
  digitalWrite(rm1,HIGH);
  digitalWrite(rm2,LOW);
 } 
 void BackWard()
 {
  digitalWrite(lm1,LOW);
  digitalWrite(lm2,HIGH);
  digitalWrite(rm1,LOW);
  digitalWrite(rm2,HIGH);
 }
 void Left()
 {
  digitalWrite(lm1,LOW);
  digitalWrite(lm2,HIGH);
  digitalWrite(rm1,HIGH);
  digitalWrite(rm2,LOW);
 } 
 void Right()
 {
  digitalWrite(lm1,HIGH);
  digitalWrite(lm2,LOW);
  digitalWrite(rm1,LOW);
  digitalWrite(rm2,HIGH);
 }  
   void sTOP()
 {
  digitalWrite(lm1,LOW);
  digitalWrite(lm2,LOW);
  digitalWrite(rm1,LOW);
  digitalWrite(rm2,LOW);
 } 

Schematics

Create an Autonomous Line-Following Robot with Arduino UNO

Manufacturing process

  1. Simple Pi Robot – Build a 2‑WD Autonomous Rover with Raspberry Pi
  2. Servo‑Driven Obstacle‑Avoiding Robot: Build with Arduino & HC‑SR04
  3. V4 Speed Line‑Follower Robot – Advanced Arduino Nano System
  4. Build an Autonomous Home Assistant Robot: Full Parts List & Setup Guide
  5. PID-Controlled Line-Following Robot Kit – Arduino UNO, IR Sensors, Durable Chassis
  6. Smart Indoor Navigation Robot Kit for Arduino Projects
  7. Build a Line-Following Robot with PID Control and Android Integration
  8. Build the Simplest Arduino Line‑Following Robot with SparkFun L298
  9. Build a Gesture‑Controlled Robot at Home with Arduino and MPU‑6050
  10. Remote Control of a 6‑DOF Arduino Robot Arm via Web Interface