Piezo Electric Buzzers/ speakers can also be used for robotic sensors, these could be used to detect pressure, touch or even vibrations, these type of sensors are used in automobile security systems and for industrial sensing applications.
Piezo Crystals used in these devices are unique in a way to where when voltage is applied, the crystals resonate and produce sound, on the other hand, if the piezo disc is bent, tapped or pressure is applied, you will see it produce a voltage. I have seen some piezo's put out quite a bit of votage when tapped hard, so in order to interface to a TTL circuit we have to make sure the voltage output of the sensor stays within the 5 volts range of our TTL circuit.
Here is a simple Piezo Disc touch sensor interface circuit I made....
Simple Piezo disc touch sensor interface circuit.
D1 - D2 prevent the voltage output of the piezo element from going above 5 volts.