Piezo Vibration Sensor Hookup Guide

Pages
Contributors: jimblom
Favorited Favorite 14

Vibration Sensor Overview

Piezo vibration sensors come in a variety of shapes and sizes. Here is a selection from the SparkFun catalog:

Piezo Vibration Sensor - Large

Piezo Vibration Sensor - Large

SEN-09196
$5.50
Piezo Vibration Sensor - Small Horizontal

Piezo Vibration Sensor - Small Horizontal

SEN-09198
$9.95
2
Piezo Vibration Sensor - Small Vertical

Piezo Vibration Sensor - Small Vertical

SEN-09199
$9.95
Piezo Vibration Sensor - Large with Mass

Piezo Vibration Sensor - Large with Mass

SEN-09197
$6.50

Some piezo sensor's include weights at the end to help encourage vibration.

AC Voltage Source

Piezo sensors are unique because they produce an alternating current (AC) voltage when stressed, converting mechanical energy to electrical. If you hooked an oscilloscope up to a piezo sensor, you might see waveforms like this when the sensor shakes:

Piezo flicked, unloaded

The signals above were generated by simply inserting a large, weighted piezo into a breadboard and flicking it a few times. Note the voltage spikes are reaching almost +20V and -12V. Signals at that level have the potential to permanently damage a microcontroller's analog-to-digital converter (ADC) pins.

To dampen those voltage spikes, we have a few simple tricks up our sleeve. The easiest fix is to load the piezo with a large resistor. By placing a 1MΩ resistor in parallel with the sensor, for example, we can drop the voltage spikes down to safer levels.

Piezo sensor loaded with 1M, connected to ADC

In the graph above, the sensor is loaded with a 1MΩ resistor and connected to an Arduino ADC. The voltages spike between -0.5 and +5V are safely within the tolerable range of the ATmega328's I/O pins.

More complex piezo damping circuits might include zener diodes to clamp the voltage or op amps to buffer a signal, but this simple resistor-loading circuit is a good place to start.