Ultrasonic sensor not responding

TheWave:
Heres the sketch

 // ---------------------------------------------------------------------------

// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------

#include <NewPing.h>

#define TRIGGER_PIN  12  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     11  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
 Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
}

void loop() {
 delay(50);                      // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
 unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
 Serial.print("Ping: ");
 Serial.print(uS / US_ROUNDTRIP_CM); // Convert ping time to distance in cm and print result (0 = outside set distance range)
 Serial.println("cm");
}

Sounds like the sensor is fried if that sketch doesn't work (and you're using those pins/timings).

Make sure that you've connected all the pins correctly and try different jumper wires. I've seen situations like this and come to find out the problem was the trigger and echo pins were switched or one of the jumper wires had a bad connection at the pin or a totally broken wire. When I get a pack of breadboard jumper wires I go through and test every one for continuity. In every pack, I've had at least one bad wire. This can make you totally pull your hair out as everything is correct but it's not working.

Anyway, test all your jumper wires and verify your connections are correct. If so, you must have a bad sensor. And if it's a bad sensor, I'd like to have it (I wrote the NewPing library). Having a sensor like this can be helpful for testing. PM me if you'd like to help out and send me the sensor.

Tim