Main Site Documentation

Distance sensing


For my first project I am going to put a distance sensor on a servo and scan the field to determine what is in front of the tracked robot.

I have ordered short and longer range IR sensors(2). I see that there are also sonar detectors.

I am reading a beginner book on Robotics, and have not gotten to the part about sensor technology, if it exists.

What are the tradeoffs between the two technologies? Range, sensitivity, beam width, ? ? ?


You can get more accurate within a certain range on the IR sensors, however i’m not sure how well they will work in sunlight. You also need a reflective surface or they won’t work (ie: a red surface probably won’t yield a result). Beamwidth on the sharp sensors is pretty good, if you orient them vertically should shouldn’t get much in the way of issues detecting things that are not directly in its path.

Sonar is less accurate however works over a much wider range. You can also get signals bouncing about a bit which will reduce your sensitivity - however the more expensive units tend to correct for this. Sonar is also slower (signal wise) so if you’re moving a decent speed then it’s going to be more inaccurate due to the Doppler effect. Sonar will work indoors/out in a much wider range of conditions. Sonar doesn’t tend to like “soft” targets, things that absorb sound, such as cushions/carpet/fabric things.

It’s really going to depend on your application and where your robot will be used. If you only use it to do maze solving for instance a light sensor would be much better than sonar assuming a non-red maze. If you’re mapping objects outdoors, sonar will probably be the best route. If you’re looking around your house where you might have couches and such - a combination of the two would probably be a good idea.

Both have strengths and weaknesses. They are not mutually exclusive technologies - go all out and use both!


Reason to use IR
You do not care about incredibly accurate ranging
The sensor will not be used outside in the sun or you can compensate for bad/bright lighting.
You need a narrow beam width and care about a reflection at set distances.
You wont have dark colored objects around.

Reasons to use Sonic
You need accurate wide range of distances of obstacles, no matter what color they are
The robot will not encounter sound absorbing materials as obstacles like sponges or shag carpets on your walls.
You will be using the ultrasonic sensor inside or outside
Non constant use. So you can filter out ghost signals that bounce.
it wont be windy :>

Reason to use BOTH.
If you look at the list closely they can cover each other in most situations.

Ultra sonics and IR have ranges they can be used. many models exist for each of them using the right models for the application is key. Buying a ultra sonic that can detect 30 feet out is all fin and good but if you can correct your self in 6 inches it useless to spend that money. Buying IR range finder the goes out to 30 inches and down to 15 inches means you are blind if you turn into something that is less then a foot away.

You can also progress to a wireless camera and something like roborealm.


mini-hijak happening here. Can you get decent and “enthusiast” priced uSonic sensors for vehicular use - for instance like the parking distance senors some cars come with? Another project in “inception” is using a distance sensor to see when cars in front (eg stopped at traffic lights) starts to increase distance away and give an audible beep.


If anyone finds a supply for water/outdoor/automotive safe ultrasonics please let us know. I want to put a set on my car with a panda to build my own reversing alarm system :slight_smile: My maxbotix wont handle water submersion or dust… so i need something better.


Thanks to everyone for the great info.

In summary, the answer to IR versus Sonar distance detection is “it depends”. :smiley:


Mike, sounds like you have a job in Consulting. If not, you should :wink:


Sort of… :wink: