Piezo example resistor question

Hi there,

I was trying to understand the piezo sensor example at:

I was wondering what the 1Meg resistor does in the circuit? I don't quite see why it wouldn't work without it.

(Understanding level: had basic EE in college, but practical knowledge is lacking)

Thanks
-Paul

A little bit of hardware can simplify the software, and vice-versa.

The Piezo element is essentially a very high impedance connection to ground.

The resistor provides a lower impedance path to ground, preventing the (100 meg impedance) input from floating, minimizing the chance that stray electric fields will be interpreted as audio.

Ah, I get it.

Thanks!

-Paul