I was trying out the NewPing library (the main example sketch) and when I compile it and check the serial monitor, it seems like it works for about 10 seconds, then instead of giving distance values it just writes out random characters. The only thing I can think of is that my sensor is bad. Any suggestions before I get another Ping sensor? I'm unsure if the same thing will happen.

Screenshot of NewPing output on serial monitor showing 10 seconds of output and then random characters

1 Answer 1


The main example sketch has this:

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

Your serial monitor is set to 9600 baud (bottom RH corner). Change that to match the setting in the sketch.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.