Saturday 14 July 2012

A STUPID LINE FOLLOWER ROBOT


Some of us hate programming. For them there is a catch word “KISS”, which stands for “Keep It Simple And Stupid”. Here our objective will be to build a simple and stupid line follower robot that doesn’t even require a microcontroller (and hence no programming!). The question now arises that if we do not use a microcontroller then how would the robot process the information that the sensors will feed it? Well the answer lies in us, humans. We are by far the most intelligent of all species on this planet. Let’s see how, we can make our own logic and drive the robot.

Required Component List

  1. A L293D Motor Driver IC
  2. IR Sensor Array(Construction details are in my published book)
  3. 2 DC Motors (300 RPM)
  4. 2 Wheels (12 cm)
  5. Castor Wheel (3-4 cm diameter)
  6. Cardboard Base (12x15 cm)
  7. Motor clamps (To fix the motors on the chassis)

The Stupid Line Follower Logic

So here we are again at the point where humanity has always been thrown to, simplifying the complexity of nature. Have you ever given it a thought about the logic you use while driving a car on the road? Actually you may not have thought about it, but there is a particular logic we follow while we drive a car on the road. The logic is called the line follower logic. Ok, let’s get into more details now.
IF(Left side of the car is about to touch the left side of the road)
Turn Right:
ELSE IF(Right side of the car is about to touch the right side of the road)
Turn Left;
ELSE
Move straight;

We will use the same logic to drive our own robot, here the sensors will serve as the eyes of the robot and the motor driver IC (L293D) will drive the wheels(Motors).
The whole logic can be divided into two parts:
  • Sensing
  • Controlling

For the sensing part, we will use two IR Sensors. The IR sensor has been described in my previously published book on "Line Follower Robot". One IR sensor on the left side of the robot and the other one on the right side. On white surface they give a “HIGH” output, and on black surface they give a “LOW” output.
The controlling part could be handled by the L293D motor driver IC.

Implementing The Logic On Hardware

We will have two IR sensors mounted one at the left side and the other on the right side of the robot base. The output from each IR sensor will be either “HIGH” or “LOW” based on whether it is on a white surface or a black surface. The sensor outputs has to be connected to the motor driver IC in such a way that when both the sensors are on the white surface they must drive both the motors forward i.e. the robot must move forward.
Connections for the line follower

Note: Not connected pins are set to low by default. i.e., they will be at 0V.

Construction

Sensor Placement and Assembly

Now all that you need to do is to assemble all these parts together into the cardboard chassis as shown in the above figure. Fix the sensors in the front and connect the motors as shown in the above diagram. The sensor outputs from the two sensors must be connected to pins marked as A and B. The pins 4,5,12 and 13 of the motor driver IC are to be connected to the ground. Another important thing is that the ground of the individual sensors must be made common to the whole circuit, including the power supply ground.


Logic Testing

Lets check whether the logic we devised earlier works to drive the robot or not.
The motors are to be connected in such a way that both the motors will pull the robot forward if both the sensors are "ON". You will have to figure out the right combination of connecting the motor wires
  • Case I: Both the sensors are on the white surface (i.e., both are giving output as 'high'). In this case the robot will move forward.
  • Case II: Left sensor is on white and right sensor is on black. In this case robot will take a right turn simply because right motor will stop rotating as both its inputs C and D are low.
  • Case III: Left sensor is on black and right sensor is on white. In this case our robot will take left turn as the left motor will stop rotating as both its inputs A and B are low.
  • Case IV: Both the sensors are on black (i.e., there is a cross or divergence). In this case both the motors will stop, ultimately the robot will stop at this point (as both the sensor outputs are low)
All the four cases that are discussed above are the only possible conditions for a line follower.

We have just finished the Line Follower robot in a very interesting way. Logic is that the motors will act  according to its corresponding sensor, i.e., left motor will be OFF when the left sensor is OFF and ON when the sensor is ON. Same conditions hold true for the right motor as well. Hence, the motor is controlled by its corresponding sensor only. This logic will always work in any kind of line follower. Now its time to create a line follower arena of your own and test the robot.