Introduction: Simple Arduino Drum Robot
I'll admit. I made this project out of sheer boredom after being stuck inside for a few days during a series of small but problematic snowstorms. Looking at my arduino, a few servos, and some tape, the basic idea for a crappy drum robot started to come to fruition. Turns out, if you have all the right stuff, this is a project that can be completed in about 15 minutes with practically no experience required.
If you are just getting started or are looking to brush up your arduino skills, this might be a good place to begin. Let's get started.
Step 1: Materials and Tools
- Arduino Uno (although nearly any board should work)
- (2) positional rotation servo motors
- solderless breadboard
- breadboard wires (at least a dozen)
- a flat chunk of wood
- (2) pop-sickle sticks, dowel rods, pencils, or other suitable drumstick alternatives
- a rubber pad, coffee can lid, or other drum head alternative
- a laptop with a recent version of the Arduino IDE installed
- a USB programming cable that connects to the arduino
- hot glue gun (or just get creative with the tape)
- 15 minutes under ideal conditions. Maybe an hour if things don't work right the first time.
Step 2: Wiring
Let's start by wiring a few things together.
Each servo motors have three connections: one for power, a second for ground, and a third for data (or something like that). The positive is always red, ground is usually brown or black, and data orange or white. Using a breadboard or the arduino header pins, connect up the arduino's power and ground to each motor. Connect one motor's data wire to pin 5 and the other motor's data wire to pin 6. Make sure both pins support PWM. And.... that's it! That wasn't too hard.
Step 3: Build the Thing
Now we have to build the frame
You may want to use your imagination for this part. I built this on a flat chunk of wood, but a flat chunk of cardboard would work just as well. Anything flat, strong, and easy to work with will serve as a good base.
To hold the motors in place, I chopped off two bits of wood from a paint stir stick - the kind you can get for free when buying a can of pain from the hardware store. I have found that these stir sticks are remarkably versatile. One of these days I'm going to post a project made entirely of paint stir sticks. Anyway, you'll need to hot glue these bits down so that they don't go anywhere.
Next, we will make the drumsticks. I cut two 5 inch lengths of 1/4 inch dowel rods, though something like popsickle sticks would work just as well. Tape or glue those to the servo horns.
If you haven't already, tape the motors to paint stick bits or whatever you are using to hold them in place.
That's it! Time for some code...
Step 4: Install the Code
Once everything is ready to go, it's time to install some code. This is the part where you'll need the Arduino IDE and a USB programming cable.
You can write your own if you would like, or you can just use mine. There are tons of side notes and instructions in the code, don't worry.
If you plan on writing your own code, it might be a good idea to learn how to use the servo commands, as they can get a little tricky. Also remember that servo motors take time to move from one position to the next. This time must be accounted for in the code, especially when writing a time-sensitive program. You wouldn't want your drum bot to be off beat.
Step 5: Going Further
Congrats! You've just assembled a functioning drum robot. Tired of its relentless tapping yet? No? Well you will be soon. So what could we do to make this a little more interesting?
For starters, I could have written some better code that improvised rhythms or could play triplets rather than endless quarter and eighth note loops.
Arduino also has a tone(Hz,duration) function that allows it to play sound through a PWM pin. Using a table of note frequencies (see above) and some creative programming, the Arduino could play a melody while laying down some sick beats.
If any of you make this project, please let me know! I would love to see it.
If you enjoyed this, be sure to subscribe to my youtube channel where I publish other science and technology related projects. Most recently I have been working on some rocketry stuff, so keep an eye out for that.
That's all for this project! Now go make something