I’m trying to write an interrupt-driven piezo sensor. The samples in the playground are a good start, but my project needs an interrupt-driven approach to work. Functions like “attachInterrupt” expect to see a >>digital<< port as input so I need to translate that analog output of from a tap on the piezo into a (TTL i assume) line-high or line-low on a digital port.
Any advice from anyone?
Seems like I should be able to do the following:
- Carefully measure the voltage and amperage from a standard “tap” given to the piezo
- Find an IC with an embedded Schmitt trigger that has a hysteresis that matches the voltage threshold
- Plug that into the circuit and hook the output into the digital port on the arduino
- Tell attachInterrupt to fire off an interrupt when that port does the right thing (i.e. goes low or high etc…)
Specifically, I’m asking:
A) Has anyone ever done this before? If so, what technique did you use?
B) If no one has done this, any good suggestions on the model numbers of ICs that have low trigger voltages?
Thanks very much.