Let's Make Robots!

ir sensor and ultrasonic

hay guys me again!

just wondering what the pros and cons of both of these sensors are and the one i should use in my first project.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

well i just wanted a sensor like the one used in the 'start here' project just to avoid stuff

See this post that discusses some alternatives.

then look up the specs for the sensor that is used in the SHR and work from there. Sharp, to my knowledge, is really the only game in town when it comes to IR range sensors.

if i wanted to get an ir sensor then what kind of specs do you think is the minimum you should have?

if i wanted to get an ir sensor then what kind of specs do you think is the minimum you should have?

In order to do what? The specs only become important when you have something you want to accomplish.

The maximum range is usually important. Most IR sensors are also going to have a small dead range at very short distances where the readings cannot be trusted.

Some IR sensors give you a simple digital on/off depending on if an object is detected, rather than an analog voltage proportional to the range.

Other specs you might care about are the required supply voltage and the current demands.

IR is affected by color whereas, sound(ultrasonic) is blind to color. IR can typically find narrow, rounded objects better than ultrasonic. I have read about people getting 'jumpy' readings with ultrasonic. I have as yet to see the same issues from IR.

I have seen both sensors successfully used in first projects. Which one is more likely based on how much you want to spend and/or who you are willing to purchase from. Most of the IR sensors I have seen are 10 to 15 USD. I have seen ultrasonics as low as 9 USD and as high as 33 (Radio Shack).

so is it possible, with the ir sensor, to make the robot follow objects of specific colours?

A Sharp IR range finder will give the same distance reading regardless of colour but can detect white objects at greater distance. These sensors use trigonometry so the output is nonlinear. You cannot use an IR sensor to detect a specific colour. IR sensors can have problems detecting objects that absorb IR light and can be confused by mirrors. Ultrasonic sensors are more linear but will not detect soft objects like curtains very well.

What I meant, guess I should have been more specific, when I said that IR is affected by color is that some glossy vs flat and white vs black issues occur when dealing with IR sensing. Meaning distance to target can be negatively affected by the 'perfect storm' of color and shine or lack thereof.