DIY MIDI Drum Kit Using an ESP32 (Works With MIDI Player and Clone Hero)
by JuicyJuice in Circuits > Microcontrollers
1452 Views, 8 Favorites, 0 Comments
DIY MIDI Drum Kit Using an ESP32 (Works With MIDI Player and Clone Hero)
(Embedded video may be unavailable, but it works on Youtube, linked here.)
Inspired and adapted from the Instructables guide by Hyoobaloinz found here.
Introduction
I was interested in getting an electronic drum kit for the first time, but I saw that many of the cheaper new kits came in around $350-$400 for a reliable brand. Buying used kits is a good option, but I wasn’t sure what I was looking for in a drum set. I needed a customizable way to learn what I liked and what was comfortable. To get an introduction to it, I wanted to create a DIY drum kit that could output MIDI information to the computer and be read by a MIDI drum player or the game Clone Hero. I am fairly happy with the result, though there are some features that could be changed/adapted to improve the product. I would recommend taking parts from this guide as you like and adding in your own features and designs that you think would improve or save money on the process.
In total, this project cost me around $250, though there are some possible ways to reduce this price that will be discussed throughout depending on what tools you have available.
Supplies
Here are a list of supplies and price estimates for this project. Most of them are either from Home Depot or Amazon:
- 1.5-in x 10-ft PVC Pipe: 2 x $10 - $20
- 1.5-in 90° PVC S (socket) x S (socket) Elbow: 5 x $3.75 - $18.75
- 1.5-in 45° PVC S x S Elbow: 2 x $2.50 - $5
- 1.5-in PVC S x S x S Tee: 2 x $3.50 - $7
- 1.5-in PVC S x S x S 4-way Tee: Pack of 4 - $19
- 1.5-in PVC Socket Cap: 3 x $1.75 - $5.25
- #10 5/8-in Wood Screws: Pack of 12 - $1.50
- 1/4-in 20 TPI Hex Nuts: Pack of 10 - $1.50
- 1/4-in 20 TPI Wing Nuts: Pack of 4 - $1.50
- 1/4-in Flat Washers: Pack of 12 - $1.50
- 1/4-in 20 TPI Eye Bolt 3-in: 2 x Pack of 2 ($1.50) - $3 (I forgot exactly which ones I used, but these should work)
- Scotch Mount Tape Extreme: $8
- 12" x 4' Con-Tact Cork Shelf Liner: $10
- 10-in Wood Circles 1/2-in Thick: Pack of 5 - $30
- Pipe Bracket Clamp for Outer Diameter 50mm: Pack of 10 - $20
- Piezoelectric Sensor Module with Analog & Digital Output: 2 x Pack of 4 ($8) - $16 (These may work as well but I have not tested them)
- NO NC Foot Pedal Switch: Pack of 2 - $12
- Frisbee Golf Discs: Pack of 3 - $20
- Protoboard: Pack of 5 - $8.50
- Any Kind of Breadboard Wires: ~$7
- Small Command Stickers: $4
- LILYGO ESP32 T-Display: $20
- 40 Pin Male Header Strips: Pack of 10 - $5
- 10k Ohm Resistor: Very cheap (may want to buy a set for other electronic projects if you don't already have some)
Estimated Total: $244.50
Tools already owned: Drill and drill bits, soldering iron and solder, shrink tubing, wire strippers, flush cutter, PVC pipe cutter
Some of these packs have more materials than needed so if you can find cheaper products feel free to use them.
Structure
The structure is made out of 1.5-in PVC pipes and attachments. I initially started out simple with just one line connected across. However, the pads would pick up hits from other pads too often. To fix this, I cut a gap in between the two middle pads and attached each side lower on the pipe. I put a foam tube in between the cut pipes to make it look a little cleaner. Also, I tried to make the design more ergonomic by angling the outside pads inside more so I wouldn't have to reach as far. Everything stays fairly securely and doesn't need glue if you push the attachments on hard enough. The Crafty Amigo website was helpful in visualizing the structure before buying all of the parts. The link to the general design of my final product can be found here, although the pipe lengths will differ. There may be ways to simplify the design that could greatly reduce the price, as I currently have many different attachments.
Pads
I did not have as much woodworking experience as seen in the guide referenced at the top of this article, but if you do I would recommend following Hyoobaloinz's steps for this as the mesh pads would provide a more accurate representation. However, I tried to model it after the practice pads shown above with a wood base and some padding on top.
- Find the center of the wood circles and screw in the metal pipe clamps. There were some issues with the sensors picking up unwanted vibrations initially, so I added a layer of cork between the metal and the wood as well as inside the clamp.
- Cut a cork circle and place it on the wood to dampen the sound and vibrations.
- Attach the sensor with a command sticker and the board using a square of Scotch mounting tape.
- Screw in the clamps to the PVC pipes.
There are other piezo sensors without the casing and processing board, but I thought these could be more robust and accurate. However, the wires are still very small and fragile, so be careful attaching them. I had to open up some of the casings and resolder them back on.
Cymbals
The cymbals attach to each of the PVC caps through a contraption of bolts, nuts, and washers. I initially had only one nut below the cymbal, but it would loosen from the hits over time, so another nut was added below it to create more friction and prevent this.
- Drill a 1/4-in hole in the middle of the cap.
- Place a nut and washer near the last thread of the bolt and put it through the drilled hole.
- Add another washer and nut. Tighten it to secure it to the cap.
- Add two nuts near the top of the bolt. Turn two wrenches in opposite directions to tighten them against each other. Place one washer on top of them.
- Drill a 1/4-in hole (or a little smaller) in the middle of the disc and place it on the washer.
- Add one more washer and wing nut on top of the disc and tighten it down.
Hardware
The microcontroller can be switched out for many other options, I just chose this one because I had it left over from previous schoolwork. Make sure the replacement has enough ADC pins for all the sensors. Since this ESP32 does not have native USB-MIDI support, you will need to download extra software, discussed later. There are other microcontrollers that should support this, such as Teensy 4.1 or newer ESP32-S2 or -S3 boards, but I have not tested it out on them.
- The first step was to solder all of the header pins and the microcontroller onto the board. I added a very small metal wire between the power and ground on each side and soldered those on as well to connect them
- Connect the foot pedal next. You will have to cut back the grey casing and strip back the wires. The red wire corresponds to normally open (NO), black is normally closed (NC), and white is common (C). I also cut some male wires and soldered them onto the red and white wires so they could be more easily attached to the board. I covered those individual wires in shrink tubing, along with all three of them together. I finally soldered the red and white wires to the board with a 10K ohm resistor connected to power in parallel with the red wire. Two male-female wires are soldered in parallel with the red and white wires and connected to a GPIO and ground header, respectively.
- Daisy chain the wires to be able to connect the ground, power, and analog output of the sensors to the board.
- Connect the ground and 3.3V pins of the microcontroller to the board
- Attach a metal clamp, the same one for the pads, to a block of wood the same way as before. Use the Scotch mounting tape to stick the board on top of the wood block. You may have to trim the headers back with some flush cutters to be able to stick it down cleanly. Screw in the clamp to the middle pipe.
Software
After all of the components are setup, the microcontroller needs to be able to interface with the software. For my ESP32, I connected it to my computer with a USB-C cable and used the Arduino IDE to upload the program. The code can be found below. There are many variables to adjust to tune the responsiveness of the sensors, such as the debounce time, vibration threshold, and max values. The pins would need to be changed depending on how you wire everything up to the microcontroller. You will also have to install the MIDI Library made by Francois Best and Lathoub on the Arduino IDE for the code to work (I used v5.0.2). If your microcontroller does not have native USB-MIDI support, like mine, you'll need to convert the serial output into a readable MIDI signal. On Windows 10, I was able to use Hairless MIDI to convert the serial values and loopMIDI to make a port that other apps could read from. Make sure the Hairless MIDI settings are set to the same Baud rate as the microcontroller and that no other serial monitors are open while using it. I was able to get the drums working for BFD player as well as Clone Hero. The MIDI notes in the code are what I found to correspond to the notes in BFD player.
Downloads
Reflection
This kit performs very well as a beginner's introduction into drumming, but there still are some problems and improvements that could be made.
- Occasional cross-talk/unresponsiveness between the notes - Depending on how you hit each pad/cymbal, other sensors may pick it up. For example, if you hit the wood instead of the cork on the pad, the vibrations will carry and multiple notes will register the same hit. Also, the sensors may not pick up hits that occur along the PVC pipe as intensely, since the vibrations would be absorbed more by the pipe rather than the wood that the sensor is on. One possible solution would be to find another way of attaching the pads to the pipe. Separating the connections between each note is very important, and I think Hyoobaloinz's project does this very well.
- PVC structure stability - The structure holds up pretty well, but it could be more secure at the base. I think adding more elbows at the feet and putting another PVC pipe across the front and back would make it hold up very well.
- Foot pedal comfort - The current foot pedal is fairly cheap and a little uncomfortable. I had to add a wood plank in front of it to be able to rest my foot over it in a more pleasant position. I may get a different switch in the future.
- Wires hanging down - Currently, the wires are just hanging from the sensor to the board. Eventually, I would like to secure them to the structure with some electrical tape to make it a little cleaner.
I hope this helped give you some information to create your own drum kit. Let me know if anything is off or needs more explaining!