Shop OBEX P1 Docs P2 Docs Learn Events
Ping Problem — Parallax Forums

Ping Problem

rsattrsatt Posts: 3
edited 2012-06-21 17:24 in Accessories
Help!
I have the Ping sensor connected to an Arduino Uno Board and am trying to run the standard example program.
I've verified that the pin (7) works, but tried changing to others with similar problem.
I get a reading of 0 distance at all times.
If I disconnect the power and Gnd connections and leave the Sig connected to the digital pin I start seeing readings in the 35 to 45 cm range. I get the same result if I plug the power terminal from the Ping into pin 7. As soon as I connect sig to pin 7 and either ground to ground on the board or voltage to V5, or both, the distance reading drops to zero again.

I've tried upping the low signal duration from 2 to 5, 10 and 20 with no difference.

Is this sensor a brick or am I doing something wrong?

Comments

  • hover1hover1 Posts: 1,929
    edited 2012-06-21 11:05
    Have you tried this code:

    http://arduino.cc/en/Tutorial/Ping/


    Given the number of Arduino/Sensor threads lately, should there be a new Sub Category under sensors, or just let the learn.parallax.com take care of it. www.learn.parallax.com is not well published.

    Jim
  • hover1hover1 Posts: 1,929
    edited 2012-06-21 11:08
    If you disconnect the power and ground, you will only be reading noise from the Sig line. Will not report anything mean able

    Do you have a picture of you setup? That would help.

    .
  • rsattrsatt Posts: 3
    edited 2012-06-21 12:03
    The linked code is the code I am using, and the associated diagram is exactly how I have it set up.
    In looking at other threads I noticed the LED being referenced. My Ping LED is not lighting up at all.
    I've tried changing to several other pins with no success (yes, I changed the pin in the code too).
  • hover1hover1 Posts: 1,929
    edited 2012-06-21 12:24
    Well, its hard to go wrong with a three pin setup, but a picture might help.
  • hover1hover1 Posts: 1,929
    edited 2012-06-21 12:25
    rsatt wrote: »
    The linked code is the code I am using, and the associated diagram is exactly how I have it set up.
    In looking at other threads I noticed the LED being referenced. My Ping LED is not lighting up at all.
    I've tried changing to several other pins with no success (yes, I changed the pin in the code too).

    Sound like the PING is not getting 5V power? What kind of wires/ connectors are you using?
  • rsattrsatt Posts: 3
    edited 2012-06-21 16:46
    OK, so I've gone out and bought a second sensor. This one flashes the LED as expected, so power is not a problem. Readings still stay at zero though.
    I don't have a way to post a pic, but my setup duplicates the diagram from the arduino example linked earlier. No doubt about that.
    Not saying I'm infallible, but I am an engineer and have been building computers since the 80's. This is just my first rodeo with these microprocessor/sensors. As you say, it's hard to go wrong with a 3 wire rig.
    I'm guessing the first sensor was DOA, not sure what's going on with the second. I'm not near my usual bench so access to tools/meters etc is limited.
    Thanks for your help so far, and I have to say that i love the hovercrafts. Something I've always wanted to do.
  • hover1hover1 Posts: 1,929
    edited 2012-06-21 17:24
    Can you try this setup? It's worth a shot.

    http://learn.parallax.com/KickStart/28015

    J
    im
Sign In or Register to comment.