Arduino tutorial

A Piezo to attached to analog pin 0 with a 1-Megohm resistor
Code
In the code below, the incoming piezo data is compared to a threshold value set by the
user. Try raising or lowering this value to increase your sensor's overall sensitivity.
/* Knock Sensor
This sketch reads a piezo element to detect a knocking sound.
It reads an analog pin and compares the result to a set threshold.
If the result is greater than the threshold, it writes
"knock" to the serial port, and toggles the LED on pin 13.
The circuit:
* + connection of the piezo attached to analog in 0