Shop OBEX P1 Docs P2 Docs Learn Events
Sharp IR sensor debugging problem — Parallax Forums

Sharp IR sensor debugging problem

optsnavoptsnav Posts: 1
edited 2012-12-10 21:40 in Accessories
Using Sharp GP2D12 Analog Distance Sensor (#605-00003) Quick start circuit and code downloaded from Parallax site.

WHAT HAPPENED: ADC0831, POT and Sharp IR circuit verified. Code executes, but displays constant value of 10cm. Not clear how to calibrate from documentation.

DID THE FOLLOWING: 1. ADC ,POT and IR devices all independently checked out OK. 2. First Used the POT and ADC to set POT at 2.55 reference voltage. 3. Then rewired to connect Sharp IR sensor. 4. The Code is a cut an paste from Parallax documentation.

OTHER FACTS: If IR sensor is removed from connector spurious signals are detected by circuit and displayed.

Any debug suggestions will be appreciated...Tom

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-09 09:22
    Post your actual code. Post a schematic of the actual circuit drawn by tracing out the connections, not what they're expected to be. #1: The downloaded code works in isolation. #2: The combined / modified code doesn't work. Something happened between #1 and #2.

    attachment.php?attachmentid=78421&d=1297987572
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-12-10 13:05
    One common mistake that is often made with the Sharp GP2D12 is to wire it incorrectly into the circuit. Unlike the typical GND/VDD/SIG pinout that Parallax devices and servos use, the GP2D12 uses a pinout of VDD/GND/VOUT. Are you sure you have the device wired correctly? At one time Parallax has a custom servo-style cable that was designed to connect to this sensor to prevent this issue.
  • ercoerco Posts: 20,255
    edited 2012-12-10 21:40
    @optsnav: Welcome to the forums!

    You said "Quick Start circuit" in your post. I bet a bunch of people assumed you meant the Propeller Quick Start board, when you actually may be using a BS2 per this helpful but HARD TO FIND (come on Parallax, make it easier to find, I had it bookmarked) document: http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf This shows the sensor pinouts and does use (now) confusing words "Quick Start circuit".

    Can you confirm which processor you are using?
Sign In or Register to comment.