Piezo element as shock sensor, will this work?

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.

Greetings, Peter

I used 4 regular diodes, 2 caps and 2 BJT’s to load wires going to 2 digital pins to read both press and release not precisely but in general. It’s kind of like a cheap R-C circuit.

Digital read eats a tiny bit of current but 1000 reads takes very little time.

My circuit could tell a very soft touch from a screwdriver handle slamming down on the disc. The good piezos will take the hard smacks for testing but the cheap ones won’t for long.

A comparator would be more selective for input amplitude. You could add a software debounce or schmitt trigger/one shot to help prevent noise spikes from being counted.

Adjust your voltage divider to only work at the peaks you are expecting.

Have the spike charge an RC and time the decay. You can tune the RC for resolution.
Arduino is more than fast enough. Digital read takes a fraction of a microsecond.

I ran the piezo through diodes, both leads to ground pointing in and pointing out, each a line with small cap to ground connected to a BJT base. The collectors got 5V through 2.2K and the emitter connect to a digital pin with no pulldown. The piezo charges the emitter wire through the protection I gave it and I’ve given it some vicious whacks, table pounders and not fried anything. :grin: