Shop OBEX P1 Docs P2 Docs Learn Events
Sharp IR — Parallax Forums

Sharp IR

Can anyone tell me the formula to convert the voltage output of the Sharp IR sensor to distance (in SimpleIDE). I have the 10 to 80 CM version.

Thanks for any wisdom!!!!

Amanda

Comments

  • ercoerco Posts: 20,256
    edited 2016-02-16 01:41
    A fun sensor. You have Sharp's chart, I'm sure. Its output is nonlinear. Here's an old appnote, not sure if it's still on Parallax's site. About using an older 10-80 Sharp sensor (check the curve values to see if it matches yours). It gives BASIC code to interpolate between a few datapoints.

    Now just swap that into SimpleIDE and you're golden! :)

    That's actually a useful PDF to save, it shows how to use the sensor AND an ADC0831.

    http://mech.vub.ac.be/teaching/info/mechatronica/finished_projects_2012/Twinbot1/media/downloads/SharpGP2D12Snrs.pdf
  • ajward wrote: »
    Can anyone tell me the formula to convert the voltage output of the Sharp IR sensor to distance (in SimpleIDE). I have the 10 to 80 CM version.

    Thanks for any wisdom!!!!

    Amanda

    erco wrote: »
    A fun sensor. You have Sharp's chart, I'm sure. Its output is nonlinear. Here's an old appnote, not sure if it's still on Parallax's site. About using an older 10-80 Sharp sensor (check the curve values to see if it matches yours). It gives BASIC code to interpolate between a few datapoints.

    Now just swap that into SimpleIDE and you're golden! :)

    That's actually a useful PDF to save, it shows how to use the sensor AND an ADC0831.

    http://mech.vub.ac.be/teaching/info/mechatronica/finished_projects_2012/Twinbot1/media/downloads/SharpGP2D12Snrs.pdf


    Hello :)

    Do you find the good equation to convert Volt in centimeter ?

    I don't understand the basic code program...

    If find it could you share your code please ? Thx :)
  • NicoHEI wrote: »
    ajward wrote: »
    Can anyone tell me the formula to convert the voltage output of the Sharp IR sensor to distance (in SimpleIDE). I have the 10 to 80 CM version.

    Thanks for any wisdom!!!!

    Amanda

    erco wrote: »
    A fun sensor. You have Sharp's chart, I'm sure. Its output is nonlinear. Here's an old appnote, not sure if it's still on Parallax's site. About using an older 10-80 Sharp sensor (check the curve values to see if it matches yours). It gives BASIC code to interpolate between a few datapoints.

    Now just swap that into SimpleIDE and you're golden! :)

    That's actually a useful PDF to save, it shows how to use the sensor AND an ADC0831.

    http://mech.vub.ac.be/teaching/info/mechatronica/finished_projects_2012/Twinbot1/media/downloads/SharpGP2D12Snrs.pdf


    Hello :)

    Do you find the good equation to convert Volt in centimeter ?

    I don't understand the basic code program...

    If find it could you share your code please ? Thx :)

    Hi!

    Due to my inability to apply myself to see most projects through to completion, this one, as well, has fallen by the wayside. Still, while it was in focus, I realized I didn't need the sensor to provide exact distances. As long as I could find the output value when the sensor was approximately 12 to 18 inches from an object, I was good to go.

    My application was just to let Bob, my BOE/Activity Bot, know when something was close enough to require some evasive action. Precision just wasn't needed.

    Still, I might apply myself to find something approximating exact ranging, though I think the Ping))) sensor would be a better choice.

    Amanda
  • kwinnkwinn Posts: 8,697
    For converting some types of sensor readings to distance you could create a data table of sensor readings at various distances from an object. The problem with IR is that the signal also varies with the reflectivity of the object. A wall may provide a very different reading than a piece of furniture would even if they are the same distance from the sensor.
  • ercoerco Posts: 20,256
    This particular Sharp sensor uses a position sensitive device to determine distance by Parallax (yes, seriously apropos!) instead of reflected signal intensity. As such, it is fairly insensitive to the color and reflectivity of the object detected. The data sheet shows nearly identical curves for black and white objects. Very useful sensor IMO.
Sign In or Register to comment.