Introduction: - A line follower is an autonomous bot that can follow a specific colour line painted on a surface of different contrast, such as white on black.

Line-following robots with pick- and- placement capabilities are commonly used in manufacturing plants. These move on a specified path to pick the components from specified locations and place them on desired locations. Basically, a line-following robot is a self-operating robot that detects and follows a line drawn on the floor. The path to be taken is indicated by a white line on a black surface. The control system used must sense the line and manoeuvre the robot to stay on course while constantly correcting the wrong moves using feedback mechanism, thus forming a simple yet effective closed- loop system.



Fig. shows the block diagram of the automated line- following robot. It consists of mainly four parts: two sensors, two comparators, one decision making device and two motor drivers. The robot is built using microcontroller AT89S52 (used as the decision- making device), motor driver L293D, operational amplifier LM324 (comparator), phototransistor (sensor), and a few discrete components.

In the circuit, the sensors (phototransistors) are used to detect the white strip on a black background. The sensor output is fed to the microcontroller, which takes the decision and gives appropriate command to motor driver L293D so as to move the motor accordingly.

SENSOR the sensor senses the light reflected from the surface and feeds the output to the comparator. When the sensor is above the white background the falling on it from the source reflects to the sensor, and when the sensor is above the black background the light from the source doesn’t reflect to it. The sensor senses the reflected light to give an output, which is fed to the comparator.

COMPARATOR:- The comparator compares the analogue inputs from sensors with a fixed reference voltage. If this voltage is greater than the reference voltage the comparator outputs a low voltage, and if it is smaller the comparator generator generates a high voltage that acts as input for the decision making device (microcontroller).

MICROCONTROLLER:- The microcontroller is programmed to make the robot move forward, turn right or turn left based on the input coming from the comparator. The outputs of the microcontroller are fed to the motor driver.

MOTOR DRIVER: - the current supplied by the microcontroller to drive the motor is small. Therefore a motor- driver IC is used. It provides sufficient current to drive the motor.

Circuit Diagram:-

  • Here we are using pins P1.0 and P1.4 for taking inputs from the IR sensors after being amplified by LM324.

P1.0 – Input from left sensor

P1.4 – Input from right sensor

  • There are six outputs from AT89S52 microcontroller to the H-bridge.
  • Pins P0.0 and P0.4 are connected to enable pins of the H-bridge. We can use them to deactivate/active the two halves of H-bridge i.e. if pins are set to logic 1 the corresponding half of the H-bridge will be activated.

P0.1 – will drive the left motor in forward direction

P0.2 – will drive the left motor in reverse direction

P0.3 – will drive the right motor in forward direction

P0.5 – will drive the right motor in reverse direction


















  1. rachin plz send me ppt on line follower robot using microcontroller....

  2. what are these HEX FILE kindly tell me

  3. Hex file, is a format used to store machine language code in hexadecimal form. It is widely used format to store programs to be transferred to microcontrollers. The compilers convert the programs written in assembly, C etc into corresponding hex files, which are dumped into the controllers using burners/programmers. We have written our code in C then covert it into hex file.

  4. Rachine plz send codeof line follower using c for 89c51

  5. rachin plz u can send the working principle of 89s52


Stay Connected To Get Free Updates!

Subscribe via Email

You can also receive Free Email Updates:

Widget by NBT