The light sensor must read the reflection of light and transfer it to a diode that is adjacent to the red led. The diode then transfers the signal into a number and the number value must be greater than 45 for the left motor to move forward and the right motor to coast. If the value is less than 45 then the left motor will move forwards but the right motor will coast. This allows the robot to turn left and right onto the black line and continue to follow it. If it moves off the black line the reflection will be greater thus having the left motor move and turn the robot back onto the black line