Shop OBEX P1 Docs P2 Docs Learn Events
Sharp GP2D12 with BS2 without ADC0831 - what to do....need help — Parallax Forums

Sharp GP2D12 with BS2 without ADC0831 - what to do....need help

roksr4k4roksr4k4 Posts: 2
edited 2012-04-15 13:06 in Accessories
so i'm building this robot for my school project, and i encountered a problem...i'm using BS2 and a Sharp GP2D12 IR rangefinder, but i don't have ADC0831 analog to digital converter.
i read somewhere, that you can still connect it directly to BS2, but it will only read digital data, meaning only "high" and "low". this would be good enough for my project, but i can't figure out how to program it...
if you have any suggestion or answers, please reply :) i have two days left....

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-15 12:20
    This website discusses using the RCTIME statement and a couple of passive components (resistors & capacitors) for measuring battery voltage. The same thing can be used for other slowly changing voltages and you could use it with the Sharp rangefinder. It just can't do more than a couple of measurements per second, probably enough for you. The measurements are not very precise and you have to calibrate it. Use the "app-notes" link at the bottom of the webpage.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-04-15 13:00
    One of the members recently suggested that the GP2D12 output could be used if you're OK with the BS2's TTL input High/Low thresholds being your detection thresholds.
    I don't know to what distance/s those equate.
    There's a potential for hunting/oscillating if it dwells at or near the thresholds.
    You can try it.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-04-15 13:06
    You could investigate by setting a pin as an INPUT for it and another as an OUTPUT for an LED and then make a LOOP where if INPUT is high then LED is On (if INPUT is low then LED is off), get out your test object, and see how that works.
    Pretty simple.
Sign In or Register to comment.