I have a piezoelectric sensor. Both pins are the same length. I have one like this: Piezo picture. On the Piezo it's written muRata and 01P. How do I know which do I send to the digital pins and which to the ground? I have an Arduino Uno.
If you're using just one or sound quality doesn't matter: it doesn't matter.
Otherwise you need to figure it out with a scope like this:
- Connect both poles of the connector of the PZT to an oscilloscope (time base approx. 50ms/div, y-axis 200mV/div).
- Slightly tap the head of the PZT with your finger. As a result you should get a voltage pulse on the oscilloscope.
- Positive Amplitude -> + pole of the piezo is connected to the inner conductor of the oscilloscope BNC connector.
- Negative Amplitude -> + pole of the piezo is connected to the outer conductor of the oscilloscope BNC connector.