Shop OBEX P1 Docs P2 Docs Learn Events
Trouble with GP2D12 sensor and Basic Stamp 2 — Parallax Forums

Trouble with GP2D12 sensor and Basic Stamp 2

SurajSuraj Posts: 10
edited 2004-11-16 15:33 in BASIC Stamp
Hi everyone, I am new here.
I need help with getting a GP2D12 sensor working.... I currently have it connected to a parralax stamps in class board and its giving me 1s and 0s, while i am trying to measure distance....Please help me on this aspect.... anyway to get it working would be appreciated!
Thanks
email: sixstring@gmail.com

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-16 05:03
    Try this: http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv114.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • LarryLarry Posts: 212
    edited 2004-11-16 05:04
    The reason you are having problems is that the GP2D12 is designed to return a voltage proportional to distance. This normally is read with an ADC (analog to Digital Converter).

    The Stamp doesn't have one built in, so you will need to:
    1) hook up an ADC unit to the stamp
    or
    2) use another Sharp sensor such as the GP2D02, which returns a byte value proportional to distance.

    two other possible solutions-

    There used to be a Sharp sensor that returned a PWM value proportional to distance that the Stamp can read-- you may still be able to find one.

    I suppose you may be able to use· a cap and RCtime to read the sensor,but I haven't tried.

    Larry

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • SurajSuraj Posts: 10
    edited 2004-11-16 05:17
    WOW!!!!
    That was super fast!!!!!
    Thanks a lot guys.... I'll try what you said.....
    -Suraj
    THANKS A WHOLE LOT!
  • JonathanJonathan Posts: 1,023
    edited 2004-11-16 15:33
    Suraj,

    Here is a page I made about uising this sensor. You can see it at:

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

    Hope this helps!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Sign In or Register to comment.