car controlin usig microcontrollers
you can use two rows of sensors attached to some distance away from the car's center line. the two rows will be used to determine if the car has undergone some deflection from its supposed trajectory (the white line). whenever the car deflects from its trajectory, your microcontroller should be able to drive it back by turning the car the opposite direction until the car's center line align with the trajectory line. you can use phototransistors as the sensors, with leds providing the light source to be reflected by the surface. different surface colors reflect different amount of light to the phototransistors.
for the collision detection you can use ultrasonic sensor, attached to the front side of the car. if the sensor detects objects in front of it some distance away, the microcontroller can decide to reduce the speed so that it will stop before collision.
you may want to design your microcontroller so that it can control the motor's speed. you can do this by pulse width modulation. a dc motor can be easily controlled using pwm.
this is just a general idea, but i think it is quite common in robotic. you can try googling for 'robot line follower' (i guess that is your project, right?) there's much more solution on it.