I have encountered the same problem as the guy here
I wanted to comment on it, but it's read only, so I am reposting in hopes somepony might find my findings useful.
I have tried running the same sketch as in the link above, but I couldn't get it to work. I pulled out my scope and a multimeter. I have measured the output voltage of the piezo to be >2 volts when I knock the table on my scope, which was confirmed by the CREST function of my multimeter. However, the Arduino didn't seem to care.
Turns out the code is sampling the ADC at a VERY low rate and thus it just skips the knock most of the time.
If you are encountering my problem, simply comment out the line that says // delay(100); // delay to avoid overloading the serial port buffer
Now the sensor reading is happening much quicker. Of course, the correct solution would be to reduce the resolution of the adc to get quicker sampling, and then handle the sampling itself in low level macros, but this works too, so whatever. Just set the threshold to about 10 and it'll work well unless you are in super electrically noisy environment.
Edit: failed to mention that the resulting code will spit out "Knock" more than once after the knock. Ideally, we should do a peak detection to find a local maximum and move on from there...