Forums

SHARP IR range finder

Started by agrisnik November 25, 2003
Hi, I am novice in the field of bx24 an microcontrollers at all.
Therefore I'll be thankful for any advice. I am trying to read data
from sharp range finder R120-GP2Y0D02YK (20 - 150 cm analog output).
I connected it as it is depicted in application notes at NetMedia
homepage. I also used the sample program to read the data.
The problem is that I receive veraying distance values at constant
distance. For example at a distance 30 cm I receive something like
60,74,89,65 etc....

The power suppley is 5.0 V. I have 2 rangers and both of them are
behaving similar.

Has anyone faced with problems like this?
Than You in advance




Several things might be going on.
- The Sharp sensors signal does pulse somewhat, a capacitor across
5v and ground can help cut it down.
- The bouncing of the signal is more pronounced the further away you
are (although 30cm shouldn't bounce by 30%).
- I like taking several readings and averaging them.

By the way, I worked through some formulas for converting the Sharp
sensor readings into distance, see:
http://users.oco.net/smith/robots/sharpir.gif

Jeff Smith --- In , "agrisnik" <agris.nikitenko@r...>
wrote:
> Hi, I am novice in the field of bx24 an microcontrollers at all.
> Therefore I'll be thankful for any advice. I am trying to read
data
> from sharp range finder R120-GP2Y0D02YK (20 - 150 cm analog
output).
> I connected it as it is depicted in application notes at NetMedia
> homepage. I also used the sample program to read the data.
> The problem is that I receive veraying distance values at constant
> distance. For example at a distance 30 cm I receive something like
> 60,74,89,65 etc....
>
> The power suppley is 5.0 V. I have 2 rangers and both of them are
> behaving similar.
>
> Has anyone faced with problems like this?
> Than You in advance




I agree with jeff, try reading ang gathering the average value and try to
produce a look up table. That way, you wont have a dilemma on multiple values
of the voltage reading. Also take note that the IR reading varies from
surface to surface (shades of dark to light), this is because of the
properties of IR sensors.
Cheers!
Carlo

Jeff Smith wrote:

> Several things might be going on.
> - The Sharp sensors signal does pulse somewhat, a capacitor across
> 5v and ground can help cut it down.
> - The bouncing of the signal is more pronounced the further away you
> are (although 30cm shouldn't bounce by 30%).
> - I like taking several readings and averaging them.
>
> By the way, I worked through some formulas for converting the Sharp
> sensor readings into distance, see:
> http://users.oco.net/smith/robots/sharpir.gif
>
> Jeff Smith
>
> --- In , "agrisnik" <agris.nikitenko@r...>
> wrote:
> > Hi, I am novice in the field of bx24 an microcontrollers at all.
> > Therefore I'll be thankful for any advice. I am trying to read
> data
> > from sharp range finder R120-GP2Y0D02YK (20 - 150 cm analog
> output).
> > I connected it as it is depicted in application notes at NetMedia
> > homepage. I also used the sample program to read the data.
> > The problem is that I receive veraying distance values at constant
> > distance. For example at a distance 30 cm I receive something like
> > 60,74,89,65 etc....
> >
> > The power suppley is 5.0 V. I have 2 rangers and both of them are
> > behaving similar.
> >
> > Has anyone faced with problems like this?
> > Than You in advance >
>
> ">http://docs.yahoo.com/info/terms/