Maker Pro
Maker Pro

Sharp IR Proximity sensor help

dwreck

Aug 19, 2012
27
Joined
Aug 19, 2012
Messages
27
Hi all,

I have the Sharp GP2Y0A21YK IR proximity sensor.

I'm using it in a simple application, i.e to detect on object, with the arduino uno. I have power with the +5V line and then GND. The sensor takes a reading every 50ms. I've been monitoring the readings and of course there's a lot of variation. Example, the readings are varying from 0 to 100, but at one instant it'll just jump to around 160 without anything in the sensor's way. The sensor is not moving in any direction.

I've tried connecting a 10 micro-farad capacitor between +V and GND but no significant changes.

Summary: If I leave the system for let's say, 2 minutes alone and it taking readings, at some point it will get a reading as if there was an object in proximity..

Any help or advice please? Thanks in advance.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
As I see it, this sensor operates by detecting reflected light. It will possibly be sensible to incident light from other sources, too.
Try to shiled it from other light sources (especially infrared).
Does this help?

Harald
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
This is normal, they simply detect sudden changes in temp, a sudden cool breeze or a hot breeze will trigger them, as will say a cool mist or what not passing by... This is why you have to adjust the threshold that they trip to filter out as many false triggers as you can... Or as Harald suggested narrow/limit it's field of view to help reduce false triggers... They are a good general purpose sensor but they are far from accurate int he end...
 

dwreck

Aug 19, 2012
27
Joined
Aug 19, 2012
Messages
27
As I see it, this sensor operates by detecting reflected light. It will possibly be sensible to incident light from other sources, too.
Try to shiled it from other light sources (especially infrared).
Does this help?

Harald

Thanks. I will try shielding it to see if it makes any changes.
 

dwreck

Aug 19, 2012
27
Joined
Aug 19, 2012
Messages
27
This is normal, they simply detect sudden changes in temp, a sudden cool breeze or a hot breeze will trigger them, as will say a cool mist or what not passing by... This is why you have to adjust the threshold that they trip to filter out as many false triggers as you can... Or as Harald suggested narrow/limit it's field of view to help reduce false triggers... They are a good general purpose sensor but they are far from accurate int he end...

My current threshold value is now 150. The sensor has that value at around 30cm from it. And this is the range that I want (around 30 to 35cm). If I increase the threshold, I think I will get a lower range.
 
Top