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 a 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.

Line follower robots were one of the earliest automatic guided robots. They can follow a line marked on a contrasting background, usually a black line on a white surface or a white line on a black surface. Usually, the line follower robot works on a closed-loop feedback algorithm where the feedback from the line sensor is used by the controller for correcting the path of the robot. The sensors are usually LED/LDR, LED/Photodiode, or LED/Phototransistor pairs, and the controller is an electronic circuit that executes the desired feedback algorithm. Gear motors are used for driving the robotic wheels.

Line Follower Robot Circuit Principle

This circuit mainly consists of an 8051 microcontroller, two IR sensors, motors, and motor driver IC (embedded in a module). The line follower robot needs a mechanical arrangement of the chassis. I have used a 4WD Acrylic chassis. The two IR sensors are mounted on the front of the robot facing the diodes facing towards Earth.

When the robot is placed on the fixed path, it follows the path by detecting the line. The robot's direction of motion depends on the two sensors' outputs. When the two sensors are on the line of the path, the robot moves forward. If the left sensor moves away from the line, the robot moves towards the right. Similarly, if the right sensor moves away from the path, the robot moves towards its left. Whenever the robot moves away from its path it is detected by the IR sensor.

IR sensor consists of an IR transmitter and IR receiver on aboard. 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 the IR sensor microcontroller indicates the motors to change their direction.



block diagram:

we can divide the whole circuit into blocks which are shown below


IR sensor:

IR sensor is an electronic device, that emits light to sense some object in the surroundings. An IR sensor can measure the heat of an object as well as detects the motion. Usually, in the infrared spectrum, all the objects radiate some form of thermal radiation. These types of radiations are invisible to our eyes, but infrared sensors can detect these radiations.

The emitter is simply an IR LED (Light Emitting Diode) and the detector is simply an IR photodiode. The photodiode is sensitive to IR light of the same wavelength which is emitted by the IR LED. When IR light falls on the photodiode, the resistances and the output voltages will change in proportion to the magnitude of the IR light received.

There are five basic elements used in a typical infrared detection system: an infrared source, a transmission medium, an optical component, infrared detectors or receivers, and signal processing. Infrared lasers and Infrared LEDs of specific wavelength used as infrared sources.

The three main types of media used for infrared transmission are vacuum, atmosphere, and optical fibers. Optical components are used to focus the infrared radiation or to limit the spectral response.


8051 microcontroller:

8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of ROM storage, and 128 bytes of RAM storage, 2 16-bit timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable as per the requirement.

motor driver chip:

The L293D is a popular 16-Pin Motor Driver IC. As the name suggests it is mainly used to drive motors. A single L293D IC is capable of running two DC motors at the same time; also the direction of these two motors can be controlled independently. So if you have motors that have an operating voltage less than 36V and operating current less than 600mA, which are to be controlled by digital circuits like Op-Amp, 555 timers, digital gates, or even Micron rollers like Arduino, PIC, ARM, etc...

circuit diagram :




components required :

  • 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

working:


Line follower robot senses white line by using sensor and then sends signals to the microcontroller. Then microcontroller drives the motor according to sensors' output.

Here in this project, we are using two IR sensors pair. Suppose we are calling left sensor and right sensor of IR sensor Pair, then both left and right sensors sense nothing or black line then robot move forward.

Line Follower Forward Move

And when a left sensor senses a white line then the robot turn left side.

Line Follower Left Turn

and when the left sensor senses the white line then the robot turns to the right side until both sensors come at the black line or sense nothing surface.

Line Follower Right Turn

And when both sensors come on the white line, the robot stop.

Line Follower Robot Stop




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();
}
}
}












Post a Comment

Previous Post Next Post