Answered: Robot Maze

How do we get our robot to re-correct itself when it gets too close to a wall? What our robot has to do is go through a maze without touching the walls and it keeps turning towards the wall and will not correct itself by going straight and away from the wall… It has 3 ultrasonic sensors, 1 on the left front, 1 on the right front, and 1 in between those 2, which is facing straight forward. We have it moving straight and turning when it reaches an obstical but are having trouble making it correct itself as it slowly moves toward a wall on either side. If ANYONE can help please do…

You will most likely need one on pointing to the right and one pointing to the left to detect the wall on both sides just like you detect an obstacle in front of you. Having one pointing forward on the right and left will not be able to detect the wall that is at a right angle from the sensor.