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

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.