Working Principle
A piezoelectric vibration sensor (often a PZT ceramic disc or PVDF film) generates a voltage when mechanically deformed — the direct piezoelectric effect. When vibration, shock, or flex causes the element to bend, the crystal lattice distortion produces a charge proportional to the applied strain. This charge appears as a voltage across the element’s electrodes.
Piezo sensors are AC-coupled by nature — they respond to changes in force, not static loads. A constant pressing force produces a transient voltage spike that decays. This makes them ideal for detecting vibration, taps, knocks, and impacts.
Electrical Characteristics
| Parameter | Typical (PZT Disc) |
|---|---|
| Output Type | AC voltage (proportional to vibration) |
| Open-Circuit Voltage | Up to ±50 V (sharp impacts) |
| Frequency Response | 1 Hz – 10 kHz+ |
| Sensitivity | Varies by geometry; ~1–20 mV/g typical |
| Impedance | Very high (>1 MΩ at low frequency) |
| Static Force Response | None (AC-coupled, transient only) |
| Temperature Range | −20 to +70 °C (PZT), −40 to +80 °C (PVDF) |
| Cost | Very low (~$0.10–$0.50) |
Interfacing with an MCU
Connect one electrode to an ADC input and the other to GND. Critical: Clamp the voltage to protect the ADC:
- Place a 1 MΩ resistor in parallel to bleed charge and prevent floating voltages
- Add two Schottky diodes (BAT54S) from signal to VCC and GND to clamp spikes
- Alternatively, use a 5.1 V Zener diode for simple overvoltage protection
Calibration
- Threshold tuning: Tap the sensor at your desired trigger strength and note the ADC peak; set threshold slightly below
- Debouncing: After detecting a hit, ignore readings for 20–50 ms to avoid multi-triggering from ringing
- Velocity sensitivity (MIDI): Map the peak ADC value to a 0–127 MIDI velocity range for musical applications
Code Example
/*
* Piezo Vibration / Knock Sensor — Arduino
* Wiring: Piezo(+) → A0, Piezo(-) → GND
* 1M resistor A0–GND, Zener 5.1V A0–GND
*/
#define PIEZO_PIN A0
#define THRESHOLD 50 /* ADC threshold for knock detect */
#define DEBOUNCE_MS 50 /* Ignore ringing after hit */
unsigned long lastKnock = 0;
void setup() {
Serial.begin(9600);
Serial.println("Piezo Knock Sensor Ready");
}
void loop() {
int val = analogRead(PIEZO_PIN);
if (val > THRESHOLD &&
(millis() - lastKnock) > DEBOUNCE_MS) {
lastKnock = millis();
Serial.print("KNOCK detected! Intensity: ");
Serial.println(val);
}
delay(1); /* Fast polling for peak capture */
}
Real-World Applications
Musical Instruments & Predictive Maintenance
Piezo sensors are the standard trigger element in electronic drum pads and MIDI controllers, converting strike intensity to velocity. In industrial IoT, they detect bearing vibration signatures to predict motor failures before they occur. Other uses include knock-detection for door locks, seismic monitoring, and tap-to-wake interfaces.
Limitations
- No static measurement: Cannot measure constant force or weight (use FSR or load cell instead).
- High output impedance: Requires high-impedance input; loading the sensor reduces output voltage.
- Voltage spikes: Can produce dangerous voltages without clamping protection on MCU pins.
- Frequency dependent: Sensitivity varies with frequency — not a calibrated accelerometer.
- Fragile: PZT ceramic discs crack under extreme bending; PVDF film is more flexible.