This is an obstacle avoiding robot using Ultra Sonic Sensors to detect the obstacles and avoid collisions while the robot is in action.
An Ultra-sonic sensor which is mounted in front of the robot – on the servo – is used to continuously measure the distance of the obstacles that are in front of it. The Arduino is programmed in such a way that it stops the motors if the obstacle distance is less than a particular value. Now the servo motor on which the ultra-sonic sensor is placed is rotated through 0°,45°,135°,180° and the distance of the obstacles are measured in all the positions. Now all the distances measured are compared and the robot is moved in a direction in which the distance is maximum and the process is repeated. The direction of the robot can be changed by using the delay function.