Let's Make Robots!

The Revenge of the Yellow(Arduino) Drum Machine

plays a funky beat on surfaces

I am working on an Arduino powered Yellow Drum Machine. I have all of the physical parts functional. Now I am working on the code. I have just completed translating all of Frits's songs to the format I need. Now I just need to coordinate the control structure to allow it to autonomously move around, make decisions, and to play its little heart out. More later...


I needed to have a larger base to attach the solenoids to.  The gray material is a scrap plastic I got from ordering polystyrene for vacuum-forming.  I don't know what type it is, but it it fairly brittle.  I cut it out using a jig saw









Here it is attached to the base with self-tapping screws. 

.This is a closeup of the oid connection to the hihat drum stick.

        This is the robot base I used.  It can be found be searching for      "Six leg walking type gearbox kit Elenco 21-13".


I don't know how specific anyone wants me to get.  I killed two of the Radio Shack sound recorders.  I'm not sure what happened.  They worked for a while, and then the playback just died.  So I ended up using this Sparkfun recorder/playback breakout board.  It is working fine as of now.

I tried the Sparkfun sound sensor, but couldn't get it to work.  I read a post that this sensor was very good, so I built it from scratch.  It works great!  

My little drum machine uses the PING))) and a CDS photocell and the sound sensor to react to the environment.  It chooses songs based on the data it has collected about its surroundings.  The gearbox base gives it a fun movement - it kind of wobbles and drifts as it moves.  The gearbox also has little legs you can use instead of the disk wheels.  I have programmed in several behaviors.  I used a timer library to call random behaviors every 10 seconds.  30% of the time it will search out an object and then beat a funky beat.

I will continue to work on the code.  I would like to use the piezo speaker to play little melodies as it moves around its environment.  I think that's it unless anyone is interested in more specifics.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks.  That was Frits's original idea.  The metal on a wine bottle does sound very cool.

I love how the Ping head gets used as a drumstick!


Hello Frits,

I am adapting your code to the Arduino.  So far I have most of the elements working.  However, I can not figure out how the SHFL variable is returned to 0.  I can see that the shuffle delay only happens when SHFL =0, but SHFL is incremented by one (SHFL = SHFL+1) before the "if" statement.  And I can not find out how SHFL returns to 0 or possibly a negative number.


I am amazed by your robot and your ideas for drumming.  I am using solenoids to move the sticks.  I would love to share some photos of my robot if you are interested.





Hey Charles, 

Fantastic :) 

Charles question first: The variable "SHFL" is a single bit. And so, if you increase it more than the value 1, you overflow it, and it turns zero. Ugly coding is my middle name ;)


I am a self-taught robot builder.  Here are some of the projects I have done:


This is a BEAM circuit.  I used the little Solarbotics pager geared motors and took off the spring and cut the piece that prevented full rotation:



This is a Halloween costume I created using servos and an Arduino:



And a biped I scratch built:



And an 8 legged walker:



I just uploaded a video of my Drum Machine to YouTube:  http://youtu.be/PDIl2oeA2FE

I still need to add the sound recorder/playback and complete the code, but all of the components are working.


I also have this page with some photos of my early robots.  I have been neglectful of adding new information.  I am currently also working on a robot that uses a netbook and a vision system to identify a colored object and drive up to and touch it.  It uses a compass for navigation.  It also uses a sound board to speak.


I just re-worked a hexapod that I scratch built and hacked an old Nintendo Power Glove as a controller.  It uses xbee units to communicate.  The hexapod has five different gaits all based on insect walking motions.


I am sure that my code is pretty funky.  I took a couple of simple BASIC programming classes back in the early 1980s.  However, I can get most things to work the way I want them to.  


I recently had an article published in SERVO magazine about using a horse syringe and a balloon and coffee grounds to make a "universal gripper."  You can read some of the article here:



I think that's about it.  I am very interested in working with you two on the drum machine; it sounds like fun.



You have made 3 "milestones" in my book - so I know you are good:


A) Conversion to Arduino. Only one other person (TheCowGod) have I

seen do this (Though I think he just wrote his own code)


B) Fixed the Pager-moter-issue; These are extremely costly. Solenoids

sounds cheaper!! (Though a lot of cobber and funky magnetic



C) Your robot is actually funky!



I have a been compressing my video into 15 fps.  But here's a full quality version of my little drummer so far:



Let's keep in contact.




Wehee!! Thanks! I think you want the sticks to be approx 60% of the

current length. Much faster, more precise.







So Sad!  They look so cool long.  But I will try what you suggest.  It will probably improve the drumming!  Thanks



You know, I've never registered at Let's Make Robots.  I guess it's time.  I was thinking of creating an Instructable detailing the steps. 


 I finally found some time to transfer all of the song data.  Now I have to code the control structure to select songs to play.  It looks like that the aaaa:  and other areas choose which song to play.  They use a "random" number, but it looks like the number is just incremented in a different part of the code.  So that aaaa: plays song 1 then the next time song 2 and so  on till it is reset back to the first song. 


Would it work just to have a totally random song selected?  Or it could make sure that it didn't repeat a song it just played but select a different song.  Would that work with your plan?  Does it matter?





I wrote this code in many versions. But I think I always worked from this principle: although the result in reality is random: first the robot is "getting inspired" from the surroundings, and then it plays.

Other versions did more for this, but they had other downsides. Challenge is always memory, which I like, it keeps a virtual border around creativity.

As I remember it, the version you have is more or less a random remix of some tracks, so if you have no feeling for the principle of the robot "being inspired", just make it random. :)


I am thinking of adding a CDS photocell sensor to the robot.  That way I could use that data to have it choose which songs to play, based on the amount of light in the area.



Hey, cool robot you have.. Its already making some kind of music. nice! are you using solenoids or DC motors for the drumsticks?

I just added a photo closeup of the solenoid attachment to the hihat stick.  I have some auto door locker solenoids that I picked up cheap in about 1990!  I have found some cheap ones from AllElectronics, but I haven't tested them.  I have the Arduino triggering the solenoids through a TIP 120 transistor.  I will write more specific info later when I have more time.