Make it mech
  • How & Why
    • Arduino
    • Leapmotion with arduino
    • Sensors/Modules
    • Basic Electronics
    • NodeMcu
    • LabView
    • MATLAB
    • Industrial Automation
  • Projects
    • arduino projects
    • Brain Wave Decoder
    • Circuit Diagrams
    • Electrical
    • IEE Projects
  • Ideas
  • Robotics
  • LeapMotion
  • EEG
  • Mechatronics
  • Videos
No Result
View All Result
Make it mech
No Result
View All Result

RECOMMENDED Articles

220v ac to 12v dc power supply

220v AC to 12v DC Power Supply Step by Step Project

2 years ago
Mechatronics Projects for Final Year students with Industrial Aspect

Mechatronics Projects for Final Year students with Industrial Aspect

2 years ago
Final results and future research of brain wave decoder EEG project

Final results and future research of brain wave decoder EEG project

3 years ago
Top-10 The Most Inspirational Books Ever

How to Think Out of the Box – Self Learning Experience

2 years ago

BROWSE BY CATEGORIES

  • Arduino
  • arduino projects
  • Basic Electronics
  • Brain Wave Decoder
  • Breadboard Circuits
  • Circuit Diagrams
  • Circuits
  • EEG
  • Electrical
  • How & Why
  • Ideas
  • IEE Projects
  • Industrial Automation
  • Inspiration & Motivation
  • IOT
  • LabView
  • Leapmotion with arduino
  • MATLAB
  • Mechatronics
  • NodeMcu
  • Projects
  • Robotics
  • Self Learning
  • Sensors/Modules
  • Soft skills
  • Startups
  • Success

Smart and fast arduino line following robot | Line follower using arduino

Smart and fast arduino line following robot | Line follower using arduino
503
SHARES
1.4k
VIEWS

Arduino line following robot is an easy arduino based robot project.Line follower using arduino is easy to code arduino project.This is the project guide about arduino line following robot. A line follower robot using arduino uno and ir sensor. The line follower robot program is an easy arduino code.We will discuss step by step that how we can make smart and fast arduino line following robot.

Arduino Line following Robot

Line Following Robot is the most common icon for building any robot.Line followers are the stepping stone towards robotics.The most basic, easy and very first part in robotics starts with line following.the most common Robot all the time.
Well Making line follower for the first time is not really easy as we thought.some of the things could be turned to make simple stuff into the complex.I mean some times sensor calibration, comparison, and other related things could be more difficult.For this we have to be smarter and more tricky.we have to choose those parts that can not create any sort of disturbance for us.I’m talking about those days when there were not much revolution in Robotics.we had to make robots using circuits with LDR’S IR’S and other messy and complex things.
Now we have been blessed with Arduino and bunch of good not just good but great sensors.so be smart and don’t waste your time in making complex circuits with separate sensors.There are a bunch of sensor modules available in the market with built in comparators.
so wisely choose what you are going to do and what you have to do.
We will see some of the very common and effective ways of making a line following robot.We will start from basics and in further tutorials we will follow some complex algorithms.we will see PID implemented robots and some advanced techniques in making smart robots.

Gather all the Stuff at one place


Required Components:

  1. Arduino board/Uno/nano/mega
  2. 3x IR sensor modules
  3. 2x Dc/servo motors
  4. Chassis
  5. Wheels
  6. Battery
  7. Caster wheel
  8. Jumper wires

These are the basic components you have to buy before making any further decision for arduino line following robot.now I will explain how to choose the right component and which one will be more suitable.

Related posts

pid controller basics

Fast & Furious Arduino Line Follower | PID Controller Basics

February 1, 2021
220v ac to 12v dc power supply

220v AC to 12v DC Power Supply Step by Step Project

February 1, 2021

Arduino board:


As Arduino is the main part so we have to be clear about which Arduino board we are going to use for arduino line following robot. The Arduino Uno is the best choice.we don’t need a lot of pins or very few pins that’s why we are not going for the nano and mega.
For Arduino guidance and Example, codes understanding go through these following posts.

Getting started with Arduino microcontroller


IR Sensor Modules:

IR sensor module is the best choice for making arduino line following robot.instead of using IR LEDs we have to buy IR modules.
The pin out Configuration for IR modules and Arduino is very simple. Below is the pinout for Line follower robot using arduino uno and ir sensor.

ir with arduino

 

If you are using 3 sensors connect 3 in the same manner.The IR module has 1-pin for input and other 2 are VCC and ground.
So join all VCC and ground separately at one place and then connect to the Arduino.and the input pins are placed randomly on the digital pins of Arduino.


DC/Servo motors


The selection of motors depends upon your choice.if you are going to but the LFR Kit then you got the servo motors within the package.
but my recommendation is to use DC geared motors.As I have used in this project we can handle more weight and current as compared to simple motors.so there are other several benefits of using these motors.
DC gear motors having high rpm and high
torque they are PMDC typed. The advantages of these motors are a constant magnetic field which
is uncontrolled by an external source.


Line follower KIT


There are lots of LFR kits are available in the market.buying a kit is the easiest solution for any mechanical workload or any sort of disturbance.


Chassis:


Chassis could be of any thing.I’m not going in the depth there are so many things already discussed over the internet.
The chassis could be of an acrylic sheet or use any home made things for robot base.


Wheels:


There are standard size wheels are available in the market.if you are using KIT then you don’t need to worry about these things.


Ball caster:


For making 2 wheel LFR you have to buy an extra wheel that is caster wheel the ball caster.For balancing the robot.


Battery:


The battery is the most important part of this project.we need a good and an efficient timing battery.the dry lithium-ion 12-volt rechargeable battery is the best choice.we can also go for other choices use simple rechargeable two 4-volts batteries in series.


Pin out Configuration and Assembling:


Assemble all the parts.place everything on your kit and now wire up.
Connect 3 IR modules with your Arduino board.the Vin pin of IR module will be connected on any of analog or digital pin of Arduino remember these pin configurations you have to use in the code.so if you are connecting to analog pins then you have to write analog in the code.


Motor Driver:


The motor driver we are using here is an L298N module. This is my recommendation to use this module instead of going for any shield or downloading libraries and other stuff this one is the simplest and easy.
For the working principle pin out configuration and why we are using this module you have to read this following post.

Motor Driver Dual H-Bridge L298


Code Construction:

There are three main steps in the construction of coding for arduino line following robot.
1-defining the pins according to the connecting / inputs and outputs
2-Logic for sensors / The switch case
3-functions for motor directions
The very first part Before coding is to calibrate the sensor.Set a threshold for a sensor.
For working principle of a line follower, you must have some knowledge about how we move motors according to the logic.

 Logic and Sensors placement:

We have to place all the sensor with equal distance lets says 1.5 in each.you middle sensor must be at the center of the line;
This is the basic principle for line following robot.Now we will move towards Arduino code.
lfr

Arduino Code:

For three sensors the logic will be :
010  Robot is on the line drive forward
100  turn medium Left
001  turn  medium Right
110  Sharp turn left
011 Sharp turn Right
000 stop

 

Complete Code:

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#define LS 2      // left sensor
#define MS 3      // middle sensor
#define RS 4      // right sensor
 
/*-------Outputs------*/
#define LM1 5       // left motor
#define LM2 6       // left motor
#define LM3 7       // left motor Enable pin for controlling speed
 
#define RM1 8       // right motor
#define RM2 9       // right motor
#define RM3 10       // right motor Enable pin for controlling speed
 
 
void setup()
{
  pinMode(LS, INPUT);
  pinMode(MS, INPUT);
  pinMode(RS, INPUT);
  pinMode(LM1, OUTPUT);
  pinMode(LM2, OUTPUT);
  pinMode(LM3, OUTPUT);
  pinMode(RM1, OUTPUT);
  pinMode(RM2, OUTPUT);
  pinMode(RM3, OUTPUT);
}
 
void loop()
{
  if(!(digitalRead(LS)) && digitalRead(MS) && !(digitalRead(RS)))    // Move Forward (010)
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,250);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,250);
  }
  
  if(!(digitalRead(LS)) && !(digitalRead(MS)) && digitalRead(RS))     // Turn medium right (001)
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,230);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,80);
  }
  
  if(digitalRead(LS) && !(digitalRead(MS)) && !(digitalRead(RS)))     // turn medium left (100)
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,80);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,230);
  }
  
  if(!(digitalRead(LS)) && !(digitalRead(MS)) && !(digitalRead(RS)))     // stop (000)
  {
    digitalWrite(LM1, LOW);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,0);
    digitalWrite(RM1, LOW);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,0);
 
  }
 
  if(digitalRead(LS) && (digitalRead(MS) && !(digitalRead(RS))))     // Turn Sharp left 90 degree (110)
  {
    digitalWrite(LM1, LOW);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,0);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,250);
  }
  if(digitalRead(RS) && (digitalRead(MS) && !(digitalRead(LS))) )    // Turn Sharp Right 90 degree (011)
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(LM3,250);
    digitalWrite(RM1, LOW);
    digitalWrite(RM2, LOW);
    digitalWrite(RM3,0);
  }
}

 

Upload the code and test it.Before testing check your connection and compare with your code.

I have skipped most of the mechanical parts in this guide about arduino line following robot. You have to take them on your own.these were some common and unnecessary steps.
I hope you got the concept.If you have any query comment below to notify.
Read the coming post about:

Advance line following Robot

and PID implemented line following Robot.Follow to get the latest updates.Subscribe to our YouTube channel for video Tutorials.

Mak

Mak

Mechatronics Engineer - Entrepreneur - Solution Architect Love writing & Traveling - Being Average isn't a Choice Stay Happy - Live in Freedom & Always have Faith on Yourself...

Related Posts



Comments 2

  1. saad shahid says:
    4 years ago

    good effort…!!!

    Reply
  2. Unknown says:
    3 years ago

    5 ir array sencer codes with pid

    Reply

Leave a Reply Cancel reply

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

Popular Posts

Most Popular

  • 220v ac to 12v dc power supply

    220v AC to 12v DC Power Supply Step by Step Project

    687 shares
    Share 275 Tweet 172
  • How to use L293d Module motor shield with Arduino

    650 shares
    Share 260 Tweet 163
  • Mechatronics Projects for Final Year students with Industrial Aspect

    620 shares
    Share 248 Tweet 155
  • Circuit designing steps for EEG portable monitoring device

    615 shares
    Share 246 Tweet 154
  • EEG circuit | Schematic diagrams of brain wave project

    601 shares
    Share 240 Tweet 150

Related Posts

pid controller basics
arduino projects

Fast & Furious Arduino Line Follower | PID Controller Basics

February 1, 2021
220v ac to 12v dc power supply
Basic Electronics

220v AC to 12v DC Power Supply Step by Step Project

February 1, 2021
Top 10 Arduino Based Projects For Final Year Students | Arduino project ideas
arduino projects

10-Cool Arduino projects of all time | Arduino based Projects List

January 30, 2021
Top 10 Robotic Competitions in the World | Tech Event Ideas
Ideas

Robotic Projects for Useful Applications | Final Year Robot Project ideas

January 30, 2021

Next Post
What is Leap Motion Controller and How does Leap Motion Works

What is Leap Motion Controller and How does Leap Motion Works

  • Home
  • Privacy Policy
  • About Us
  • Contact Us

© 2021 Make it mech - All Rights Reserved

No Result
View All Result
  • How & Why
    • Arduino
    • Leapmotion with arduino
    • Sensors/Modules
    • Basic Electronics
    • NodeMcu
    • LabView
    • MATLAB
    • Industrial Automation
  • Projects
    • arduino projects
    • Brain Wave Decoder
    • Circuit Diagrams
    • Electrical
    • IEE Projects
  • Ideas
  • Robotics
  • LeapMotion
  • EEG
  • Mechatronics
  • Videos

© 2021 Make it mech - All Rights Reserved

Go to mobile version