Perplexed about Ultrasonic range finders, particularly Maxsonar EZ1

So I'm building a robot car (ardubot from SparkFun). I got a Maxsonar Ez1 ultrasonic range finder so it can see. I'm trying to get it to:

  1. rotate around taking distance readings until it finds the direction in which is can travel the farthest before hitting something.
  2. Drive in that direction until it gets to close and will start looking around for a new direction to travel in.

The problem is that the range finder seems to detect the distance of any object close to it, not necessarily the distance of the object directly in front of it. I guess it will detect anything it finds within it's beam width? This is a problem because say for example that directly in front of the car, it has a clear path for 30 feet. But to the left and to the right of the car there are objects only 30 inches away. Instead of detecting that it can travel 30 feet without hitting an obstacle, it will detect the objects 30 inches away and it will think it can only travel 30 inches before hitting something.

I would like the range finder to either:

  1. Be able to accurately tell me the distance to the nearest object directly in front of the range finder.

or even better

  1. Be able to tell me the distance of not only what is directly in front of it, but what it sees at various degrees in it's beam with. Like directly ahead the distance is 30 feet, and at 15 degrees on either side it sees the objects 30 inches away.

Maybe I just have the wrong sensor? It seems that the way this range finder works, it's good at telling when something is close to it, but it has no idea whatsoever exactly where this object is. So it seems to not be a very suitable for the use as the "eyes" of my robot.

Am I missing something? Is there a better choice that can deliver functionality number 1? how about functionality number 2? Would really appreciate any insights you have about this. Thanks!

gowgow:
So I'm building a robot car (ardubot from SparkFun). I got a Maxsonar Ez1 ultrasonic range finder so it can see. I'm trying to get it to:

  1. rotate around taking distance readings until it finds the direction in which is can travel the farthest before hitting something.
  2. Drive in that direction until it gets to close and will start looking around for a new direction to travel in.

The problem is that the range finder seems to detect the distance of any object close to it, not necessarily the distance of the object directly in front of it. I guess it will detect anything it finds within it's beam width? This is a problem because say for example that directly in front of the car, it has a clear path for 30 feet. But to the left and to the right of the car there are objects only 30 inches away. Instead of detecting that it can travel 30 feet without hitting an obstacle, it will detect the objects 30 inches away and it will think it can only travel 30 inches before hitting something.

I would like the range finder to either:

  1. Be able to accurately tell me the distance to the nearest object directly in front of the range finder.

or even better

  1. Be able to tell me the distance of not only what is directly in front of it, but what it sees at various degrees in it's beam with. Like directly ahead the distance is 30 feet, and at 15 degrees on either side it sees the objects 30 inches away.

Maybe I just have the wrong sensor? It seems that the way this range finder works, it's good at telling when something is close to it, but it has no idea whatsoever exactly where this object is. So it seems to not be a very suitable for the use as the "eyes" of my robot.

Am I missing something? Is there a better choice that can deliver functionality number 1? how about functionality number 2? Would really appreciate any insights you have about this. Thanks!

LV or XL?

Based on the datasheets for both, the XL seems to have a wide pattern that would fit the issues you are seeing; you basically want a sensor with a much narrower beam width to do what you are trying to do. Note also, though, that with ultrasonic sensors, narrow beam widths can translate into smaller distances being sensed; you may want to use two separate sensors - one with a wide beam for long-range sensing, one with a narrow beam for close-range inspection...

I have seen people attempt to narrow beams using foam surrounds, but I have no idea how successful or repeatable this is.

Check out this pdf for a quick explanation of ultrasonic range finder beam patterns:
http://www.maxbotix.com/uploads/MaxBotixNewProducts.pdf

You may want to look at IR rangefinders like the Sharp sensors, eg: Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F - SEN-08958 - SparkFun Electronics if you need pinpoint and/or small obstacle detection.