Vehicle's obstacle avoidance sensor

Hi all,

I’m new in robotics and I would like to make a vehicle in order to play with my 3 years-old son. I have a PIC 16F917 microcontroller and a Half H bridge L293DNE. What I’ve tried so far in order to make the vehicle move is s C code guided by the following link:
So I was able to make the robot move forward, backward and turn left and right. What I want to do now is to find suitable sensors for obstacle avoidance. Since I have no previous experience could someone recommend the appropriate compatible with the microcontroller sensors? If so, I would like to know in which pins of microcontroller I should connect the sensors and moreover the suitable programming order in C , for the sensors to interact with the microcontroller.

Thank you all in advance!!


I cannot really help you with the programming since I haven’t worked with PICs, but I suggest you consider an analog optical distance sensor for your obstacle detection (specifically, one of the first three products in the category I just linked to). These sensors output an analog voltage that indicates how far away an object is, so they are very simple to use and read. There should be plenty of examples out there for how to read an analog voltage with your microcontroller.

If you want to detect objects even farther away, you might consider a sonar rangefinder, but these can be slightly more complicated to use.

- Ben