About PID control

You could Google "arduino line following robot" (2.5 million hits) to see what others have done.