DIY Electronic Drumset for DrumMania

How I modded a joypad and Arduino to build a USB drum controller


A few years ago on a trip to Japan I got hooked onto a popular arcade game called DrumMania. Wanting to bring the game back home, I built my own electronic drum set. This drum controller can be used with any PC/Mac games that are USB joypad compatible (i.e. DTXMania).

RESEARCH

The game DTXMania can normally be played with a USB joypad, so I wanted to build a controller that received commands from a drum pad. So instead of pushing the joypad buttons, you hit a drum.

I primarily used two Instructables tutorials for guidance. I combined these instructions on making an Arduino drum and a DDR pad, plus a lot of googling to create my final product.

I was also new to soldering and watched videos to learn proper technique.

MATERIALS

4–6x piezos (depends on # of drum pads desired)
Mouse pads, old CD’s, colored foam sheets (base for drum pads)
Arduino + USB cable A to B
4–6x 1M Ohm resistors (same # as drum pads)
PCB (or breadboard), lots of wire
USB joypad (any cheap game controller will do)

Step 1: Piezo sandwich

Making a “piezo sandwich” with old mouse pads, CD’s, and colored foam

My piezos came with short wires, so the first step was to solder on longer wires (~50cm) to ensure adequate spacing between the drum pads.

Next I taped the piezos to a sturdy base. I used old CDs glued to mousepads for this. I topped off the “piezo sandwich” with colored foam pads.

FYI: You won’t need to hit exactly at the center of the piezo for the drum to trigger properly. Vibrations from the piezo’s surroundings (i.e. anywhere on the CD disc) can be picked up. That’s why it’s important to have adequate separation between drum pads so piezos aren’t triggered by neighboring vibrations.

Step 2: PCB/breadboard

Fitzing diagram modified from tutorial here. In my final drum controller, I added 2 additional drum pads/piezos with wires soldered to a PCB.
“Piezo sandwich” and Arduino wires soldered to PCB

After soldering piezos, it was time to connect everything to the Arduino. I followed the fitzing diagram above to connect resistors and wires to the PCB and Arduino.

I used a breadboard in my first prototype. This made it easy to move the wires and resistors around in case I needed to change anything. I eventually soldered everything to a PCB for stability.

Step 3: Wiring the Joypad controller

Anatomy of a dissected joypad. Red arrows indicate “solder points”.

The next step was to connect a new set of wires between the Arduino and joypad controller.

I unscrewed everything and opened up the controller. I read about the anatomy of a joypad to figure out how to correctly solder my wires to the board. The “solder point” is the node, or start of a circuit. I used the following nodes to solder my wires: 1, 2, 3, 4 (number buttons), start, and select. I also soldered an additional “ground” wire.

Final wiring of piezo sandwich, PCB, Arduino, and joypad controller

Step 4: Putting it all together

Final setup connected to DTXMania

The final step was programming the Arduino so it knew how to read piezo inputs and create outputs for the joypad controller. Below is the code, with great help thanks to my friend Sean Ye.

Note: make sure you “verify” and “upload” the code before running DTXMania. Also be sure to configure your new drum controller in-game appropriately!

//These are the digital pins that are connected to the game controller
int select = 2;
int start = 3;
int left = 4;
int up = 5;
int down = 6;
int right = 7;
//These are the analog pins that are connected to the piezos
int selecttrigger = 5;
int starttrigger = 4;
int lefttrigger = 3;
int righttrigger = 2;
int uptrigger = 1;
int downtrigger = 0; //(not used)
//These are the variables that store the analog values read from the piezos
int aselect;
int astart;
int aleft;
int aup;
int adown;
int aright;
void setup() {
Serial.begin(9600); //begin the Serial, when the arduino is connected, you can go to tools to see stuff written out
//Set the digital pins to output
pinMode(select, OUTPUT);
pinMode(start, OUTPUT);
pinMode(left, OUTPUT);
pinMode(up, OUTPUT);
pinMode(down, OUTPUT);
pinMode(right, OUTPUT);
}
void loop() {
//read all the analog pins and store them in the variables
aselect = analogRead(selecttrigger);
astart = analogRead(starttrigger);
aleft = analogRead(lefttrigger);
aup = analogRead(uptrigger);
adown = analogRead(downtrigger);
aright = analogRead(righttrigger);
//uncomment the below line to display whatever variable you want
//Serial.println(aup);
int delaytime = 30; //this variable is the time delayed between High and Low. Basically how long the button is being "pressed" for.
int analogvalue = 10; // the limit that determines if an analog value is pressed or not
if (aselect >= analogvalue) {
digitalWrite(select, HIGH);
delay(delaytime);
digitalWrite(select, LOW);
}
if (astart >= analogvalue) {
digitalWrite(start, HIGH);
delay(delaytime);
digitalWrite(start, LOW);
}
if (aleft >= analogvalue) {
digitalWrite(left, HIGH);
delay(delaytime);
digitalWrite(left, LOW);
}
if (aup >= analogvalue) {
digitalWrite(up, HIGH);
delay(delaytime);
digitalWrite(up, LOW);
}
if (adown >= analogvalue) {
digitalWrite(down, HIGH);
delay(delaytime);
digitalWrite(down, LOW);
}
if (aright >= analogvalue) {
digitalWrite(right, HIGH);
delay(delaytime);
digitalWrite(right, LOW);
}
}

Final demo:


Questions, comments, suggestions for improvement? Leave a comment below!