Step #1: Introducing the drum pad input device and gamePrevNext
- The drum pad is used to input "beats" into the Arduino system. The Arduino is able to read the beats from from the drum pad through the piezo sensor.
- The object of the Processing game is to get as many "beats" as possible in a 5-second time frame. Currently 33 beats is my high score!
Step #3: Attaching the piezo sensorPrevNext
- Solder two wires to the two discs of the piezo sensor (as shown in the first image).
- Make sure that the solder joint on the outer disk of the sensor does not touch the inner disk of the sensor.
- Tape the piezo sensor to the CD or DVD with the solder joints facing up (see second image). Make sure that you center the piezo sensor accordingly.
Step #4: Putting your drum pad head together.PrevNext
- Glue the CD or DVD onto the mousepad with regular white (Elmer's) glue.
- Use a few heavy books to keep pressure on the mousepad while it dries.
- Let sit for at least 10 to 20 minutes.
Step #5: Creating the drum pad basePrevNext
- Trace the CD or DVD onto the packing foam just as we did with the mousepad.
- Cut out the foam along your traced line.
- Now you should have a circular piece of packing foam that will serve as the base for the drum pad head.
Step #6: Putting the whole thing togetherPrevNext
- Glue the cut-out packing foam to the CD or DVD with white glue.
- Put some books on top of the drum pad again and wait.
- Allow 10 - 30 minutes of drying time.
- While waiting, you can go ahead and start creating the circuit (see next step).
Step #7: Building the circuit on a breadboardPrevNext
- Insert the piezo sensor leads into the breadboard.
- Depending on the wire you used to connect the sensor, you might need to tin the wire or solder it to a male .100" header.
- Connect the Arduino to your computer.
- Open the Arduino IDE and note your serial port for the Arduino.
- Paste in the code from the Arduino sketch attached to the "Files" section of this project and upload it to the Arduino.
- You can also download the Arduino code here.
Step #8: Open the Processing sketch (Drum Game)PrevNext
- Change the SPORT varible in the sketch to match your Arduino's serial port (which you noted in the previous step).
- In OSX it will look like /dev/cu.usbxxx
- In Linux is will be something like /dev/sttyUSB0
- In Windows it will be something like COM3
- You can download the Processing sketch and Arduino firmware here.
Step #9: Play the game!PrevNext
- Run the Processing sketch to start the game. Make sure you have closed the Arduino IDE. From here, once you start the game you need to click anywhere on the screen to begin. After clicking, you will have 5 seconds to hit the drum pad to register as many "beats" as possible. That's it! However, there is much room for improvement.
- There are a few deliberate shortcomings included in the Processing sketch as well as the Arduino firmware. For example...
- I included a rocket ship in the Processing sketch. Perhaps, you could extend this sketch by making the ship "blast off" if you got a high enough score?
- You could change the Arduino code so that the Arduino will read the force of the tap and then use that as a multiplier for the total score.