In this video educ8s.tv shows us how to build an Arduino Robot that can avoid obstacles:
The robot that we are going to build today is moving around and it can detect obstacles and avoid them. It uses a supersonic distance sensor in order to measure the distance from its front side. When it detects and obstacle it stops, goes backward for a few cms, looks around and then it turns to the direction with the more space available. As you are going to find out, building this impressive little robot is extremely easy and fun. It will not take you more than a couple of hours from start to finish. Then you can use my code, modify it and implement your own robot behavior easily. It is a great learning experience and great introduction to robotics for kids and adults. Let’s build it!
A DIY obstacle avoiding robot using an SG90 servo and Ultrasonic Sensor – [Link]