A Line Follower is self controlled Robot, which follows a thick line. Many types of sensors are used to read the line. The Small Robot uses IR (Infra-Red) sensors, to read the line. Five pairs of IR LEDs and IR sensors (shaped as LED) are used here to read the Line. All the five IR sensing pairs are arranged in a row, perpendicular to the line path. The Small Robot always try to position symmetrical to the line, by following the middle IR sensing pair (out of 5 IR pairs in a row).
To have more input pins (at least 5 inputs are required for IR sensors), in small size, ATTNY84 micro-controller is selected, which have 14 pins. Out of 14 pins, five pins are used for sensing the line and four pins are required to control the two motors, through the motor driver (L293D).
(refer Small Robot Base Frame for motor control codes).
In general Line Followers are set to follow the line and complete target distance as soon as possible without leaving the line. The programming is either target for fast line follower, with smooth curves, or complicated line follower with various types of obstacles.
The Small Robot is programmed here to follower various line types, like, sharp bends, sharp turns, sharp curves, crossings, gaps in lines, zig-zag lines, double lines, stop identification etc.
A model path used to test the Small Robot is shown below, having various line shapes.
About Line Sensing:
Most of the Line Followers use IR (Infra-red) sensing system to read the presence of line. An IR LED emits IR light on the bottom surface (where the line is drawn). The IR light reflects from the surface and falls on an IR sensor (in LED shape), placed near to the IR LED. The IR sensor is connected in reverse biased, which varies its internal resistance, depending on the brightness of reflected IR light. The internal resistance of the IR sensor decreases with increase in falling IR light.
So, when the surface below the IR sensor is white, more reflected light falls on the IR sensor, which makes least internal resistance. Similarly, if the surface is black, least light reflects on the IR sensor, which makes highest internal resistance. Due to change in the resistance of IR sensor, the voltage at the junction of the IR sensor and fixed resistance varies, which are connected in series with power supply and ground. A typical IR LED + IR sensor pair arrangement with the circuit diagram is shown below.
Total 5 such IR sensing pairs are required for Small Robot, and soldered on a PCB, then fixed in front of the Small Robot. All the IR LEDs and IR sensors are 3 mm size. Maintain the gap between. the two successive IR sensors should be just less than the line width.
The IR sensor PCB, with 5 IR pairs, shall be fitted in front of the Small Robot, with a clearance adjustment arrangement (from surface) , to adjust the sensitivity with black and white surfaces.
Working of Line Follower:
Making of Small Robot as Line Follower is simple and easy. One PCB is required for IR sensing board, with 5 pairs of IR LEDs and IR sensors explained above. Another PCB with micro-controller ATTINY84 is used as control system for the Line Follower based on the varying voltages obtained from five IR senors.
The varying voltages from the IR sensor board are read as five digital inputs by the micro-controller. Then, the programmed logic makes the Small Robot to follow middle IR sensor. In case, the Small Robot reads the line from any other IR sensors, the required output code is sent through the four motor control pins, to turn the Small Robot accordingly, else Small Robot moves in straight line.
In case of sharp turns, gaps, crossings, junctions or stop blocks etc., the Small Robot moves little further and then takes necessary movement accordingly.
The complete circuit diagram of Control Board with ATTINY84, is available below. Use jumper wires to connect S1…S5 pins from Sensor Board to Control board consecutively.
The shorting jumper J1 is provided to select the line colour as BLACK or WHITE. Either Red or Yellow LED glows by selecting the shorting jumper position, for Black or White line.
A button switch, SW1, is useful to start the Line Follower, after switching ON the power supply to the Control Board.
Download file from above link and remove .TXT extension.