It does take a definite tap on a cheap piezo disk to make a led blink and doesn't seem to harm it.
Connect a led directly to the piezo wires and tap the disk, the led flashes.
It also works with led through a diode bridge then a cap to flatten the spike, flashes twice and shines longer.
The tap on the piezo can exceed 5V for a short time. The led/circuit eats the spike and makes light that the Arduino can detect safely with few parts.
I'm wondering if opto-isolator leds can take it. Connect the other side to digital pins and time the HIGH pulse = strength of tap totally pin safe. Will signal slowly eat the chip?
I was measuring some piezo sensors the other day on a scope and I did not see any reverse voltage spike. The peak voltage was about 45V with a flick from my finger to the back that is the larger plate of the sensor. A 1M parallel resistor across it produced about 6V.
Piezo's are basically current sources so can generate large voltages if you present a high
impedance load.
The LED in an opto isolator will happily carry forward current with high voltage, but in
the reverse direct it will risk get zapped (-5V reverse voltage rating is common for LEDs)
So you either need an AC opto coupler (these have back-to-back LEDs in the input
side), or rethink.
The magnitude of the current from a piezo is fairly small though, this works to mitigate
the risk.
The usual way to tame them is just put a resistor in parallel to turn current to sensible
voltage levels. Try 100k or so to start with. Usually you can rely on the input protection
diodes to handle any excess voltage/current from a small piezo element - you can
add schottky diodes to back them up if you like.
That 45V was with the 'scopes input inpedance of 10M loading the piezo, so you'd expect to see
a ten-fold reduction adding the 1M.
The currents are small, but they are larger with faster mechnical deformation - so percussive
strikes will produce larger currents/voltages (although eventually the sensor will shatter if you take this
too far).
If you tap a piezo, it could produce a positive spike or a negative spike.
Depending what side you tap it, and what side of the piezo has been glued onto the copper.
Current won't be a problem, but LEDs don't like reverse voltages.
Wise to use a reverse protection diode across the LED, or use a bi-coloured LED.
Leo..
Putting diodes on the piezo is more parts but otherwise no problem. I have used such a circuit with even more parts.
Resistor is better than a cap for softening the spikes? I figured the cap would turn voltage into time sort of, a longer pulse.
In my older sensor circuit I connected the 4 bridge diodes to sense press on one pin and release on another. Without a diode, press and release do make AC.
I used 2 diodes per piezo lead before and transistors, I could read press and release even after holding the press for seconds. It happens as fast as you let up the strain on the crystal, what was + and - return to equal, current tends to flow back.
The piezo device is a capacitor. It cannot generate any DC voltage. If it produces a positive spike, then there must by definition be a compensatory negative impulse.
The impulse is however, a representation of the acceleration applied to the piezo. If the forward acceleration (such as a tap) is rapid but the rebound is slower, then the negative impulse will be correspondingly smaller (and longer of course).
You are measuring voltage where current can't flow?
If you put 2 leds across the piezo leads so that current can flow through one or the other then put a divider between the leds so you can only see one flash, a tap and release should get both to light.