Shop OBEX P1 Docs P2 Docs Learn Events
Gp2d12 — Parallax Forums

Gp2d12

NewzedNewzed Posts: 2,503
edited 2004-09-18 00:14 in BASIC Stamp
I want to use the GP2D12 with a BS2P24, and I'm not sure I know what I am doing.· From the data sheet I gather that the sensor takes a reading every 39ms.· Is this correct?· If I pull Vo high, I get a digital output, which apparently is negative going pulses.· How does the Stamp read this digital pulse output.· Do I count the pulses and equate this to a distance?· If so, how often should I repeat the COUNT command in order to get a continuous indication of distance.· Is the period of COUNT 39ms?
Thanks for any help.

Sid

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-17 23:48
    That sensor uses an analog output.· The attached diagram shows how to connect it to a BASIC Stamp via an ADC0831 ADC.· By setting the Vref voltage to 2.55 you get 0.01 volts per ADC count.· This works fine with the GP2D12 as the max output is about 2.4 volts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
    610 x 310 - 14K
  • NewzedNewzed Posts: 2,503
    edited 2004-09-17 23:54
    Thanks, Jon.· I re-read the data sheet about the analogue output and felt that was a better way to go.· I'm using the 12-bit TLC2543 with
    Ref+ = Vdd.· I would think that would give me sufficient accuracy and resolution.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-18 00:14
    Yes, that should work fine -- I set Vref on the ADC0831 to 2.55 just to simplify the math used by my conversion routines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.