Projects / Kids' drum pad toy

Kids' drum pad toy

Beginner2 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANOSANDIS

    Mount the piezo discs

    Stick each to the underside of a foam or card pad so a tap on top transfers vibration.

  2. NANO

    Add the resistors

    1 MΩ across each disc and 100 kΩ in series to the analog pin.

  3. NANODFPLAY

    Wire the DFPlayer

    TX to D10, RX to D11 through 1 kΩ, speaker to its SPK pins.

  4. NANODFPLAYSANDIS

    Load the sounds

    Copy four drum samples to the card with the names 0001.mp3 to 0004.mp3.

  5. NANO

    Upload and tap

    Each pad plays its sound. Adjust THRESHOLD to match how hard you tap.

  6. NANO

    Record

    Press the record button, play a pattern, press again to stop, press a third time to play it back.

  7. NANO

    Tune

    Change the lockout time for fast rolls.

In short

How do you build a kids' drum pad toy?

Four piezo pads play drum sounds through a speaker, with a record-and-play-back button. You need Arduino Nano, Piezo disc buzzer element × 4, Resistor 1 MΩ × 4, Resistor 100 kΩ × 4, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, SanDisk microSD card 32 GB (A1, Class 10), Tactile push button 6 mm, Resistor 1 kΩ and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 120 minutes.

Level
Beginner
Time
About 120 min
Parts
10

Parts list

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

Wiring

FromToWhy
Each piezo disc1 MΩ across it, then 100 kΩ in series to Nano A0 to A3Pad 1 to 4, the resistor bleeds the charge
Piezo other wireNano GNDCommon ground
DFPlayer VCC and GNDNano 5V and GNDSupply
DFPlayer TXNano D10Data to the Nano
DFPlayer RXNano D11 through 1 kΩData from the Nano
DFPlayer SPK_1 and SPK_2SpeakerSound
microSD cardDFPlayer slotFiles 0001.mp3 to 0004.mp3 as drum sounds
Record buttonNano D7 and GNDRecord, then play back

Code

Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "DFRobotDFPlayerMini". Put the four drum samples on a FAT32 microSD as 0001.mp3 to 0004.mp3, in the order of the pads. Piezo discs can produce spikes much higher than 5 V on a hard hit, so the 100 kΩ series resistors protect the analog inputs, and the 1 MΩ resistors drain them. Small taps are fine, but do not hit the discs with hard objects.

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).

#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

SoftwareSerial ss(10, 11);                              // RX, TX
DFRobotDFPlayerMini dfp;
const byte PAD[4] = {A0, A1, A2, A3};
const byte REC = 7;
const int THRESHOLD = 120;
unsigned long lastHit[4] = {0, 0, 0, 0};
struct Hit { byte pad; unsigned long t; };
Hit tape[64];
byte tapeLen = 0;
bool recording = false;
unsigned long recStart = 0;

void setup() {
  pinMode(REC, INPUT_PULLUP);
  ss.begin(9600);
  dfp.begin(ss);
  dfp.volume(22);
}

void playPad(byte p) { dfp.play(p + 1); }

void loop() {
  for (byte p = 0; p < 4; p++) {
    if (analogRead(PAD[p]) > THRESHOLD && millis() - lastHit[p] > 150) {      // a hit, with a lockout
      lastHit[p] = millis();
      playPad(p);
      if (recording && tapeLen < 64) { tape[tapeLen++] = {p, millis() - recStart}; }
    }
  }
  if (digitalRead(REC) == LOW) {
    delay(250);
    if (!recording && tapeLen == 0) { recording = true; recStart = millis(); }             // first press: record
    else if (recording) { recording = false; }                                             // second press: stop
    else {                                                                                 // third press: play back
      unsigned long start = millis();
      for (byte i = 0; i < tapeLen; i++) { while (millis() - start < tape[i].t) {} playPad(tape[i].pad); }
      tapeLen = 0;                                                                         // clear for a new take
    }
  }
}

Test checklist

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

CheckExpected
Tap pad 1Plays 0001.mp3
Hit each padFour different sounds
Record then play backThe pattern repeats with its timing
Light tapRegisters above the threshold

If it does not work

No sound

The SD card is not FAT32 or the files are named wrongly. Check the DFPlayer's LED.

Double triggers

Raise the lockout time or the threshold.

Pads trigger each other

Mount each pad separately so vibration does not carry.

Buzzing speaker

Power from a good supply and keep the speaker lead short.

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

Ask Lark AI

Common questions

What parts do I need for the kids' drum pad toy?

Arduino Nano, Piezo disc buzzer element × 4, Resistor 1 MΩ × 4, Resistor 100 kΩ × 4, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, SanDisk microSD card 32 GB (A1, Class 10), Tactile push button 6 mm, Resistor 1 kΩ and Jumper wires male to male (40 pcs, 20 cm).

How long does the kids' drum pad toy take to build?

About 120 minutes for a beginner maker, in 7 steps.

How do I know the kids' drum pad toy works?

Tap pad 1: Plays 0001.mp3. Hit each pad: Four different sounds. Record then play back: The pattern repeats with its timing.

No sound: what should I check?

The SD card is not FAT32 or the files are named wrongly. Check the DFPlayer's LED.

Double triggers: what should I check?

Raise the lockout time or the threshold.

Pads trigger each other: what should I check?

Mount each pad separately so vibration does not carry.

Buzzing speaker: what should I check?

Power from a good supply and keep the speaker lead short.