LINE FOLLOWER

Line Follower Robot with Arduino

Line Follower is one that Follows a black line or the color it is programmed to.

I have instructed to make a line follower that followes black line.

Materials required

  1. Chassis
  2. Motors 150 RPM x 2
  3. Wheels x 2
  4. Castor Wheel x 1
  5. Arduino UNO R3
  6. Motor Driver IC L298N
  7. IR sensor x 2
  8. Female to Female Jumper x 10
  9. Mini Breadboard
  10. 9 volts Battery and strapper
  11. DC jack
  12. Wires

Circuit diagram

Coding:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void setup() {
pinMode(6,INPUT);
pinMode(7,INPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
 
}
 
void loop() {
int a,b;
a=digitalRead(9);
b=digitalRead(10);
 
if(a==1&&b==1)
{
 digitalWrite(8,HIGH);
 digitalWrite(9,LOW);
 digitalWrite(10,HIGH);
 digitalWrite(11,LOW);
}
 
else if(a==1&&b==0)
{
  digitalWrite(8,HIGH);
  digitalWrite(9,LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
}
else if(a==0&&b==1)
{
 
 digitalWrite(8,LOW);
 digitalWrite(9,LOW);
 digitalWrite(10,HIGH);
 digitalWrite(11,LOW);
}
else
{  
  digitalWrite(8,LOW); 
  digitalWrite(9,LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
 }
                            THANKYOU

 

SHARE THIS!!!

Gowtham S

Gowtham is a programming enthusiast. His field of interest includes Arduino, NodeMCU, Raspberry Pi, and Python. To know more about him visit https://mybtechprojects.tech/about-us/.

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.