I use an analog input from an Arduino to read the value from a piezo plugged in parallel with a 1M ohm resistor.

I followed this tutorial from Arduino: https://www.arduino.cc/en/Tutorial/Knock

Here is my schematic:

It worked perfectly until I decided to use a 1m cable between the piezo scheme (piezo || resistor) and the analog input.

With a short cable, I read 0 when there was no vibration nor activity. But when I change the length to 1m, I always read values higher than 0... This input is floating.

What would be the solution so I can read a precise value and stop this input from floating?

• I suspect you will need a piezo pre-amp that will condition the signal for transmission. They aren't complicated. But given the high impedance of the piezo, looking probably at a JFET pre-amp. – jonk Nov 16 '18 at 21:42
• The first search I did produced this jfet preamp for piezos. However, this one uses the phantom power used in XLR microphones and wouldn't be appropriate for your use here. But it gives you an idea. And it is a pretty fancy design. I'm kind of curious about studying it more carefully. Anyway, you'd be considering something much easier, I think. More like what's used with electret microphones, I think. So include jfet and electret in your searches, too. – jonk Nov 16 '18 at 21:56
• @ChristopheGudlake I think you should experiment a bit unless you feel able to do the design, yourself. That schematic you found is more like what I was thinking about. You may not require anything additional at the MCU end. But a DC path at the MCU end is probably a good idea. So you might try your 1 Meg idea just to provide something simple there. Just a series capacitor alone is probably not as good. So yeah. Add something. – jonk Nov 16 '18 at 22:23
• It is important to know what you actually want to amplify, i.e. what is the nature of the signal that actually contains the information. In a piezo sensor that is charge. You amplify charge with a charge amplifier which converts the charge generated in the piezo sensor into for instance a voltage. The simplest circuit for this is a well-biased low noise mos- or j-fet with low impedance gate capacity and negative feedback through a capacitor between drain and gate which is much larger than the drain-gate parasitic capacitance. The smaller this capacitor, the larger the amplification. – joe electro Nov 16 '18 at 23:11
• The $R C$ time of the filter should be (much?) lower than $20$ or $16.7 \, ms$. Say you make it $5 \, ms$, then with your $1 \, M \Omega$ resistor, the input capacitor will be $20 \, ms/1 \, M \Omega = 20 \, \mu F$. And don't forget to decouple the input for DC with a capacitor. An example can be found here: www.ti.com/lit/an/sloa033a/sloa033a.pdf (charge mode amplifier) or here: www.ti.com/lit/ug/tidu765/tidu765.pdf . – joe electro Nov 16 '18 at 23:29