I am working on a robot which moves by tracking white lines. I am stuck at making a logic for making correction to robot incase it goes a little astray. How many sensors atleast will I need and where they should be placed assuming that the base of the robot is square or rectangular. My idea was that there will be two sensors at the back and one in front in the middle of the sensors at the back. As long as the font one is on the line the two motors will remain running. Now, for example the robot moves towards left. The right sensor will be on the line and the right motor should stop.This will make the robot rotate clockwise. Now I am stuck here and don't know how to use this three sensor design to make the robot come back to its original position where only the front sensor is over the line.