Summary of Complete Guide to Design an Advanced Line Follower Robot
This article describes an autonomous line follower robot that detects a black strip on a white surface using infrared technology. The system employs eight IR transmitter-receiver pairs to track the path and identify junctions. Signals from these sensors are too weak for direct processing, so they are amplified by LM324 operational amplifiers before being sent to a PIC16F876A microcontroller. The microcontroller analyzes the data and sends control signals to an L293 H-bridge motor driver to manage motor direction.
Parts used in the Line Follower Robot:
- Infrared transmitters
- Infrared receivers
- LM324 operational amplifier
- PIC16F876A microcontroller
- L293 H-Bridge motor driver
- Motors
Line follower is an autonomous robot which can detect a specific colored line painted on a surface of different contrast, such as white on black. In this project I used infrared transmitters and receivers to track the black strip on white surface. Due to the difference of infrared reflection on black and white surfaces, it provides two voltages which can be amplified and used as logic states.

Step 1: Electronics
Flow chart above explains the working of the robot. There are eight IR transmitters and receivers to detect the path and junctions. Analog values from those receivers are amplified by LM324 operational amplifier. A microcontroller is used to detect the amplified digital values and to make decisions. It provides control signals to the H-Bridge motor driver (L293). More details are explained below.
Step 2: Op-Amplifier (LM324)

If the rays received by the IR receiver are above a particular threshold then an amplified signal is generated by the amplifier (LM324). In this project I used eight separate transmitters, receivers and amplifiers to make the tracking smooth (Fig.1) Note that the sensors cannot directly send a signal to the microcontroller as the signal voltage generated by them is too low and even when sensors are on white surfaces signal generated by them will be interpreted low by the microcontroller.
Step 3: Microcontroller(PIC16F876A)

Microcontroller receives the eight amplified signals from op-amps and it decides how to control the directions of the motors as shown in Fig.
Step 4: H-bridge Motor Driver(L293)

Microcontroller sends signal to the motor driver so that it can control the rotating directions. PCB layout and schematic diagram of main circuit is shown.
Step 5: Source Code – MikroC
Source Code can be downloaded from here
Source: Complete Guide to Design an Advanced Line Follower Robot
- How does the robot detect the line?
The robot uses infrared transmitters and receivers to track the black strip on a white surface based on differences in infrared reflection. - Why are amplifiers necessary in this project?
Amplifiers are needed because the signal voltage generated by the sensors is too low for the microcontroller to interpret correctly. - What component decides the motor directions?
The PIC16F876A microcontroller receives amplified signals and decides how to control the directions of the motors. - Which motor driver is used to control rotation?
An L293 H-Bridge motor driver is used to control the rotating directions of the motors. - How many IR sensor pairs are used for tracking?
Eight separate infrared transmitters, receivers, and amplifiers are used to make the tracking smooth. - Can the sensors send signals directly to the microcontroller?
No, the sensors cannot directly send a signal because the voltage generated is too low and would be interpreted as low even on white surfaces. - What type of source code was used for the project?
The project utilizes Source Code written in MikroC. - What determines the logic states in the circuit?
The difference of infrared reflection on black and white surfaces provides two voltages which are amplified and used as logic states.
