there's a few things you could do to mitigate the effects of the IR outside these three are increasing in difficulty and cost:

1.) you can put the sensor in a deep cavity (~2-4") with black absorbing material e.g. foam in a camera case surrounding it. this reduces scattering from the surroundings that would add noise to the detectors. this is highly fov constraining however. but you can have a linear array to increase this. the downside is that the black material in the sun will eventually heat and saturate the sensor.

2.) the IR from outside is also going to be because of the temperature differentials as well as the material backscatter in IR. you can test this as airman seems to be trying out; but all materials will have some backscatter and thermal mass to them. lighter materials will have different signatures than heavy materials. also color and reflectivity matter, so these characteristics will change the behavior from room temperature dynamics. This is because a lot of the sensors are likely using black or gray body assumptions for the temperature response unless they have multiple IR colors. so a near field background calibration is necessary often. this means you have a control that you look at at a controlled temperature and reflectivity and then you can try and compare those readings to what your sensor is observing in the real world. [cheap way is to possibly put this in a box in a specific area of the field of regard of the sensor and take some occasional measurements/cals]. adding a color sensor & photodetector could help.

3.) outdoors can have a lot of particulates and aerosols and more variation in water vapor than indoors. avoiding these variations is generally a good idea, or having active monitoring of these conditions to eliminate the biases to your readings. this again more advanced and will require a lot more sensors and more $.

basic rule is to eliminate the random backscatter, control or observe the thermal properties of the bot's sensors, calibrate out the noise, and rule out false alarms with other sensors.

there's a few things you could do to mitigate the effects of the IR outside these three are increasing in difficulty and cost:

1.) you can put the sensor in a deep cavity (~2-4") with black absorbing material e.g. foam in a camera case surrounding it. this reduces scattering from the surroundings that would add noise to the detectors. this is highly fov constraining however. but you can have a linear array to increase this. the downside is that the black material in the sun will eventually heat and saturate the sensor.

2.) the IR from outside is also going to be because of the temperature differentials as well as the material backscatter in IR. you can test this as airman seems to be trying out; but all materials will have some backscatter and thermal mass to them. lighter materials will have different signatures than heavy materials. also color and reflectivity matter, so these characteristics will change the behavior from room temperature dynamics. This is because a lot of the sensors are likely using black or gray body assumptions for the temperature response unless they have multiple IR colors. so a near field background calibration is necessary often. this means you have a control that you look at at a controlled temperature and reflectivity and then you can try and compare those readings to what your sensor is observing in the real world. [cheap way is to possibly put this in a box in a specific area of the field of regard of the sensor and take some occasional measurements/cals]. adding a color sensor & photodetector could help.

3.) outdoors can have a lot of particulates and aerosols and more variation in water vapor than indoors. avoiding these variations is generally a good idea, or having active monitoring of these conditions to eliminate the biases to your readings. this again more advanced and will require a lot more sensors and more $.

basic rule is to eliminate the random backscatter, control or observe the thermal properties of the bot's sensors, calibrate out the noise, and rule out false alarms with other sensors.

welcome to the forum

however, you can never really eliminate all the noise , especially not on a robot that moves outside

yup - agreed. noise can't be eliminated in practice... especially for mobile robots in the open environment. some of it is even useful in learning behaviors especially if they are predictable features.

Perhaps the Sharp IR avoids the sunlight by using as its wavebands some of the areas of the solar emission spectrum that are absorbed by water vapor.

While 47% of sunlight is in the near-ir (800nm-2600nm) most of it is before 1400nm. Even so there area a number of null areas that you can completely ignore the sun such as the 1800-2000nm range and 1350-1400nm. If your other sensor was in the 1000 range or 1600 range, I could see how it would freak out.

I attempted to review the Sharp IR data sheet for help, but didn't find anything of value for wavelength.

i dunno how the heck people map with ultrasonici read about it and it has a 30 degree beamthis thing is pretty unprecise,, maybe they use some code tricks with it? im not sure about this onei still believe tha ir is a better choice for mapping unless its range

30 degree beams are useful when trying to track along long walls. you're mentioning the issue of beamwidth vs. precision.

For radars anyway... the 3dB precision is beamwidth = wavelength / diameter of the aperatureand for optics... beamwidth = 1.22 wavelength /diameter (note these formulas assume small beamwidths so a small angle assumption is played and the sine portion is often neglected). These formulas are valid for EM radiation.

Regardless... if the object you're looking for is less than this beamwidth, then you may need either a larger diameter aperature or use a smaller wavelength. Otherwise you're good. So if it's a vertically oriented pencil you're looking for, you might have some trouble finding its position precisely, but if it's a 5" wall... then you have a different story.

You can also combine the data with sensor fusion techniques to resolve the best known range (the ultrasonic) with the IR's azimuth data. This is a bit more complicated because it involves playing games with fixed and/or body reference frames depending on where the sensors are mounted and correcting for their placement on board the robot. This is serious robotics when you go here.

You can form a best estimate and covariance through a series of samples and iterative filtering of the position of an object with a single sensor. The difficulty with two sensors is that you have to correlate the data 'somehow' to that object (usually a priori - which means using prior knowledge of truth) then you can go back and integrate the measurements from all the other sensors you can correlate the measurements for that object and reduce the error on the best estimate significantly. Filtering is a wild beast... especially if you're using slower microcontrollers. I've never done filtering on a microcontroller, only on high powered PC. And you do need to know a good bit about mechanics to pull off a multi-sensor system for moving targets.