Ultrasonic vs IR distance sesnor
I wondered what was behind the decision to choose and ultrasonic based distance sensor over an infrared one for the corner sensors? As far as I can tell they're pretty similarly priced/sized and their accuracy levels are similar. What factors help you to choose between one or another? I'm building a similar sesnor and I have a couple of sharp GP2Y0A21YK IR distance sesnors kicking around but not ultrasonic ones so I was going to use them instead, is there anything in paticular I'm missing out on?
In the case of the corner sensor they both perform different functions:
The ultrasonic sensors are capable of measuring distances between 2 and 400 cm approximately. They will be used to get a reasonably accurate measurement of where the nearest object(s) to each corner are. Because they use sound there is a slight delay between readings, also since there are so many of them I'll have to "stagger" their use so they don't end up interfering with one another. By "stagger" I mean I can't have the two sensors facing the rear, for example, operating at the same time., as they might lock on to the other sensors transmitted signal and give a false reading.
The infrared sensors do not measure distance, instead, they are triggered when an object is detected at or closer than a preset distance. They will be used as part of the emergency stop system, alerting the robot that an object is now extremely close and may require immediate action. Because they use light they are extremely fast, and as the light is pretty directional there is little chance of them interfering with one another.
Of course, the ultrasonic sensors should also detect an object at that proximity, however, due to their speed and the "staggering" a very fast-moving object might get missed by them.
The distance sensor you have, the Sharp GP2Y0A21YK, is an entirely different beast than the ones I'm using. The Sharp sensor could indeed be used in place of the ultrasonic sensors, in fact, it has many advantages over them. My "collision detectors" are simple digital devices that do not measure distance.
There are considerations for both types of sensors. An ultrasonic sensor can get confused by echos, by other ultrasonic sensors, or by materials that absorb instead of reflecting sound. A light-based sensor can run into problems with dark surfaces, which may not reflect the IR beam, and in some cases by intense sunlight, which has a high IR component. So using both would give you the best of both worlds.
Hope this makes some sense!
"Never trust a computer you can’t throw out a window." — Steve Wozniak
The detection ranges of ultrasonic and infrared sensors are different:
The IR sensor detects between 4 to 80 cm and the ultrasonic sensors sense up to 400 cm.
Depends on the sensor. I have a bunch of Sharp IR sensors in my parts bin. One measures in the range 2-15cm, another 20-150cm - so choose your poison!
Both IR and ultrasonic have strengths and weaknesses. IR sensors are easily fooled by shiny surfaces and are prone to interference, especially from sunlight. Ultrasonic sensors can be confused by clutter.
I'm building a robot in which I plan to use sensor clusters (a bit like the DB1's corner sensors) than will combine IR proximity, IR rangefinder and ultrasonic plus a microcontroller to compare and, hopefully, make sense of what they're saying.
Hi Everyone thanks for your help that all makes a lot of sense! As with most things it sounds like both options have their pros and cons, I'll give what I've got a try and see if its reliable enough for my purposes. If not I'll do as Bill and speculatrix both suggested and use a combination of ultrasonic and IR range finders.
Combining the capabilities of both types of sensors will probably be the best way to go,