Hello! I would like to use a piezo element to register a bump or impact and count them with a edge triggered interrupt on the arduino. This is what the worst case signal output of the piezo looks like:
No current to speak of but enough voltage to kill anny logic connected to it. The good news is, that is a very nicely defined signal. I contructed this circuit as a filter, inverter and level shifter:
D1 serves as a halv wave rectifier and D1, R1 C2 form a envelope generator. The FET gate input voltage is limited with the D2 zener diode and the current though the diode is limited with R1. R3 serves as external pullup on the Arduino digital pin and the N-Mosfet Q1 inverts input the signal. R1 also serves a pull down for the FET Gate. And lastly R1 and R2 form a voltage divider.
After all that theory, this the input signal at TP1 on channel 1 versus the filter output at TP2 on channel 2:
That does not look that bad, the theory holds up. Lets have a look at the drain of the FET if this will work with a falling edge triggered interrupt. That is TP2 measured on channel 1 and TP3 on Channel 2.
That looks like it works, but sometimes, a low force impact will "bounce" a bit, my guess would be to either increase the filter capacitance or decrease the input impedance...
My concern would be the long term viability of this circuit. I once read somewere that a zener diode will tend to fail when subjectet to recurrent voltage spikes. I could use a TVS diode but i do not have one at hand. But if i understand it correctly a TVS diode will act as a "short" over the rated voltage and there would not be voltage to drive the FET gate high left.