This project is a wireless trigger interface: a phone sends or receives simple drum-pad messages over Bluetooth, and a compatible app can use those messages to play sounds. A classic Arduino UNO R3 has no Bluetooth radio built in, so it needs a separate module.

How the setup works
For a simple demonstration, each switch-type pad connects an Arduino input to ground. The sketch detects a new press and sends a short text event such as snare or tom1 through a Bluetooth serial module. A phone app that supports the module's Bluetooth profile can map each word to a drum sound.
This text stream is not MIDI. Standard MIDI uses defined messages; Bluetooth MIDI uses a BLE MIDI service and compatible hardware/software. An HC-05-class classic Bluetooth serial module is not automatically a BLE-MIDI device. Check your phone, app and module documentation before choosing the connection method.
Parts and wiring for switch pads
- Arduino UNO R3 or compatible 5 V board; six normally-open buttons or switch contacts.
- Bluetooth serial module with its matching breakout board and documentation; a classic SPP module is intended for serial-data apps.
- Common ground between the Arduino, Bluetooth module and pads. With
INPUT_PULLUP, each switch connects its input pin to GND.
| Connection | Arduino UNO | Important note |
|---|---|---|
| Pad switches | D2 to D7, each to GND | One input per switch; internal pull-ups are enabled. |
| Module TXD | D8 (SoftwareSerial RX) | Check the module's logic-level requirements. |
| Module RXD | D9 (SoftwareSerial TX) | Use level shifting or a divider if the module RX is 3.3 V only; do not assume every breakout includes it. |
| Power and ground | As specified for your exact module | Module boards differ; never guess the supply voltage. |
Arduino example: transmit a press once
This sketch is for simple switch contacts only. A piezo drum trigger produces a changing voltage and needs a different protected analog input circuit; do not connect a piezo directly to a digital pin or copy this switch wiring for it.
#include <SoftwareSerial.h>
const byte PAD_COUNT = 6;
const byte padPins[PAD_COUNT] = {2, 3, 4, 5, 6, 7};
const char* padNames[PAD_COUNT] = {
"snare", "tom1", "tom2", "crash", "ride", "hihat"
};
SoftwareSerial BT(8, 9); // Arduino RX, TX
int rawState[PAD_COUNT];
int stableState[PAD_COUNT];
unsigned long changedAt[PAD_COUNT] = {0, 0, 0, 0, 0, 0};
const unsigned long debounceMs = 20;
void setup() {
Serial.begin(9600);
BT.begin(9600); // Match the module's data-mode baud rate
for (byte i = 0; i < PAD_COUNT; i++) {
pinMode(padPins[i], INPUT_PULLUP);
rawState[i] = digitalRead(padPins[i]);
stableState[i] = rawState[i];
}
}
void loop() {
unsigned long now = millis();
for (byte i = 0; i < PAD_COUNT; i++) {
int reading = digitalRead(padPins[i]);
if (reading != rawState[i]) {
rawState[i] = reading;
changedAt[i] = now;
}
if ((now - changedAt[i]) >= debounceMs && stableState[i] != rawState[i]) {
stableState[i] = rawState[i];
if (stableState[i] == LOW) {
BT.println(padNames[i]);
Serial.println(padNames[i]);
}
}
}
}Pairing and troubleshooting
- Upload the sketch with power disconnected from the external module if its wiring affects serial pins; then connect the documented Bluetooth pins and power the module safely.
- Pair from the phone's Bluetooth settings only when the module and phone support the same Bluetooth profile. Open a serial-terminal or drum app that can receive newline-terminated text.
- Press one switch and confirm the matching word appears once in the serial monitor or app. If it repeats, add debounce; if nothing arrives, check baud rate, RX/TX crossing, common ground, pairing state and the module's voltage limits.
- Keep wire leads short and secure. If you use piezo sensors or velocity-sensitive pads, use a proper trigger interface with input protection and an analog threshold instead.
For a professional MIDI instrument, use a board and transport that implement the MIDI connection type your phone or music software supports. The UNO R3 hardware reference lists its processor and interfaces; the MIDI Association explains the available MIDI transports.
References: Arduino UNO R3 hardware · MIDI connections
Comments
Post a Comment