Line Following Robot V.1
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
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
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
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
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
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
Now I am giving you the Github link of the code below:
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
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. :) :)