Robotics Circuit Diagrams

Line Follower Robot using Microcontroller

Have you ever made your own robot? Here is a very simple and easy robot. In this project, I will explain how to design and build a Line Follower Robot using microcontroller. The Line Follower Robot is a basic robot that follows a specific path indicated by a line (usually a black line on a light colored surface) having some particular width.

Outline

  • Line Follower Robot Circuit Principle
  • Line Follower Robot Circuit Diagram
  • Components in the circuit
  • How to Design a Line Following Robot?
    • Design of IR Sensors
    • Working of IR Sensors
  • Line Following Robotic Vehicle Circuit Working
  • Code
  • Line Following Robot Circuit Applications
  • Limitations of Line Follower Robot

Line Follower Robot Circuit Principle

The primary components of this circuit are an 8051 microcontroller, two IR sensors, motors, and a motor driver IC (embedded in a module). The mechanical layout of the chassis is required for the line follower robot. A 4WD Acrylic chassis was used. The two infrared sensors are situated on the robot’s front, with the diodes towards Earth.

When a robot is placed on a fixed path, it detects the line and follows it. The outputs of the two sensors determine the robot’s mobility direction. The robot travels forward when the two sensors are on the same path. If the left sensor deviates from the line, the robot will move to the right. In the same way, if the right sensor moves away from the path, the robot goes to the left.

IR sensor consists of IR transmitter and IR receiver on a board. When the vehicle is moving on a black line, IR rays are continuously absorbed by the black surface and there is no reflected ray making output high. Whenever, the robot moves out to the white surface, it starts reflecting the IR rays and making the output low. Thus depending on the output of IR sensor microcontroller indicates the motors to change their direction.

Line Follower Robot Circuit Diagram

Line Follower Robot using Microcontroller

Components in the circuit

  • 8051 Microcontroller
  • Development Board for 8051 Microcontroller (preferred)
  • 10KΩ Resistors X 2
  • 10µF Capacitor
  • 11.0592MHz Crystal
  • 33pF Capacitors X 2
  • Push Button
  • Motor driver Module (L298N)
  • Robot Chassis with Motors
  • IR Sensors x 2

How to Design a Line Following Robot?

The circuit consists of 8051 microcontroller, IR Sensors (with IR transmitter and IR Receiver), L298N Motor Driver Module, Robot Chassis with 4 wheels and 4 motors, battery holder.

8051 microcontroller is the main component of the project. It is an 8 bit microcontroller with 32 programmable I/O pins. This has many peripheral features like programmable UART, two 8-bit timer/counter, two interrupts, external memory access etc.

A motor driver IC is used to connect the robot’s DC motors to the controller. The controller’s output is only 5V with a very low current, thus it can’t run the motors. As a result, a motor driver IC is employed to boost the voltage. The L298N can drive motors with a voltage of up to 36 volts and a current of up to 3 amps.

The 15-pin driver IC is commonly packaged in a multiwatt15 package. These ICs are readily available as Modules on the market. PORT2 pins P2.0, P2.1, P2.2, and P2.3 are used to link the Motor Driver Module’s inputs.

The two IR sensors are connected to P2.6 and P2.7 pins of the microcontroller. Arrange the chassis and connect the four wheels of the robotic vehicle to the motors which are in turn connected to the microcontroller.

Design of IR Sensors

IR sensor circuit consists of mainly IR transmitter and IR receiver. IR transmitter is similar to an LED. Its operating voltage is around 1.4V. So to protect it, a 150Ω resistor is placed in series with it and is connected in forward biased. IR receiver is connected in reverse bias and a 10KΩ resistor is placed between VCC and the receiver. Output is taken between resistor and IR receiver.

Since this is an analog output, we can convert it to a digital HIGH and LOW with the help of a simple comparator IC like LM358, for example. The IR Sensor Module used in this project uses the same configuration and the circuit diagram is shown below.

Working of IR Sensors

The IR rays are continually sent by the IR transmitter. These rays were absorbed by the surface when the IR transmitter was on a black surface, and they were reflected when it was on a white surface. When no IR rays are detected and voltage from VCC passes through the resistor, the IR receiver has the highest resistance. The voltage at the output pin is around 5V.

The resistance value falls as the intensity of IR photons received by the receiver increases, and reverse break down occurs. As a result, the voltage flowing through the resistor is grounded. As a result, it will produce 0V at the output pin.

Line Following Robotic Vehicle Circuit Working

  1. Initially draw the path on a light colored surface with black color tape.
  2. Place the robot on the floor.
  3. Now power on the circuit.
  4. Robot moves in the specified path.
  5. When it moves out of path, sensors check it and automatically adjust the robot.

Code

#include<reg51.h>
sbit mot1=P2^0;
sbit mot2=P2^1;
sbit mot3=P2^2;
sbit mot4=P2^3;
sbit s_left=P2^6;
sbit s_right=P2^7;
void forward (void);
void backward (void);
void left (void);
void right (void);
void forward (void)
{
mot1=0;
mot2=1;
mot3=1;
mot4=0;
}
void backward (void)
{
mot1=0;
mot2=1;
mot3=0;
mot4=1;
}
void left (void)
{
mot1=0;
mot2=1;
mot3=0;
mot4=0;
}
void right (void)
{
mot1=0;
mot2=0;
mot3=1;
mot4=0;
}
void stop (void)
{
mot1=0;
mot2=0;
mot3=0;
mot4=0;
}
void main()
{
s_left=1;
s_right=1;
while(1)
{
if(s_left==0 && s_right==0)
{
forward();
}
else if(s_left==1 && s_right==1)
{
stop();
}
else if(s_left==0 && s_right==1)
{
left();
}
else if(s_left==1 && s_right==0)
{
right();
}
}
}

Line Following Robot Circuit Applications

  • This can be used in driver less car system with some added features like obstacle detection.
  • This can also be used in industrial and defense applications.

Limitations of Line Follower Robot

  • Line follower robot requires 2-3 inches broad line.
  • It may not move properly if the black line drawn is of low intensity.
  • The IR sensors may sometimes absorb IR rays from surroundings also. As a result, robots may move in improper way.

Tags

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button
Close
Close