Project tutorial
Line Follower Robot

Line Follower Robot

A simple Line Follower Robot developed using Arduino platform.

  • 8 views
  • 0 comments
  • 2 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
09670 01
SparkFun Dual H-Bridge motor drivers L298
×1
Ir proximity sensor obl 600  49512.1448321030.500.659
Digilent IR Proximity Sensor
×2
Battery - 18650 - 7800mAh- 3.7V
×1
56t2029 40
Battery Holder, 18650 x 2
×1
Tens70
9V battery (generic)
×1
Adafruit industries ada80 image 75px
9V to Barrel Jack Connector
×1
BO Motor - Straight - 300rpm
×1
11026 02
Jumper wires (generic)
×1
Ball Caster Wheel
×1
Chasis - Eg. Plastic Box Cover, Acrylic Sheet, Metal Sheet
×1
4314603
Toggle Switch, (Off)-On
×1

Necessary tools and machines

Apps and online services

About this project

  • Step 1: Assemble the circuit as shown in the schematic given below. You can use the battery pack for powering driver circuit which I have mentioned in the components section or you could try out some other battery pack, but keep it mind it should deliver between 7-12V and at least 3500mAh. Also, use different battery/battery-packs for powering Arduino and the Motor-Driver module, but ensure they share a common ground. Battery is one of the most important thing in this project !
  • Step 2: Compile the code given below in the Arduino-IDE and hit upload.
  • Step 3: Make the route for the line follower using black electrical-tape. Make sure that you have not inserted sharp turns on the route or else the line follower may malfunction ! Also make sure you use a white-background against the black-route. The lighter the background the more effective is the robot in following up the line.
  • Step 4: Now you have gone through all the hard work ! Turn on the toggle switch and watch the robot following the route/line. If the robot fails to do it's work then try adjusting the POT available on IR-module to different values. The sensitivity of IR module depends on background as well as lightning conditions, so also make sure the area in which you're using the robot is well lit.

Code

Line Follower RobotC/C++
Download/Copy-Paste and compile+upload it using Arduino IDE
const int r1=13,r2=12,l1=11,l2=10; // Motor Pins
const int LS = 8; // Left Sensor At Pin-8
const int RS = 9; // Right Sensor At Pin-9
int L,R; // Variables To Store Sensor I/Ps

void setup()
{
  pinMode(LS, INPUT); // Set Left Sesnor Pin As I/P
  pinMode(RS, INPUT); // Set Right Sesnor Pin As I/P 
  pinMode(r1, OUTPUT); // Set Motor Pins As O/P
  pinMode(r2, OUTPUT);
  pinMode(l1, OUTPUT);
  pinMode(l2, OUTPUT);
  digitalWrite(r2,LOW); // Disable Right Motor From Going Backward
  digitalWrite(l2,LOW); // Disable Left Motor Fromm Going Backward
}

void loop()
{
  L = digitalRead(LS); // Capture Left Sensor I/P
  R = digitalRead(RS); // Capture Right Sensor I/P
  digitalWrite(r1, !R); // Move Forward/Stop Right Motor
  digitalWrite(l1, !L); // More Forward/Stop Left Motor
}

Schematics

Line Follower Robot
Connect them and get going !
Capture ipzo9qi2yb

Comments

Similar projects you might like

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 11,295 views
  • 1 comment
  • 59 respects

Line Follower Robot

Project tutorial by Shubham Shinganapure

  • 9,696 views
  • 3 comments
  • 22 respects

Easiest Line Follower Robot

Project tutorial by Zubayer Al Billal Khan

  • 35,541 views
  • 14 comments
  • 53 respects

Elliot the Line Follower Robot

Project showcase by SMM2

  • 12,955 views
  • 5 comments
  • 28 respects

Simple Line Follower Robot

Project tutorial by Harsh Dethe

  • 5,229 views
  • 0 comments
  • 10 respects

WiFi Robot

Project tutorial by Kartik

  • 4,868 views
  • 1 comment
  • 12 respects
Add projectSign up / Login