Table of Contents
- Piezo Elements as Drum Triggers
- How Piezoelectric Triggering Works
- Trigger Circuit Design
- Arduino Drum Trigger Code
- Building a Drum Pad Controller
- Frequently Asked Questions
- Conclusion
Piezo Elements as Drum Triggers
A piezoelectric element (piezo disc) generates a voltage when subjected to mechanical stress — bending, pressing, or impact. This property makes piezo elements ideal for building electronic drum pads that detect the force and timing of hits. When you strike a pad with a piezo sensor underneath, the element produces a voltage spike proportional to the impact force, which the Arduino reads as a velocity value for triggering drum sounds.
Piezo discs are incredibly affordable in India — a pack of three 35mm discs costs under ₹50 on Zbotic.in. Combined with an Arduino and some padding material, you can build a complete velocity-sensitive drum controller for under ₹1,000 that triggers drum samples in your DAW or produces sounds through a speaker using the Mozzi synthesis library.
The advantage of piezo-based drum pads over button-based triggers is velocity sensitivity. A gentle tap produces a quiet sound, while a hard hit produces a loud one — just like acoustic drums. This dynamic response is essential for musical expression and realistic-sounding drum programming.
How Piezoelectric Triggering Works
When you strike a pad, the piezo disc flexes and generates a voltage spike. A typical 35mm piezo disc produces 0 to 50V depending on impact force. Since the Arduino’s analogue inputs accept only 0 to 5V, we need a protection circuit to clip the voltage and prevent damage to the microcontroller.
The voltage spike from a piezo hit has a characteristic shape: a sharp rise to peak voltage in under 1 millisecond, followed by a decay with ringing oscillations over 5 to 20 milliseconds. The Arduino needs to capture the peak value (for velocity) and then ignore the ringing (to prevent re-triggering). This is handled in software with a threshold and a scan time window.
The dynamic range of a piezo disc covers about 40 dB, meaning the ratio between the softest detectable hit and the hardest hit is about 100:1 in voltage. After the protection circuit clips the voltage to 5V maximum, the Arduino’s 10-bit ADC maps this to 0-1023, which is then mapped to MIDI velocity 0-127. This gives you 7-bit velocity resolution — more than enough for expressive drumming.
Trigger Circuit Design
The protection circuit for each piezo element is simple but essential:
Components per trigger pad:
- Piezoelectric disc 35mm — 1 piece
- 1M-ohm resistor — 1 piece (parallel with piezo for discharge)
- 5.1V Zener diode — 1 piece (voltage clamp)
Circuit description: Connect the 1M-ohm resistor across the two leads of the piezo element. This bleeds off the charge after a hit, preventing the voltage from floating. Connect the 5.1V Zener diode with cathode to the positive lead and anode to ground — this clamps any voltage above 5.1V, protecting the Arduino. Connect the positive lead to an Arduino analogue input pin and the negative lead to ground.
Some builders add a 100-ohm to 1K-ohm series resistor between the piezo and the Arduino pin for additional current limiting. This is optional but adds an extra safety margin against voltage spikes that exceed the Zener’s clamping speed.
Pad construction: Mount the piezo disc on the underside of a rubber or silicone pad using double-sided foam tape. The pad material matters — too hard and it hurts your hands; too soft and it absorbs the impact before the piezo can sense it. Craft foam sheets (5mm EVA foam) from stationery shops make excellent drum pad surfaces at minimal cost.
Arduino Drum Trigger Code
Here is code for a 4-pad drum trigger using the MIDIUSB library (Arduino Pro Micro) or serial MIDI (Arduino Uno):
#include "MIDIUSB.h"
const int NUM_PADS = 4;
const int padPins[] = {A0, A1, A2, A3};
const int padNotes[] = {36, 38, 42, 46}; // Kick, Snare, HiHat, OpenHH
const int THRESHOLD = 30; // Minimum trigger level
const int SCAN_TIME = 20; // ms to find peak
const int MASK_TIME = 50; // ms before re-trigger
int peakValue[NUM_PADS];
unsigned long lastHit[NUM_PADS];
bool scanning[NUM_PADS];
unsigned long scanStart[NUM_PADS];
void noteOn(byte channel, byte pitch, byte velocity) {
midiEventPacket_t event = {0x09, 0x90 | channel, pitch, velocity};
MidiUSB.sendMIDI(event);
MidiUSB.flush();
}
void setup() {
for (int i = 0; i < NUM_PADS; i++) {
peakValue[i] = 0;
lastHit[i] = 0;
scanning[i] = false;
}
}
void loop() {
for (int i = 0; i THRESHOLD && (now - lastHit[i]) > MASK_TIME) {
scanning[i] = true;
scanStart[i] = now;
peakValue[i] = val;
}
} else {
if (val > peakValue[i]) peakValue[i] = val;
if ((now - scanStart[i]) > SCAN_TIME) {
int velocity = map(peakValue[i], THRESHOLD, 1023, 1, 127);
velocity = constrain(velocity, 1, 127);
noteOn(9, padNotes[i], velocity); // Channel 10 (drums)
lastHit[i] = now;
scanning[i] = false;
peakValue[i] = 0;
}
}
}
}
The code implements a three-phase trigger algorithm: detect (signal crosses threshold), scan (find peak value within scan window), and mask (ignore signals for a dead time to prevent re-triggering from ringing). This is the standard approach used in commercial drum triggers and provides reliable, velocity-sensitive triggering.
Building a Drum Pad Controller
For a complete drum pad controller, build a 4×2 or 4×4 grid of trigger pads in a wooden or 3D-printed enclosure:
Frame construction: Cut a piece of 12mm MDF to your desired size (30cm x 15cm for a 4-pad layout is comfortable). Cut 4 circular recesses (slightly smaller than your piezo discs) using a Forstner drill bit. Alternatively, 3D print a frame with circular wells for each pad.
Pad assembly: Place the piezo disc face-up in each recess. Apply hot glue around the edges to secure it, leaving the centre free to flex. Cover each piezo with a 5mm EVA foam pad cut to size. The foam should sit slightly above the frame surface so your drumstick (or finger) contacts the foam first.
Electronics: Wire each piezo’s protection circuit on a small perfboard and mount it inside the enclosure. Run the analogue signals to the Arduino, which sits at the back of the enclosure with its USB port accessible.
Connect to your computer, open your DAW, load a drum kit plugin (like the free MT Power Drumkit), and map each pad to a drum sound. You now have a velocity-sensitive drum controller that responds to playing dynamics just like professional pads costing ₹10,000 and more.
Frequently Asked Questions
Can I use this with GarageBand or BandLab?
Yes, if using USB MIDI (Arduino Pro Micro with MIDIUSB library). The controller appears as a standard MIDI device compatible with any DAW or music app that supports MIDI input, including GarageBand, BandLab, FL Studio, Ableton Live, and Reaper.
How do I prevent cross-talk between pads?
Cross-talk (hitting one pad triggers adjacent pads) is caused by vibrations travelling through the frame. Mount each piezo on its own isolated foam pad rather than directly on a shared rigid frame. You can also add a software cross-talk suppression — when one pad triggers, temporarily raise the threshold of adjacent pads for 10ms.
Can piezo elements be used for hi-hat pedal sensing?
Yes. Mount a piezo under a pedal mechanism. For a continuous hi-hat controller, use the analogue reading to control CC#4 (foot controller) which most drum plugins interpret as hi-hat openness. A fully pressed pedal sends CC value 0 (closed), and fully open sends 127 (open).
How many pads can I have on one Arduino?
The Arduino Pro Micro has 9 analogue inputs, supporting 9 pads directly. With a CD4067 multiplexer, you can have 16 pads on a single analogue pin. The scanning speed is fast enough for real-time drumming even with 16 pads.
Conclusion
Piezo-based drum pads are one of the most satisfying Arduino projects for music enthusiasts. The combination of velocity sensitivity, low cost, and DAW integration creates a genuinely useful musical instrument. At under ₹1,000 in total components, an Arduino drum controller costs less than a single commercial drum pad while offering complete customisation of layout, sensitivity, and MIDI mapping.
The piezoelectric elements from Zbotic.in are perfect for this application — their 35mm diameter and high sensitivity make them responsive to even gentle finger taps. Start with a 4-pad prototype to learn the basics, then scale up to a full 8-pad or 16-pad controller as your drumming ambitions grow.
Browse our complete collection of audio and sound modules at Zbotic.in. All orders ship from India with tracking and warranty support.
Add comment