I am trying to connect a Piezo Film Sensor with polarity to the arduino. I am wondering how to do this because I can find a lot of example for a piezo knock sensor but this sensor allows touch and creates a voltage from zero to 30 V. I understand that I can connect in the analog in pins and out in the digital but when I connect the piezo film to an oscilliscope I get a reading in the positive and negative. Could someone give me some example code or perhaps point me in the right direction, like a website. even if you want to get me started and I can fill in the missing pieces to the code.
But to be able to measure positive and negative voltages, you can make a voltage of 2.5V with 2 resistors in series from ground to +5V, and use that for a 'ground' for the sensors. If you also connect that 2.5V to an analog input of the Arduino, you can measure both the 'ground' for the sensors and the (positive or negative) output of the sensor.
Don't forget to add protection diodes, and also an extra resistor of 1k for each analog input makes your circuit safer.
The diode passes only positive voltages, the capacitor integrates fast transients into something
slow enough the A/D can read, and the resistor decays the voltage on the cap, so the ckt is
ready for the next knock.
Since the piezo can generate voltage > 5V, you'll also want to connect a 4.7V zener diode
across the output.