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

Sharp GP2D15

John RitzJohn Ritz Posts: 14
edited 2005-01-12 22:23 in Robotics
Can anyone point me to a hookup schematic and example code for integrating a Sharp GP2D15 IR detector to the homework board?

Many thanks!

Post Edited (John Ritz) : 1/12/2005 5:41:48 PM GMT

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-01-12 18:00
    Here's the demo for the GP2D12.· I don't know if your 15 just means it's longer distance...or a different way for comms or serial integrated or whatever...but here's a starting point!

    Just note I've customized this slightly for my own uses....so you might have to change it again for yourself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    http://www.geocities.com/paulsopenstage

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

  • John RitzJohn Ritz Posts: 14
    edited 2005-01-12 18:20
    Thanks. The GP2D12 is analog, while the GP2D15 is the digital version fixed at about 10" distance. It gives high and lows only. So it would definitely be very different from the GP2D12. however,·I do have a GP2D12 as well, so this is helpful. However,·I still need to know about the GP2D15.

    Thanks!
  • John RitzJohn Ritz Posts: 14
    edited 2005-01-12 21:01
    I think i may have found what I've been looking for. It appears that the GP2D15 merely uses standard logic highs and lows according to this article at http://www.acroname.com/robotics/info/articles/sharp/sharp.html.

    I should be able to use the whisker logic described in the robotics text to get what I need. I will try that out.
    ·
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-12 21:05
    Well, all you need to know should be in the datasheet.

    Does it give back a certain pulse width for a given distance?· Or is it an encoded TTL signal?· (Rs232?)



    Ok, I just read up on it real quick.· All that happens is that it sends it's "signal line" high when something comes within 24cm.
    So, all you do is tell your stamp to look at the connected pin to see if it's a 1 or a 0.

    So, if you have the signal line connected to pin 0...then,
    GPsig con 0
    if (GPsig = 1) then
    Do all yer stuff here; turn on an LED; or whatever
    endif

    There are arguments on using the CASE function in place of IF's....your choice!· It's all in the help file in the Pbasic editor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    http://www.geocities.com/paulsopenstage

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

  • John RitzJohn Ritz Posts: 14
    edited 2005-01-12 22:23
    Thanks, steve_b. I think that is what I need.·I will be testing this out, and I am sure I will find what I need with the datasheet and your advice.

    Cheers!
Sign In or Register to comment.