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

GP2D12 Distance Sensor and Basic Stamp

sjennysjenny Posts: 25
edited 2015-03-25 08:55 in Learn with BlocklyProp
I am trying to interface a Sharp GP2D12 IR distance sensor through an ADC0831 A/D converter to a BASIC Stamp 2. I have built the digital voltmeter from chapter 3 of Basic Analog to Digital Conversion and verified that the A/D converter works. I have also hooked the GP2D12 sensor to a multimeter and verified that I can reproduce the voltage vs. distance calibration curve on the data sheet for the sensor. When I connect the distance sensor to the ADC0831, the values I read into the BASIC Stamp are not the same as those I observed with the multimeter. Instead of seeing the voltage vary with distance over the 10-80 cm range, I'm seeing the voltage vary only from about 40-50 cm. I am using the Parallax publication for interfacing the Sharp GP2D12 sensor and I must be missing something important. Can anyone offer suggestions to what I might be doing wrong? Thanks in advance for your help, Susan

Comments

  • kwinnkwinn Posts: 8,697
    edited 2015-03-20 08:21
    It could be the signal range is more than the adc can handle, or the input impedance of the adc is too low, or one of several more possibilities. More information is needed. Can you post a schematic of the sensor and adc circuit along with some voltage readings from the stamp and multimeter?
  • ercoerco Posts: 20,248
    edited 2015-03-21 10:08
    That's a well-proven combo, double check your wiring and code. You are using the Parallax pdf with all the info?
  • ercoerco Posts: 20,248
    edited 2015-03-21 11:34
    See http://mech.vub.ac.be/teaching/info/mechatronica/finished_projects_2012/Twinbot1/media/downloads/SharpGP2D12Snrs.pdf

    Adding a 10-47 uF electrolytic filter cap right at the sensor is helpful if you have noise in your power lines.

    An incredibly valuable document by Parallax, saved elsewhere on the web. Sadly, Parallax took it off their website when they switched to a newer Sharp sensor, but all the info is identical. Parallax, PLEASE REHOST THIS either as-is or updated.
  • sjennysjenny Posts: 25
    edited 2015-03-25 08:55
    Many thanks for all of the replies. I have to sheepishly admit to a loose ground wire that I found in the process of collecting more information for the discussion thread. I really appreciate your able assistance to those of us who are a bit new to the electronics field.
Sign In or Register to comment.