Home > Making Stuff > Robot playing Rockband on the iPhone

Robot playing Rockband on the iPhone

October 29th, 2009 Leave a comment Go to comments

Rock Band has been released on the iPhone, and even though its a lot of fun, I would rather have something play it for me. Preferably a robot!

The setup is pretty much the same as the other robots that play these kinds of games.

the setup

the setup

Light sensors are used to read the falling notes, I’m using ambient light sensors from Sparkfun.  They are small and easy to setup. (The iphone brightness has to be set to Max)

The light sensor sends data to an Arduino, which is waiting for a spike in the data. This means something bright has passed in front of the sensor.  I’m using an Arduino Mega, which is overkill for this project, but it does look really cool with those WingShields on it.

Under belly of the beast

Under belly of the beast

The Arduino runs the sensor data through some averaging filters, and sets a threshold for on and off.  This could also be done through hardware, look up Hysteresis and Schmitt trigger.  If the sensor data becomes higher than the on threshold, the Arduino reads that as a note, and tells the servo to push the screen.  The servo will not release its touch of the screen until the sensor data drops below the off threshold.  The on and off threshold have some distance between each other to deal with bouncy noise.

Servos acting like little fingers

Servos acting like little fingers

The iPhone touch screen isn’t like most PDAs.  It uses a capacitive touch screen.  More info about that HERE.  It would seem that the iPhone is looking for a finger sized touch, from living flesh.  According to the link, the screen actually looks for changes in electrical current.

I had some conductive foam laying around, its usually used for shipping sensitive electronics.  If I put my finger behind the foam and pressed on the iphone screen, it works.  If I used something non conductive, like a plastic pen, the foam would do nothing to the screen.  My solution to this was to put thin copper wires into the foam (I also used these wires to attach the foam to the servos) the other end of the wires were wrapped around the handle of an exacto knife.  When the Robot is playing the game I touch the handle of the exacto and the robot fingers are able to press the screen.  Another solution was to run all the wires into the Arduinos ground pin, but it had mixed results (not all wires were making contact)

Insert iPhone into robots pelican grips

Insert iPhone into robots pelican grips

Add all of the above together into a modified Pelican case, with a lot of hot glue (non glittery) and you have a robot that will gladly beat all your difficult songs, sit back and sip some fine tea.

The performance of this robot increases with the correct positioning of the servos, and the distance you set them to move in the code.  You may notice in my video that the right most servo had a hard time hitting its notes, it’s been glued too far south of the note position, something I may correct later.  I think it would be cool to package all of this together as a portable unit, with an Mini Arduino running the show.

Here is the code I made for the Arduino, it’s a modified version of my other project.  If you want to make your own, you will have to tweak the sensor threshold and servo settings to fit your setup.


Update – This weekend I saw this project posted on several gadget blogs

Thanks for visiting!

Categories: Making Stuff Tags: , , ,
  1. October 31st, 2009 at 02:40 | #1

    Love the simulated finger design!

  2. Dylan
    October 31st, 2009 at 19:48 | #2

    How about doing away with the servos- put pieces of foam over the notes with wires coming out of it, and use relays/transistors or whatnot to ground them. I’d imagine it’d be a bit finnicky, and not as cool looking though.

  3. November 1st, 2009 at 20:42 | #3

    That’s an interesting idea!

  4. November 2nd, 2009 at 15:03 | #4

    Really really interesting. Way to go!!!

  5. November 4th, 2009 at 06:50 | #5

    Very cool! Congratulations!
    It seems that you need to better regulate the blue is not it?

  6. December 3rd, 2009 at 02:33 | #6

    Amazing! I wonder if it would be possible to use static pads and slightly charge each pad to get a “press” to register. I want to build a button-based controller for “EDGE” (er, now “EDGY”?) by Mobigame, and interfacing with the screen buttons seems easier than trying to build a rotating rig.

  1. November 1st, 2009 at 14:42 | #1
  2. November 1st, 2009 at 15:35 | #2
  3. November 1st, 2009 at 16:07 | #3
What is 14 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)