Shop OBEX P1 Docs P2 Docs Learn Events
GP2D12 and Basic Stamp — Parallax Forums

GP2D12 and Basic Stamp

DestroyerXDestroyerX Posts: 34
edited 2005-04-26 17:47 in BASIC Stamp
I own a Sharp GP2D12 infrared sensor. When I hooked it up to my Board of Education with a Basic Stamp 2, I could only get 2 values from it; one value when nothing was in its range, and a second when something was in its range. When I hook it up to my OOPic-R (a different microcontroller), I can receive a varying voltage based on how far away and object is in the 10-80 cm range. Does anyone know if it's possible to read the analog voltage outputed by the GP2D12 on the Basic Stamp or has anyone got this to work already?

Thanks,

Jason

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Unreal tournament 2004 rox

Comments

  • JonathanJonathan Posts: 1,023
    edited 2005-04-25 23:57
    Jason,

    I have a page up about using the GP2D12 on my site:

    http://madlabs.info/gp2d12/sharp_gp2d12.shtml

    HTH,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-26 17:47
    You need an A2D between the GP2D12 and the BASIC Stamp -- the output of that device is a voltage that corresponds to distance-to-target, though the output is NOT linear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.