Shop OBEX P1 Docs P2 Docs Learn Events
PING returns MAX value all the time. — Parallax Forums

PING returns MAX value all the time.

MojotexasMojotexas Posts: 2
edited 2012-01-13 12:27 in Accessories
Hi, I have a PING sensor plugged into an Arduino.
I have used this sensor successfully in the past, I don't know why it stopped working, but now when I run the Arduino basic PING sketch, the PING only returns the MAX value of 145in, regardless of what is in front of it.

I took everything else out of the circuit so the PING is the only thing plugged into the Arduino. 5v, GND, and SIG are plugged into the appropriate pins.

The ACT LED light on the front is blinking green, everything looks fine, and the same configuration and sketch has worked in the past. What could be the issue.

thanks for the help with a n00b question,
MT

Comments

  • ercoerco Posts: 20,255
    edited 2012-01-13 09:08
    Test it on a real processor, a Stamp, and report back. :)
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-13 09:20
    When the microcontroller triggers the PING, it makes the ACT LED flash. The PING generates an ultrasonic sound pulse and starts its output pulse. When it receives an echo, it shuts off the output pulse. If there's no echo received within 18.5ms, it shuts off the output pulse. If you always get a maximum distance reading, the PING is probably not receiving an echo and is timing out at 18.5ms. It's possible that it's not producing the sound pulse despite the ACT LED blinking. Either the Arduino sketch has actually been changed despite what you think or the PING has somehow been damaged. Depending on how long you've had the PING, it could be a bad solder connection that has finally broken or something could have dropped on the PING damaging it. You might give Parallax Tech Support a call, but do check your software first.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-13 09:32
    What sketch and hookup are you using? This one is tested and is known to work:

    https://sites.google.com/site/parallaxinretailstores/home/ping-ultrasonic-distance-sensor

    Just to take your USB power out of the equation, plug in an external 9V power supply to the Arduino, and also try it that way.

    -- Gordon
  • MojotexasMojotexas Posts: 2
    edited 2012-01-13 12:21
    Thanks Gordon and Mike,
    I took both your advice. Rebuilt the circuit and checked the Code. Used Gordon's code. Still no love. Followed Mike's advice and talked to PING support, who offered to take it in for testing. Instead, I just brought it down to the Radio Shack where I bought it and exchanged it. (not perfectly within the rules, luckily the RS employee was a robot hacker).
    New sensor works just fine. Old sensor must have been broken or defective.
    Now I am wondering if there is any reason to protect the PING sensor in circuit with resistors, diodes, etc.? And, if so, what do you recommend?
  • ZootZoot Posts: 2,227
    edited 2012-01-13 12:27
    The PING has both an on-board series resistor (to protect the Ping and your micro's pin in the case both are driven at the same time) and an on-board pullup, so I don't think you need circuit protection per se. Of course, other usual rules apply -- don't drop it hard, bang it into walls, short out parts of the board with metal, etc.
Sign In or Register to comment.