|
arduino IDEArduino
|
"A perfectly working line follower robot using arduino"
LINE FOLLOWER ROBOT - THE EASIEST!
This is a simple tutorial to make a line follower robot using Arduino. I am using the same robot platform of my previous tutorial ?"Make your first Arduino robot"In this tutorial, You can follow the tutorial to make the platform of this robot.
Parts needed
Arduino
Materials-
IR sensors - Buy here (Amzon.in, Amazon.com)
Arduino uno - Buy here
L293D motor shield - Buy here
2 x Gear motor - Buy here
2 x Wheel - Buy here
Caster wheel - Buy here
3 x 9 volt battery
3 x battery clip - Buy here
DC male jack - Buy here
8 x Female to female jumper wire - Buy here
Plastic box (size - 14 cm x 10 cm)
Tools
Screw driver
Soldering iron
Hot glue gun
Driller
Step 1: Making changes from the previous robot
Connecting the IR sensors
If you are a beginner visit my previous tutorial for complete information and follow steps 1 to 4.
After making the chassis. Connect the IR sensors as shown in the image. The position of IR LEDs and receivers is 0.5 cm from the ground.
Step 2: Circuit diagram and sensor connection
Wiring Instructions
Connect the left sensor 'out' to the digital 'pin 8' of Arduino
Connect the right sensor 'out' to the digital 'pin 9' of Arduino
Connect the 'VCC' of both sensors to '5 volts' of Arduino
Connect the 'gnd' of both sensors to 'gnd' of Arduino
Connect two header mail pins to pins 8 and 9 of motor shield.
Take out the wires through the hole.
Connect the wires to the sensors.
Everything is completed.
Step 3: Code for the Arduino
Install the 'AFmotor' library before compiling the program (Copy paste the AFmotor folder to to arduino libraries folder) Click here to download it.
/*
Author: Muhammed Azhar
visit - robotechmaker.com
*/
#include "AFMotor.h";
int IRleft = 8; // the input of IR sensor right
int IRright = 9; // the input of IR sensor left
//Objects
AF_DCMotor motorRight(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm
AF_DCMotor motorLeft(3, MOTOR12_64KHZ); // create motor #3, 64KHz pwm
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
pinMode(IRright, INPUT); // sets the digital pin 9 as input
pinMode(IRleft, INPUT); // sets the digital pin 8 as input
//Initalization messages
Serial.println("ARDUINO LINE FOLLOWER");
Serial.println(" Reday for working!");
//turn off motors
motorRight.setSpeed(0);
motorLeft.setSpeed(0);
motorRight.run(RELEASE);
motorLeft.run(RELEASE);
}
void loop() {
//for wall follower robot.
motorRight.setSpeed(255); //set the speed of the motors, between 0-255
motorLeft.setSpeed (255);
if (digitalRead(IRright) == LOW)
{
Serial.println ("right Line is ditected!" );
motorRight.setSpeed(255);
motorLeft.setSpeed(80);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
delay(500); // wait for a second
}
if (digitalRead(IRleft) == LOW)
{
Serial.println ("left Line is ditected!" );
motorRight.setSpeed(80);
motorLeft.setSpeed(255);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
delay(500); // wait for a second
}
else {
{
Serial.println ("Placed in ground. No line ditected. Going forward");
delay (15);
motorRight.setSpeed(255);
motorLeft.setSpeed(255);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
}
}}
"If you have any doubts or any suggestions please comment below"
/*
Author: Muhammed Azhar
visit - robotechmaker.com
*/
#include "AFMotor.h";
int IRleft = 8; // the input of IR sensor right
int IRright = 9; // the input of IR sensor left
//Objects
AF_DCMotor motorRight(1, MOTOR12_64KHZ); // create motor #1, 64KHz pwm
AF_DCMotor motorLeft(3, MOTOR12_64KHZ); // create motor #3, 64KHz pwm
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
pinMode(IRright, INPUT); // sets the digital pin 9 as input
pinMode(IRleft, INPUT); // sets the digital pin 8 as input
//Initalization messages
Serial.println("ARDUINO LINE FOLLOWER");
Serial.println(" Reday for working!");
//turn off motors
motorRight.setSpeed(0);
motorLeft.setSpeed(0);
motorRight.run(RELEASE);
motorLeft.run(RELEASE);
}
void loop() {
//for wall follower robot.
motorRight.setSpeed(255); //set the speed of the motors, between 0-255
motorLeft.setSpeed (255);
if (digitalRead(IRright) == LOW)
{
Serial.println ("right Line is ditected!" );
motorRight.setSpeed(255);
motorLeft.setSpeed(80);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
delay(500); // wait for a second
}
if (digitalRead(IRleft) == LOW)
{
Serial.println ("left Line is ditected!" );
motorRight.setSpeed(80);
motorLeft.setSpeed(255);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
delay(500); // wait for a second
}
else {
{
Serial.println ("Placed in ground. No line ditected. Going forward");
delay (15);
motorRight.setSpeed(255);
motorLeft.setSpeed(255);
motorRight.run(FORWARD);
motorLeft.run(FORWARD);
}
}}
"A perfectly working line follower robot using arduino"
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by mohdazhar
- Automatic Bus Stop Announcement System When we travel by bus ,the route of the bus is unknown to a new passenger. It mostly affects the ill...
- Earthquake Alert System Based On IOT Many countries have implemented EEW(early earthquake warning) systems to save human lives. The earth...
- Smart Street Light Smart Street Light spotlights different restrictions and difficulties identified with traditional an...
- Line Break Detector With Alert System Line Break Detector With Alert System is a mechanism which helps the consumer and KSEB officers to d...
- Smart Railway Gate Opening System Using IOT The railway crossing accidents are increasing day by day due to human-manned railway crossings. Live...
- Advanced Biometric Finger Print Scanner We took the case of our hostel mess and concluded that there is no proper way to manage the hostel m...
- Baby Monitoring System We are very well familiar with the hurdles faced by Parents to nurture their infant and especially i...
- TOKEN MACHINE AND QUEUE MANAGEMENT SYSTEM FOR HOSPITALS ABSTRACTPatient wait times have a strong influence on patient satisfaction levels. A common scenario...
- Make your own branded ESP32 development board with PCBWay! What about making your own custom PCB boards with your own branding? Doesn't that sound nice? PCB ma...
- FOODIE BOT Automation has become an integral part of today's modern life. We are increasingly noticing that mor...
- A ESP32 BASED BLUETOOTH MINI ROBOT A simple mini robot that you can control with your phone. The robot can be improvised and implemente...
- IOT smart AC plug A smart plug is a home automation device and is a hot new thing. Several types of smart plugs are av...
- "A perfectly working line follower robot using arduino" LINE FOLLOWER ROBOT - THE EASIEST!This is a simple tutorial to make a line follower robot using Ardu...
- IOT PLANT - GROW YOUR PLANTS FROM ANYWHERE AROUND THE WORLD. Watch the video The device and plant setupWhat about growing any plants from anywhere around the wor...
- HOW TO PROGRAM ESP8266 - 01 In this tutorial, I am going to show how to program ESP8266 - 01 using an Arduino board or using FTD...
- Make Your First Arduino Robot - the Best Tutorial Out There Smartphone-controlled obstacle avoiding and wall follower robot.Are you a beginner in Arduino and ha...
- THE ULTIMATE OFFROAD RC ROVER Let's make an all-terrain remote-controlled rover bot. This is a great starter project for hobbyists...
- MAKE A 3.3 VOLT REGULATOR FOR ESP8266 The 3.3-volt power supply is one of the main issues when we use ESP8266 - 01 as a standalone board. ...
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
162 1 1 -
-