Introduction: Line-follower Robot

Robots are becoming a part of our life.As strange it might seem there is no standard definition of a robot.However there are some special characteristics that a robot must have to decide what a robot should be.

Some important characteristics are:

1. Sensing

2.Movement

3. Energy

4. Intelligence

So what exactly is a robot..??

- Basically,it is a machine capable of carrying out a complex series of actions automatically, especially one programmable by a computer.

And what is a line follower..??

-It is a machine that follows a line, either a black line on white surface or vise-versa. For Beginners it is usually their first robot to play with.

So in this tutorial I will teach you how to make a line follower with the help of an IR sensor and Micro-controller.

Step 1: Video of a Basic Line Follower Robot Using Microcontroller

Now let us see the things required to make a line follower:-

  1. chassis
  2. DC motor
  3. Wheels
  4. Connecting wires(say red for positive and black for negative)
  5. Battery
  6. IR sensor(IR led,photo-diode,Comparator IC MT8870 )
  7. Microcontoller(ATmega 16)
  8. Driver ic(L293D)
  9. Resisitors,Capacitors,oscillators,diodes,transisitors,switches
  10. Programmer (or a burner to burn the program in the microcontroller)

Step 2: Circuit Diagrams and Working:

Flow diagram :

  1. First, an IR sensor consisting of an IR led and a photodiode detects the light intensity(mainly difference between black and white).
  2. This is light intensity is converted into an electrical signal mainly in the form of 1's and 0's and then sent to the comparator IC where it compares 2 voltages (voltage from the sensor and variable resistor)and accordingly generates an output.
  3. The output generated from the comparator is then fed to the micro controller and it runs according to the program stored in it. Generally,for different combinations of 1's and 0's have different functions needed to be performed by the line follower. Basically, we use 2 IR sensors so number of combinations are 4.So, if say 1 is for white and 0 is for white so for different combinations of this will inform the line follower of its position and it will move accordingly to stay on line. So if we want the line follower to move on black line only and stay away from white then whenever it will sense a white light in the sensor ,the robot will turn to avoid it in any required direction to maintain its path. So this is the main principle for a line follower robot to work. Hence, it is said that a microcontroller is the most important part for a line follower.
  4. Now, the output of the microcontroller is given as an input to the driver ic and then as the combinations change the motors connected to the ic rotate accordingly to change the rotation of the wheels as per requirement.


How an IR sensor works?

IR (infrared) sensors detect infrared light. The IR light is transformed into an electric current, and this is detected by a voltage or amperage detector.A property of light-emitting diodes (LEDs) is that they produce a certain wavelength of light when an electric current is applied--but they also produce a current when they are subjected to the same wavelength light.

Note: A line follower can also be made without a microcontoller.

Step 3: Program for the Microcontroller

Refer the attachment for the program

Basic logic of the program:

  • There are 4 conditions for the line follower to move based on the outputs given by the IR sensors:(white surface has logic high and black logic low)
  1. If both IR sensors detect white surface and they give an output high(1) then the line follower will move forward.
  2. If the left IR sensor is high and right is low then the line follower will turn left.
  3. If if the left IR sensor is low and right is high then the line follower will turn right.
  4. If both IR sensors detect black surface and they give an output low(0) then the line follower will stop.

Feeding this program to the microcontroller through a programmer will complete the process.

Step 4: How to Make the Body of a Line Follower Robot.?

  • Take the DC motors and attach wires with it. One black and one red wire for negative and positive values.Attach the motors with the chassis and also attach the wheels. This gives us the body for the robot.
  • Now, place the IR sensor(IR Proximity sensors are input devices which gives digital input to the micro controller. The input depends on the environmental factor like light intensity, surface color etc.) in the front of the chassis.
  • Then,place the Atmega16 mini board at the top of chassis and screw it (Here in the mini board there is already all the connections done which are required i.e; atmega16,l293d ic,7805 ic and the needed resistors,capacitors,etc.)
  • Then connect the battery of 6v with the mini board with the help of a dc jack .

This is complete connection required to make a line follower robot.

Now just Switch on the battery and the line follower is ready to go.

Step 5:

Thank you