Electrical – Piezo Buzzer as analog sensor for ESP8266 Huzzah Breakout

circuit-designesp8266piezoprotection

I'm using Adafruit's Huzzah ESP8266 breakout board (overview & pinouts), and I'd like to take input from a Radioshack piezo on the analog input pin without frying it. (Piezo datasheet, for reference.)

I've found a few people with a similar setup using an Arduino, and it seems like at a minimum I'd need something like a zener diode and 1MΩ resistor, like in the basic circuit from this PDF (page 12). The analog pin on the Huzzah has a 1V max voltage, so my sense is that I've got to make some adjustments to divide down the voltage further, and maybe include a capacitor? Super new to EE, so any advice on including & calculating the proper values for components is appreciated.

The end goal is to take input from the piezo and use it to set hue + brightness of an RGB LED, similar to the Adafruit LED ampli-tie project, but obviously with just a single LED. I can provide more details on that if it's relevant to getting up and running with the piezo input.

Best Answer

The 1MOhms resistor will "load" the piezo element and reducing the level of the induced voltage during normal usage. However, a sudden force applied to the element may cause a voltage spike which would kill the analog input, so you should add a series resistor of a few hundred ohms between the analog input and the piezo element.

Edit: the PDF you linked uses a Zener diode to clip the voltage, however the value it chose is a 5V Zener which is for Arduino analog inputs. You should choose a Zener with around a 1.2V breakdown voltage.