Line Following Robot V.1

by Zuhayer in Circuits > Arduino

3215 Views, 24 Favorites, 0 Comments

Line Following Robot V.1

244248207_391820242661693_6105337666015168053_n.jpg
car1.jpg
244388842_222653556591457_9114847626517646313_n.jpg
244466427_1023111758448698_1206705027655031197_n.jpg
244408823_565527031342261_8198149177772294944_n.jpg

I am making a three proximity sensor line following robot. It is a robot which runs following a black line which proceeds the bot to the specific destination. Normally people makes a two proximity sensor robot. But that robot has normal functions but this one has a little bit advanced function. It can detect the 90 degree lines and 40 degree line that makes it advanced. I am mainly making this project to help the people who wanted to make a easy line following robot but a little bit advanced that is why three proximity sensors which will help to detect the 90 degree line and also 40 degree lines. Making with three proximity sensors is not so easy but coding is a little bit confusing if you are a beginner. I am also a beginner. This is V.1 Line Following Robot. I will also make other versions of it so stay tune. So that is all below is all the steps and requirements you will need for making this project.

Supplies

Arduino Uno.jpg
chasis.jpg
ir sensor.jpg
l298n.jpg
12 Volt Battery.jpg
Gear Motor.jpg
wheel.jpg
caster wheel.jpg
Jumper Wires.jpg

To make this three proximity sensors line following robot we need some components. They are listed below:

1)Three IR Sensors

2)Two Gear Motor

3)Arduino Uno/Nano

4)L298N Motor Driver

5)Two Wheel

6)12/9 Volt Battery

7)Jumper Wires

8)Caster Wheel

9)Chassis

All the above components are available in the Starter Kit. As there are number of projects listed onInstructables which can be made using Starter Kit.

Preparing the Chassis

F2BFMX1JN4VBNR3.jpg
FHUH33MJN4VBNNN.jpg
F7E1C0HJN4VBNR2.jpg
chasis.jpg

First attach the motors to the Chassis.

Then attach the wheels with the motors. After doing attach the caster wheel to the front of chassis. Now your chassis is ready.

But if you don't have any chassis then you can use any type of cardboard or plywood or PVC pipe sheet and then you can attach the motors and caster wheel to it.

The Upper Part of the Chassis

244399978_241049231373040_2730463896512819476_n.jpg
244412800_208232844708956_6672783682073811639_n.jpg
244408933_1325965877831121_3506374299324229521_n.jpg
244418902_231817355594047_7777896567246309277_n.jpg
244408823_565527031342261_8198149177772294944_n.jpg

First attach the proximity sensors to the front of the chassis facing downwards

  • Left sensor to the Left Corner of the Chassis.
  • center sensor to the Center of the Chassis.
  • Right sensor to the Right Corner of the Chassis.

If you are having problem look at the picture.

Attach the Arduino Uno to the Middle of the Chassis.

Attach the Motor Driver to a little back of the Arduino Uno.

Connections

LFR-circuit-v.1_bb.jpg
244248207_391820242661693_6105337666015168053_n.jpg
244413053_399375328311449_8852705301547500856_n.jpg
244418902_231817355594047_7777896567246309277_n.jpg

This is a important part of the project. Now I will describe the connections to you

Left sensor >> Arduino Uno

  • VCC >> 5V
  • GND >> GND
  • OUT >> 7

Center sensor >> Arduino Uno

  • VCC >> 5V
  • GND >> GND
  • OUT >> 8

Right sensor >> Arduino Uno

  • VCC >> 5V
  • GND >> GND
  • OUT >> 9

L298N >> Arduino Uno

  • EA >> 10
  • IN 1 >> 2
  • IN 2 >> 3
  • IN 3 >> 4
  • IN 4 >> 5
  • EB >> 11
  • 5Volt >> 5Volt
  • GND >> GND

Give 12Volt to L298N's 12Volt.

Here is the link to the circuit diagram:- CIRCUIT DIAGRAM

How It Works

Screenshot (144).png
Screenshot (145).png
Screenshot (146).png
Screenshot (147).png

Now I will show you how my Line Following Robot works. (//I am using Proximity sensors with Active High Output//)

To Go Straight:

  • When the Center sensor will detect black line.
  • The two other sensors will detect white surface.
  • The two Motors will go clockwise/right.

To Go Left:

  • When the Left sensor will detect black line.
  • The other two sensors will detect white surface.
  • The Left Motor will stop.
  • The Right Motor will go clockwise/right.

To Go right:

  • When the Right sensor will detect black line.
  • The other two sensors will detect white surface.
  • The Right Motor will stop.
  • The Left Motor will go clockwise/right.

To Go 90 Degree Left:

  • When the Center and Left sensors will detect black line.
  • The Right sensor will detect white surface.
  • The Right Motor will go clockwise/right.
  • The Left Motor will go counter clockwise/left.

To Go 90 Degree Right:

  • When the Center and Right sensors will detect black line.
  • The Left sensor will detect white surface.
  • The Left Motor will go clockwise/right.
  • The Right Motor will go counter clockwise/left.

To Go 40 Degree Left:

  • When the Center and Left sensors will detect black line.
  • The Right sensor will detect white surface.
  • The Right Motor will go clockwise/right.
  • The Left Motor will go counter clockwise/left.

To Go 40 Degree Right:

  • When the Center and Right sensors will detect black line.
  • The Left sensor will detect white surface.
  • The Left Motor will go clockwise/right.
  • The Right Motor will go counter clockwise/left.

To stop:

  • When all the sensor will detect black line.
  • The two Motors will go stop.


In this way this Line Following Robot will work. It has 90 Degree and 40 Degree turns and it can also detect 90 Degree and 40 Degree lines. This is full description of how this robot will work.

You will also have to tune the potentiometer of the sensors so that when they black line the output light in the sensor will turn off and when detect white surface it will turn on.

CODE

coding.jpg
Screenshot (157).png
Screenshot (148).png

Now I am giving you the Github link of the code below:

LFR V.1

Now you can paste this code in your Arduino IDE and upload it to the Arduino Uno of you robot. Or you can make your own code and make this Line Follower.

Conclusion

244413053_399375328311449_8852705301547500856_n.jpg
car 2.jpg

That it all for this project. If you have any problems or any kind of suggestions please let me know in the comment section. I will definitely check it and reply to your comment. And if you want a description of the code please let me know in the comment section. I will make a description for the code. :) :)