Arduino enthusiast 'Lucky Larry' spent some time to document his experimenting with Arduino and some piezo sensors. After realising that they can be also used as knock sensors, he used them to create a minimalist drum machine. However instead of just detecting simple knocks, his code detects the approximate peak frequency of each hit, and generates a matching tone for output. For example:
If you're interested in working with piezos for various reasons we have a neat little SOUND: sound and buzzer module:
It can be used as a noise-maker driven by your microcontroller for audible feedback of events, and it can also be used as a knock-detector input to sense events and react to them. Includes a built-in 1M resistor to allow the piezo element to detect shocks. For more information and to order, please visit the product page here.