Close

Line following

A project log for E.R.N.I.E

A cheap to produce and easy to assemble robot for use in STEM education.

sebastian-goscikSebastian Goscik 07/23/2017 at 21:330 Comments

What is a line following robot and how does it work?

As you might have already guessed, a line follower is a robot that follows a marked line. In this project the goal will be to design a robot that can navigate a track with multiple turns made from black electrical tape. The way the robot will be able to detect its position relative to the 
via an array of 3-5 Infrared (IR) reflectance sensors. These sensors consist of two parts, an IR 
an IR photodiode. The LED emits light, which is then reflected by the surface into the photodiode:


Depending on the colour of the surface the amount of light reflected will vary. In our case we will be using a white surface with a black line. As can be seen in the previous diagram, the black surface absorbs all the IR light while the white reflects it all. The photodiode will produce a current proportional to the amount of IR light it receives. Using this we can build the following circuit  (D1 = IR LED, D2 = IR Phototransistor) to detect whether the sensor is above a white or black surface:


While ideally the black line will absorb all IR emitted by the LED, in reality this isn’t the case. The
reflected IR and ambient light will mean that the sensor will output a small amount of current even on the black line. 

The minimum number of sensors needed to successfully follow a line is two. One on either side of the track (you can get away with one sensor but its unreliable). Using two sensors tends to lead to a lot of wobbling so it is recommended to use three, one on the line and one either side.

Once you have an array of sensors you can then steer the robot based on how much light each one receives.

Programming tutorial

The above text is an excerpt from the provided worksheet which is attached to this project, or can be found here. This worksheet will take you through how to program a line following robot even if you have no programming experience. It teaches: how to use the arduino software; how to use the analog and digital pins on an arduino; how conditional statements work; and how to install and use the adafruit motor shield library.

Discussions