Projects / Piezo drum pad

Piezo drum pad

Beginner2.5 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Wire the piezo

    Brass to GND, ceramic to A0.

  2. NANO

    Add the bleed resistor

    1 megohm from A0 to GND.

  3. NANO

    Add the clamp diodes

    One each to GND and 5V, in the directions shown.

  4. NANO

    Wire the buzzer

    D8 and GND.

  5. NANO

    Upload the sketch

    Open the serial monitor.

  6. NANO

    Tap the disc

    Peak value and a note.

  7. NANO

    Tape it under foam

    Try soft and hard hits.

  8. NANO

    Tune the threshold

    Raise it if the pad triggers by itself.

In short

How do you build a piezo drum pad?

A piezo disc under a rubber pad detects hits and their strength, and a buzzer plays a longer, higher note for a harder hit. You need Arduino Nano, Piezo disc buzzer element, Resistor 1 MΩ, Signal Diode 1N4148 × 2, Passive buzzer, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points. It takes 8 steps and about 150 minutes.

Level
Beginner
Time
About 150 min
Parts
7

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Piezo disc brass side (outer disc)Nano GNDGround side of the sensor
Piezo disc ceramic side (centre)Nano A0Signal, voltage rises on a hit
1 megohm resistorBetween A0 and GNDBleeds the charge so the signal falls back
1N4148 diode 1Anode to GND, cathode to A0Clamps negative spikes
1N4148 diode 2Anode to A0, cathode to Nano 5VClamps spikes above 5 V
Passive buzzer positiveNano D8Tone output
Passive buzzer negativeNano GNDCommon ground

Code

A piezo disc is a thin ceramic layer on a brass plate that makes a voltage when it is squeezed or flexed, so a tap becomes a short voltage spike. That makes it a good hit sensor for a drum pad. The spike can be far larger than 5 volts if the disc is struck hard, so two small diodes clamp it: one stops the signal going below ground and one stops it going above the supply, which protects the analog input. A 1 megohm resistor across the disc lets the charge drain away so the signal falls back to zero after each hit. The sketch waits until the reading passes a small threshold, then watches the next three milliseconds to catch the highest value, which is the peak and tells you how hard the hit was. It maps that peak to a note and a length, so a soft tap gives a short low note and a hard hit gives a longer, higher one. A passive buzzer cannot change its volume, so pitch and length stand in for loudness. After each hit the sketch pauses for 60 milliseconds so the ringing does not trigger extra notes. Tape the disc under a piece of foam or rubber for a pad.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const int PAD = A0, BUZZ = 8;
const int THRESHOLD = 30;            // raw counts, 0 to 1023, ignore small vibrations
const unsigned long LOCKOUT_MS = 60; // ignore the ringing after a hit

void setup() {
  Serial.begin(9600);
  Serial.println("Hit the pad. Peak values print here.");
}

void loop() {
  int v = analogRead(PAD);
  if (v > THRESHOLD) {
    int peak = v;
    unsigned long t0 = micros();
    while (micros() - t0 < 3000) {            // watch the next 3 ms for the highest value
      v = analogRead(PAD);
      if (v > peak) peak = v;
    }
    int p = constrain(peak, THRESHOLD, 800);
    int freq = map(p, THRESHOLD, 800, 200, 1200);   // harder hit, higher note
    int dur  = map(p, THRESHOLD, 800, 40, 220);     // harder hit, longer note
    tone(BUZZ, freq, dur);
    Serial.print("Peak "); Serial.print(peak);
    Serial.print("  note "); Serial.print(freq);
    Serial.println(" Hz");
    delay(LOCKOUT_MS);
  }
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

Hit the pad. Peak values print here.
Peak 513  note 827 Hz

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Light tapPeak about 40 to 150, short low note
Hard hitPeak 500 or more, longer higher note
No contactNo readings
Clamp diode checkReadings never exceed 1023 or go odd on a hard hit
Hit twice quicklyTwo separate notes

If it does not work

Triggers by itself

Raise THRESHOLD or move the disc away from vibrating surfaces.

No readings

Check the brass goes to GND and the ceramic to A0.

Only low values

Press the disc harder against the surface or loosen the pad.

Extra notes after one hit

Increase LOCKOUT_MS.

Buzzer silent

Use a passive buzzer, polarity matters on some.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the piezo drum pad?

Arduino Nano, Piezo disc buzzer element, Resistor 1 MΩ, Signal Diode 1N4148 × 2, Passive buzzer, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points.

How long does the piezo drum pad take to build?

About 150 minutes for a beginner maker, in 8 steps.

How do I know the piezo drum pad works?

Light tap: Peak about 40 to 150, short low note. Hard hit: Peak 500 or more, longer higher note. No contact: No readings.

Triggers by itself: what should I check?

Raise THRESHOLD or move the disc away from vibrating surfaces.

No readings: what should I check?

Check the brass goes to GND and the ceramic to A0.

Only low values: what should I check?

Press the disc harder against the surface or loosen the pad.

Extra notes after one hit: what should I check?

Increase LOCKOUT_MS.