Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: mbateman on November 13, 2008, 04:31:00 PM

Title: Sharp IR and sunlight
Post by: mbateman on November 13, 2008, 04:31:00 PM
I am having problems with my Sharp IR (GP2D12) Rangefinders. Whenever my robot gets near sunlight (direct or indirect) it starts getting false readings. I determined that they are coming from the GP2D12's which I thought were supposed to be mostly immune to sunlight. After some experimentation, I determined that if they are not moving, they are pretty resistant to interference from sunlight. But if they are moving, they get false readings. To test this, I connected one up to power and ground, then connected my volt meter up to the output pin. I can aim it directly at the sun and it still reads zero, but if I move it, the voltage jumps up. As long as it is moving, it stays high. Stop moving, and the voltage drops back to zero even in full sun.

I have tried several things to compensate for this, but none seem to work. Here is what I have tried:

Does anyone have any tricks for using these in a scanning mode where sunlight is present?
Title: Re: Sharp IR and sunlight
Post by: octagonx on November 20, 2008, 04:55:31 AM
At first i thought you are experiencing a brown out - power is not enough when your robot moves thus creating erroneous reading , but since you did this -

"To test this, I connected one up to power and ground, then connected my volt meter up to the output pin. I can aim it directly at the sun and it still reads zero, but if I move it, the voltage jumps up"

The fastest way to solve this is to change sensors.
Title: Re: Sharp IR and sunlight
Post by: mbateman on November 20, 2008, 11:35:04 AM
Are there any low cost sensors that have the narrow beam of IR and immunity to sunlight of ultra-sonic. I have not found anything yet that sounds promising.
Title: Re: Sharp IR and sunlight
Post by: pomprocker on November 20, 2008, 07:03:35 PM
Give your robot more intelligence.

Add a photoresistor that will tell your robot when it is in lighting that is too bright for the sharp IR, then tell it to use a sonar during that time instead until light levels are back to normal.

And a sonar sensor might require a thermometer sensor, because they don't work so well at certain extreme temperatures.

Basically, there are sensors that compliment other sensors to make them more aware. For example you don't use your eyes in the dark, you switch to touch and sound.
Title: Re: Sharp IR and sunlight
Post by: Webbot on November 20, 2008, 09:12:37 PM
Can you get around it with an RC filter low pass filter. So quick changes caused by movement are filtered out and you just end up with more 'permanent' values? Check wikipedia etc for filters. Curious to know how you get on.
Title: Re: Sharp IR and sunlight
Post by: mbateman on November 21, 2008, 10:20:37 AM
I thought about that, but in looking at the specs on the GP2D12, it does not really have a continuous reading, but rather updates its output once every 48mS. So a false reading will exist for the same length of time as any other reading. Since I need to read it every 50-80mS for my scan rate to work out, and I need to pay attention quickly to real readings of a close object, it seems like there is not much I can do to filter it.

I also tried to do it in software by storing the last reading from each servo angle and using the farther of the two readings. This did help a lot with false positives, but it also destroyed my accuracy and ability to react quickly to a close object.

I think my next step will be to remove the IR sensors and try to use just the ultrasonic and see if it is accurate enough for what I need.
Title: Re: Sharp IR and sunlight
Post by: szhang on November 22, 2008, 10:22:09 PM
What is happening is the sun light is saturating your sensors.  The sharp ir are resistant to interference, but if the sun is really bright it masks the signal the IR sensor is getting.

Ultrasound has its own problems.  You can try getting some bandpass IR filter.  I heard developed film works, but never tried it myself.
Title: Re: Sharp IR and sunlight
Post by: Admin on November 28, 2008, 12:32:59 AM
Interesting . . .

I also did similar experiments, and found that sunlight didn't affect the Sharp IR even at full sun intensity. But yet for some reason my robots with Sharp IR would go crazy only when sunlight was there . . .

The 'only when moving' theory might explain this . . . I'm assuming its something inherent with the physics of the sensor itself, not sure if there is a way to avoid this problem.

mbateman, use hyperterminal to store the values and plot it in excel. Also, can you tell us about the objects that were in front of the sensor during your tests?
Title: Re: Sharp IR and sunlight
Post by: mbateman on November 28, 2008, 04:44:38 PM
This occurs any time there is sunlight in the field of view of the sensor. This can be direct or reflected. As long as the sensor is stationary, the sunlight does not effect the readings enough to make any real difference. But as soon as the sensor is in motion, then it gets readings like there is something close to it even when there is not. I was able to recreate this in many different situations from aiming directly at the sun, to aiming at a far away wall with reflected sunlight on it. I suspect that since the IR sensor looks for an angle of incoming light, that by sweeping the sensor across a source of IR, that it will eventually "see" IR at an angle that would normally indicate something close.

As I write this, I realized that it may only be sensitive to motion in one plane. I may try rotating the sensors 90 degrees so that the scanning and turning motions are in an orthoganal plane to the sensor Tx/Rx lenses axis.
Title: Re: Sharp IR and sunlight
Post by: mbateman on November 28, 2008, 04:51:42 PM
Well, so much for that idea. :-( Changing their orientation did not seem to help much.
Title: Re: Sharp IR and sunlight
Post by: szhang on November 28, 2008, 06:05:56 PM
maybe the sharp IR is doing a high-pass filter on the data?  So it rejects the constant DC signal from sunlight, but when you move around the readings vary fast enough to pass through the filter?