I'm trying to build and eletronic drum module, and my circuit is basically a resistor (I'm testing different values but I'm currently using a 20K ohms) and a BAT85 in parallel with a piezo.
The problem is that, when I hit the piezo, I get reads in the arduino for more than 100 milliseconds. And that is causing retriggers. I can adjust it in the software to ignore those reads for a given time, but than it is going to limit the number of beats per minute that can be played.
Is there a way to filter the signal, and reduce it for something below 80 milliseconds?
Analog inputs ? So you can check what the analog value is doing.
You could adapt the sketch and trigger on a steep rising slope of the signal.
Remember the previous analog value for each channel, and compare it with the new value, if the difference is above a certain level, it is valid.
I would like to add a protection resistor in front of each input. For example 1k or 4k7.