There are basically two ways of building a line following robot. First, using a light dependent resistor(LDR) and second, using Infrared(IR) LEDs.  A dark object reflects less light than a bright object ( a dark object absorbs more light than a bright object) this is the only fundamental logic behind a line sensing robot. So, basically a line following robot distinguishes a black line from a white surface.

Test your sensor:
Before you start assembling the sensor onto your robot chassis, check your if sensor is detecting the black and white surfaces properly. I have written a post about testing the sensor.

 

How to assemble?

The most difficult part of this project is to make a combination of LDRs and LEDs. Even a small mistake can take your robot out of black line. There follow the instructions carefully.