Electronic – Piezoelectric Sensor and the ADC

atmegaavrpiezo-buzzer

I would like to hook up a piezoelectric sensor to my ATmega8 microcontroller via its ADC.

The reason being is that I would like to use the sensor as a force sensor. I noticed that the harder I press it, the higher a voltage it delivers (but for a very short time). This is expected behavior, of course.

What I am wondering is how I would connect it to the ADC. I mean, when I press it really hard, the piezo registers upward of 10 V. When I press it softly, it usually gives me around 1.3 V.

As I understand it, the micrcontroller cannot take anything more than 5V, or else I run the risk of damaging it. Is this correct? I mean, I am guessing the current coming out from the piezo is extremely small, though I don't know if that changes the situation.

Essentially, I would like to know if it is possible to hook up this piezoelectric sensor to my AVR microcontroller to take analog readings.

Best Answer

A quick experiment with a piezoelectric bender shows the following voltages:

  • No pressure: 0.12 Volts (probably drift / noise / breeze)
  • Mild pressure: 1.72 Volts
  • Firm pressure: 4.21 Volts
  • Fingernail tap: 6.29 Volts (spike)
  • Knock on table: 11.74 Volts (spike)

Assuming the area of interest spans the first 4 levels of signal, and any reading higher than 10 Volts can be generalized to an arbitrary "Out-of-Range" reading, the following implementation should serve for the purposes of question:

schematic

simulate this circuit – Schematic created using CircuitLab

The diode D1 shunts the negative portion of the signal that the peizo bender will generate on knocks or release of pressure. To be extra-cautious, this can be substituted by a Schottky diode to cope with very fast spikes, or for tighter clipping to ground rail (~ 0.3 Volts instead of ~0.7 Volts), a germanium diode.

The Zener diode is intentionally selected as 4.7 Volts, in order to ensure that the output voltage does not overshoot 5 Volts under any circumstances.

The op-amp buffer ensures that the voltage divider is not significantly loaded by the ADC pin, hence the voltage divider resistance computation is simplified.


This circuit will output half the positive voltage generated by the piezoelectric pressure sensor until the voltage reaches approximately 4.7 Volts, then clamp at that voltage for any higher pressures applied. Any negative voltage generated due to knocks or sensor bounce-back, will be shunted across the diode D1, protecting the op-amp (or the ADC if directly connected) from negative voltages.