Adding an Obstacle Avoidance Sensor to a PIC
There are so many sensors which can be used to detect objects in front of your vehicle.

Ultrasonic sensors:

These work as you might expect. One transducer sends out a 'blip' that's too high pitched for a human to hear, and measures how long it takes for the sound to reflect back from surfaces. These aren't perfect, however, and rely on there being a good reflecting surface. You may find that they just don't detect long-haired dogs, table legs, or hard flat surfaces at an angle.



Sharp optical distance sensor:

These work by shining out a beam of infrared light, and basically looking at the spot it makes on a surface with a tiny 1D camera inside. The output is an analogue voltage which can be directly connected to one of your PIC's analogue input pins.



Whiskers:

A really simple way to detect objects is to make some whiskers. Think of these simply as switches with a very long lever attached to them. You can either buy some cheap microswitches and attach sticks to them, or make your own using metal wire.