Build a compact electronic drum controller with an Arduino Leonardo, piezo triggers, and USB MIDI. The board illustration below documents the original layout. This revised guide adds setup checks for the USB MIDI path and an important protection note: a bare piezo can produce voltage spikes, so verify or add proper input conditioning before connecting sensors to the microcontroller.
Original project layout
The image is retained as a reference for the pad arrangement and wiring concept. It is not a substitute for checking the sensor input circuit.
Why use a Leonardo?
The Leonardo is based on the ATmega32u4, which has built-in USB communication. With suitable firmware and the MIDIUSB library, the board can present USB MIDI to a compatible computer. Native USB hardware alone does not create MIDI; the sketch must send the MIDI messages. An Uno can still send MIDI through other approaches, but it does not use this same direct USB-MIDI setup. See the Arduino Leonardo specifications and the MIDIUSB library.
Parts and sensor inputs
- Arduino Leonardo, Micro, or compatible ATmega32u4 board
- Up to eight piezo discs and suitable drum pads
- One sensor input circuit per pad, using a bleed resistor plus voltage-limiting protection designed for the board
- USB cable, mounting material, and an enclosure
Use eight analog-capable inputs supported by your exact board and list the selected pins in the sketch. Do not connect a bare piezo directly to an analog input: impact pulses can exceed the input limits, and a resistor across the disc alone does not clamp those peaks. Add series resistance and appropriate clamps or a proven trigger-input circuit, then confirm the signal stays within the microcontroller’s ratings.
Firmware setup
- Install the MIDIUSB library through the Arduino IDE Library Manager.
- Read each sensor and apply a threshold, peak capture, and a short retrigger lockout so one strike becomes one hit.
- Map each pad to a MIDI note and scale the measured peak to a velocity from 1 to 127.
- Send a matching note-off message after the hit so receiving software can release the note correctly.
- Upload the sketch and select the Leonardo as the MIDI input in a compatible DAW or MIDI monitor.
Calibration and troubleshooting
Test one pad first, then add the remaining sensors. Adjust trigger thresholds and velocity ranges for each pad. Raise the threshold or extend the lockout interval to reduce double hits; isolate the pad mounts with foam to limit cross-talk. If the computer does not list a MIDI input, check that the board and library match, the sketch compiles, and the USB cable supports data.
This is a DIY controller, so response depends on the sensor circuit, pad mechanics, and firmware settings. Confirm input protection before connecting the pads, and test at low strike force before regular playing.

Comments
Post a Comment