Piezo Switch input Analog or Digital, and detection

Hi All,

I am working on a project where I need 3 x Piezo switches connected (one will be Ent, + and -).

As most would know, pushing a piezo button creates a small voltage (2-4v for a split second when bushed and released).

Firstly, I would like to know if I should use analog or digital inputs. I think Analog, as I can then "tune" how hard the switch needs to be pressed for it to trigger (Like the Knock Sensor project).


How do I read these analog ports while the code is running? If the switch is pushed while in the loop part of the code, How do I record that it was pushed and then inspect it during the code (as it is an analog connection)? If it was digital, I could use StateChange I think - http://arduino.cc/en/Tutorial/ButtonStateChange.

Thanks in advance...

The piezo generates a lot more than 2-4V. Here are some references for you to read:

  1. http://www.scienceprog.com/thoughts-on-interfacing-piezo-vibration-sensor/ This one has a comparator type output towards the end that may be what you are looing for.

  2. http://leucos.lstilde.org/wp/2009/06/piezo-transducer-signal-conditioning/ More general on what happens when a piezo is pressed.