For our media controller project, Hana, Ania, and I decided to build a musical instrument that would control a series of unexpected sounds. We'd take a conventional instrument and augment its normal sound-creation mechanism so that it accompanied itself when played. The result was the Multixylophoniomnibus:
We started by brainstorming instruments that would make a good platform for sensors. Pretty quickly we came to the idea of a xylophone or glockenspiel. We figured that since the xylophone's keys would be metal, we'd be able to make them into switches that would be closed when they got hit with the mallet. We also started thinking about sounds. Our initial ideas spanned from the simple — shaking a maraca — to the extremely complex — using a fan to blow a whistle.
We made up a shopping list and hit the stores. We came back with a toy xylophone (really a glockenspiel, technically) and a bunch of noise-making supplies: beads, glasses, jars, hand cymbals, ceramic cups, chains, etc. We also picked up some electronic supplies from Radio Shack, most importantly, pager motors for vibrating all of this noise making stuff.
Once we had our supplies, we decided to a do a test of our triggering mechanism. We wrapped the wooden xylophone mallet in tin foil to make it conductive and attempted to use it to complete a switch with the xylophone keys. Unfortunately, as we quickly discovered, the keys were painted with some kind of plastic or otherwise non-conductive paint. So, while they were beautiful primary colors, they didn't work at all as switches.
We overcame this obstacle by wrapping one of the xylophone keys with tinfoil to create a conductive pad for the mallet to hit. With this setup in place, we were able to do a basic test where hitting a key triggered a pager motor we directly wired up to one of the Arduino's digital output pins.
However, we were not very satisfied with this approach. The tinfoil distorted the sound of the xylophone keys and its appearance marred its clean primary color look. Thankfully, ITP resident and all-around good guy, Chris Cerrito, happened to walk by and made a suggestion that would dramatically change the arc of our project. Chris suggested that we use piezos to sense the impact on the xylophone keys.
Piezos are small crystals that induce electricity into a circuit when they get squeezed or vibrate when they have electricity run through them. This second facility is commonly used in those annoying little buzzer alarms, but the first one makes them perfect for sensing percussive impact — "knock sensing".
At first, we tried experimenting with an actual buzzer still in its Radio Shack-fresh case:
We wired it up as a normal analog sensor and connected it to the Arduino and started knocking things. While we saw some signal coming into the Arduino it was nearly random.
Upon consulting Chris, he recommended removing the plastic casing. We did this only to discover that our buzzer had some kind of strange three-wire piezo inside it with a control circuit. Chris responded to this by giving us a bag of spare piezo elements he had handy.
These piezo elements are small discs with a center area of copper-colored material and a rim of silver metal. In order to hook them up, you have to solder one lead to the center area and one to the rim.
The arrival of these peizo elements lead to nearly a week of frustrating failed experiments and much electronic learning for our group. I intend on writing up all of what we learned about piezos in a separate post so that it can be useful to others. Suffice it to say, for now, that to use a piezo with an Arduino you have to filter its output voltage so that it doesn't hurt your Arduino's input pin and you have to use a big resistor to dampen the oscillations of the signal so that you can read it as either on or off with a threshold.
Here's a video of one piezo attached to just the green xylophone key, right after our first successful test. If you watch closely, you can see the Arduino's onboard LED light up every time I play the green key.
In parallel with this process of getting the sensors working, we did a few experiments with our sounds, starting with just hooking up a pager motor directly to power to hear it vibrate beads in a glass:
Once we'd figured out how to use the piezos as effective knock sensors, we wired up five more of them and temporarily attached them to the underside of the middle six xylophone keys with double-sided tape.
This let us start to experiment with controlling multiple different outputs simultaneously from different keys. We wired up two pager motors, a dc motor, and a servo.
Our code and circuit were both starting to get complex at this point as they had to deal with the different control requirements of the motors and the servo. We decided to feed both the pager motors and the dc motors from a common power supply (a 9v battery) just to keep things simple even though that was likely too much juice for the pagers. The servo, of course, had to have a completely different part of the circuit to itself (no need for 9v) and a different code path within the Arduino program (rather than just getting a simple digitalWrite to trigger the TIP-120 transistor for the motors, the servo needed the full Servo library treatment, complete with delay [see the complete and final code at the bottom of this post for details]).
Once we had all the sound mechanisms working, we started thinking about the housing that would contain the entire project. We really wanted the technology to disappear behind the simple, childlike, primary color aesthetic defined by the xylophone itself.
We set down some cardboard and began sketching out a prototype. With her industrial design experience and magical ability to make clean, proportional, well-laid out objects, Ania took the lead on this part of the process. We made a cardboard prototype of the base, measuring, arranging, and cutting holes
In addition to telling us the specific dimensions we needed for construction, one of the best unexpected things that came out of this prototyping process was Ania's impromptu decision to add a stand for the xylophone mallets. This was a totally unnecessary but utterly thoughtful and charming bit of the design and ended up as one of my favorite elements in the final project.
While we were putting together the cardboard prototype, we also built cardboard boxes that would hold the actual sound-making equipment on the underside of the base. For example, here's the first draft of the setup for a solenoid playing two finger cymbals:
Since these boxes were intended to end up invisible on the inside of the base, they didn't need to be fabricated in wood or anything fancy and we used these cardboard versions in the final project (though the various mechanisms inside turned out to need different mounting strategies as we proceeded with them).
After the prototype was done, Ania and I walked up to the Home Depo and bought the wood we'd need to build the base. We also picked out some peg board to use as enclosures to cover the tops of the sounds, figuring the holes would let the sound be heard, but the board would still conceal the actual mechanism. We also grabbed a few other supplies like sandpaper, epoxy, etc.
In the next few days, we cut and assembled the wood version of the base and boxes and then painted everything with a coat of gesso.
After the gesso was dry, we sanded everything down and applied a coat of acrylic paint mixed to match the colors of the xylophone and its keys as closely as possible.
One more coat and some additional sanding and the boxes were starting to look good.
Now, all that was left was to put the pieces together.
First, we epoxied the piezos to the underside of the xylophone keys to keep them better attached than the double-stick tape we'd been using up to this point. Also, the tighter bond formed by the epoxy meant that the xylophone keys could vibrate a little more freely and therefore play a clearer and louder note.
Next, we installed the Arduino and circuit board on the underside of the base and labeled all of the holes with their respective sounds so we wouldn't get confused during assembly.
Then, one by one, we added each sound, hot gluing its box into place over its respective hole and wiring up the mechanism to the Arduino and the circuit board with the 9v power supply. We constantly tested each sound mechanism as we added it to make sure that we didn't glue things down or make them inaccessible when they weren't well plugged in.
Finally, all that remained was gluing down the colored boxes on top and installing the mallet holders and we had a working Multixylophoniomnibus!
When we had the project fully put together and operational, we immediately noticed two things about it. On the upside, we had done a seriously good job hiding the technology. The whole thing felt like a fun and playful children's toy built at the Bauhuas in the 1920s. The primary colors and simple shapes made the final object approachable and instantly comprehensible.
On the downside, not being able to see the source of the sounds made them maybe a little more mysterious than we planned. The sound sources weren't far enough apart for you to identify where each one originated by ear so the only clue you had about the connection between the boxes and the sounds was the matching color. Also, many of the clanking and vibrating sounds were similar enough to each other that, without seeing their source, they blended together.
When we showed the final piece in class these advantages and disadvantages both were directly reflected in the other students' responses. Without nearly any explanation, we let our classmates play with the Multixylophoniomnibus. It was fascinating to watch their reaction. They'd become like scientists, hitting all the keys one by one, or focusing on one note repeatedly, or dragging the mallet over all the keys, playing with its reactions.
In the discussion afterwards, probably the best suggestion (I think from Janine, but I wasn't taking notes) was that we should put the boxes on hinges so people could open them up to see the mechanisms inside after having played for awhile and absorbed the mystery. We had people guess the sound sources and then they were delighted to see what was inside so I think this would make a great improvement.
Finally, the last step of the project was to make the video I embedded at the top of this post. We setup a white background at the documentation station and checked out some lights and a video camera and spent an hour shooting some simple shots. We made sure to get really good audio for the piece which was incredibly important for getting across the project's interactivity.
A number of people have mentioned that their favorite moment of the video is when I roll up my sleeves right before I start playing as if I'm about to do a magic trick. We tried to shoot and edit the video in a minimal, clean style that matched the project's aesthetic. It's funny how, in that context, these small details can be so expressive and full of personality.
Overall, this project went extremely smoothly at nearly every stage. Our group came together on an idea almost immediately, had strongly complimentary skills, and thoroughly enjoyed working together. The struggle to understand piezos was the biggest technical obstacle, but once we overcame that we were able to help two other groups profit from what we learned, one to sense the biting of an apple and one to build a wind chime that would detect breezes. We even finished the project with plenty of time to spare. A success!
If you want to learn more about the process of creating this project, my Multixylophoniomnibus set on Flickr is a good place to start. I've included the final version of the code below.