Trigger an external interrupt using a piezoelectric vibration sensor

In my current project I am using a piezoelectric element to detect vibrations of an object. In a test sketch I can easily trigger an event by polling an analog input where the piezo is attached, but for my actual project the code is too busy to constantly be executing analogRead.

My needs can be met perfectly by using an external interrupt on pin 2, and the code works fine when I substitute a button for the piezo. My difficulty lies in getting the piezo to reliably trigger the hardware interrupt.

I have tried using a single NPN transistor as well as a Darlington pair with the piezoelectric element, and I haven't been able to get the interrupt to reliably trigger.

Is there some other way I can use transistors, capacitors, op-amps, et cetera to amplify or strengthen the pulse from the piezo? Thanks for your help.

Have you considered using an op amp+comparator combo ? The op amp amplifies the signal and if you use an RC filter on the output of the op amp you can get a signal that the comparator can work with. What is the output voltage of the piezo ?

Look at a comparator one-shot.
See the LM339 data sheet


That's a good circuit. I only mentioned the op amp because I have no idea what the signal looks like or amplitude.

The amplitude of the signal from the piezo is tough to measure with my crummy oscilloscope, but I'm pretty sure it can hit 5V. It seems to be incredibly brief, though, because even though on the scope it looks like it should be working, it doesn't trigger the interrupt.

Thanks for the comparator suggestion! I'll have to look into that.