My knock sensor is just knocking endlessly without any knocks to trigger it

My knock sensor is just knocking endlessly without any knocks to trigger it. I followed the tutorial, everything is connected properly. I'm using an Arduino Mega 2560 and a Radio Shack Piezo Transducer 273-073. Changing the threshold does nothing and its returning knocks even without the sensor connected. Thanks!

-j

Did you mean to ask for help understanding why this was happening?

If so I suggest you post a wiring diagram, your sketch, a description of what you expected to happen, and what actually happened.

I am using the Knock example from the Arduino software. I am a beginner with all of this, I didn't even know what "G", "+" or "S" meant on this shield I'm using (ground, power?, signal) - turns out I was plugging things in the wrong places. So, it does as it should, outputs "knock" in the serial monitor and the led flashes but sometimes the knocking starts and just keeps going. Now, in the tutorial it says I should wire a 1-megohm resistor in parallel to the Piezo element, is this necessary? Is this why my thing starts knocking endlessly after awhile? How the hell do I wire a resistor in parallel with this setup? Thanks in advance for being patient and helping someone get off the ground.

Now, in the tutorial it says I should wire a 1-megohm resistor in parallel to the Piezo element, is this necessary?

Yes.

So when you said

I followed the tutorial, everything is connected properly.

You were not right.

ann0yed: How the hell do I wire a resistor in parallel with this setup?

Take the resister. Connect one end of the resistor to one wire going to the piezo sensor. Connect the other end of the resistor to the other wire to the piezo sensor. Now the piezo sensor and resistor are wired in parallel.

Thanks PeterH, that's pretty simple. I had the brilliant idea of trying it out on a breadboard (another first) and now its working fine. Grumpy Mike, thanks for your smug yet correct comment.