Introduction: Illumaphone: Light-based Musical Instrument With Arduino

Ever wanted to build your own electronic musical instrument? In this Instructable, I walk through the build process for my Illumaphone, a light-based, spatial musical instrument that I built for Jeff Snyder's Computer Music class at Princeton. It consists of six coffee cups. Wave your hands over the air to trigger notes; light levels control volume and vibrato. Each cup represents a different note.

Prior knowledge:

This Instructable will assume that you are comfortable with the Arduino, and that you can handle installing and setting up a program called ChucK.

Materials:

  • 6 photoresistors
  • 1 Arduino Uno
  • The usual wiring bits: alligator clips / wire / breadboards. I didn't do any soldering because this was a temporary project.
  • Some kind of box-like object to hide the wiring. I used the cardboard lid to a box of printer paper.
  • 6 disposable coffee cups to act as light funnels
  • 1 laptop to process data and do sound generation

Everything starts with six trusty photoresistors, one in the bottom of each cup. The Arduino Uno reads in data from the light sensors, and sends it to the laptop, which then uses ChucK (a musical programming language developed at Princeton) to synthesize notes as appropriate. The physical build is key to providing a good experience. Hiding wires makes people focus on the sound, and the cups act as awesome light funnels, so their shape does kind of matter.

All right, let's get started.

Step 1: Light Sensing

Light sensors are the most basic, critical part of the Illumaphone! If you haven't used them before, I'll briefly outline how to do so. If you already know how to connect photoresistors to an Arduino, spoiler alert: all we're doing here is attaching one sensor to each analog pin on an Arduino Uno, so you can skip ahead.

What is a photoresistor / light sensor / light-dependent resistor, anyway?

A photoresistor is a special component whose resistance fluctuates based on visible light. Depending on your environment, a photoresistor may be able to sense fluctuations caused by movements as far as a few feet away.

Connecting one photoresistor to the Arduino Uno

I recommend the Arduino Playground tutorial for this sensor. Here are their instructions:

Connect the photoresistor one leg to pin 0, and pin to +5V
Connect a resistor (around 10k is a good value, higher values gives higher readings) from pin 0 to GND. (see appendix of arduino notebook page 37 for schematics).

From there, I highly recommend running their test code:

int lightPin = 0;  //define a pin for Photo resistor

void setup(){
    Serial.begin(9600);  //Begin serial communication
}
void loop()
{
    Serial.println(analogRead(lightPin));
    delay(200); //short delay for faster response to light.
}

Can you see values being printed? If so, great! You're ready to move on to the next step.

Step 2: Wiring Up the Light Sensors

Each light sensor needs to be connected to an analog-input pin on the Arduino. The circuit layout is identical to what we did in the last step, but multiplied by six.

As for the physical build, I found it useful to begin by inserting the light sensors into the cups first, and then attach the cups to the base second.

To insert the light sensors into the cups, I used a sewing needle to puncture two properly-spaced holes in the bottoms of each paper coffee cup. Thread the light sensor through so that it's facing in the proper direction. Depending on the size and shape of the cups, this may be difficult; you can use tweezers if you have difficulties.

To attach each cup to the base, I once again used a needle to poke holes through the cardboard, for the legs of the photoresistors to go through. Then I used liberal amounts of duct tape to keep everything together. You can improvise here quite effectively: try using hot glue instead, for instance. For me, the black duct tape ended up being part of the overall aesthetic.

You can see from the second photo that the circuit is formed with a mass of alligator clips. Like I said, this was designed to be a temporary build; if I were to do it again, I would be sure to actually solder things, route my wiring properly, etc. Even if you go the alligator clip route, be sure to use liberal amounts of tape to keep things relatively organized.

Step 3: Upload the Arduino Sketch

Now that your build is complete, flip the Illumaphone rightside up. Hey, it doesn't look completely messy from this side!

The next step is uploading the Arduino sketch. It is available here: https://github.com/bonniee/illumaphone/blob/master/readAllAnalog/readAllAnalog.ino

This sketch is quite simple; it just reads the data from the pins and then prints it out. Go ahead and inspect the Serial monitor to see what's happening.

Step 4: Run the ChucK Program

Sound generation is handled by a ChucK program.

If you don't have ChucK installed, you can find instructions for doing so here: http://chuck.cs.princeton.edu/release

You can download the ChucK program for the Illumaphone here: https://github.com/bonniee/illumaphone/blob/master/cuppy.ck

To run the program, open it in the ChucK IDE, also known as MiniAudicle. You will need to provide it with the correct number for your serial port. First, plug in the Illumaphone via USB. Then, attempt to run the ChucK program. It should give you a list of serial ports as options. Pick the number that represents the correct USB port, type it into the arguments field, and re-run the ChucK program.

(You can also run ChucK programs via the command line: chuck cuppy.ck:NUM_HERE )

Step 5: Calibrate and Play

The sketch is set up to calibrate when you start it, so be sure to run the ChucK program while you're not standing over the cups. After you run the program, you should not hear any noise; you should be able to wave a hand over the cups to play them.

Once you have everything properly calibrated -- enjoy! I would love to see some videos of your performance. Try experimenting with different motions and techniques; you can even use a flashlight to play the cups, since they're sensitive to both light and shadow.

Finally, I've attached a video of me performing alongside my friend Harvest. (He's wearing a meditation-based musical instrument that we built, too!)

Other Resources:

Comments

author
belsilene made it!(author)2015-03-09

Thanks for this wonderful project!!!.

Tomorrow I'll try to make a video (where my little girl is not heard speaking :)) and show it here.

I look forward to trying the musical mug!!!!

1 - copia.jpg2 - copia.jpg
author
bonniee made it!(author)2015-03-09

I'm glad it worked for you! Looking forward to seeing the video.

author
Anandh+Thillalangadi made it!(author)2017-02-25

i've successfully construct the physical requirements of the illumaphone. Got struct at the miniaudicle part. WHERE TO ADD PORT NO ???. plssssss help me to get through it.

author
WaleedKhader made it!(author)2016-06-07

A great instructable, I made other one for Birthday.

https://www.instructables.com/id/Happy-Birthday-With-Arduino/

FYI7XKSIP4C1I9U.jpeg
author
20jjohns made it!(author)2015-12-08

what do you mean by "

values being printed"

author
20jjohns made it!(author)2015-12-08

Can you please clarify the instructions for me? I am new at arduino.

author
20jjohns made it!(author)2015-11-23

Would IR sensors work as well?

author
juanca11 made it!(author)2015-09-25

Help ! please ...Where I have to put the port number? I don't know where to put it, have tried in various places but it didn't work :(

Note: I'm noob in Chuck.

author
md_shukri made it!(author)2015-07-22

I found the number for my serial port, after adding the number to the command and "add shred" what was supposed to happened?? it still gives me the same options in the console

0:COM 1

1:COM 3

is that normal of it or was it supposed to happened?

author
PranavP4 made it!(author)2015-06-13

Awesome project! Thank you

My first arduino uno project thats not basic (yes I know I have been missing out!)

author
belsilene made it!(author)2015-03-09

By the way, I also tried to make it sound illuminating it with a flashlight. It sounds even better!!!!!!

author
gschoppe made it!(author)2015-03-06

Although most arduino programming courses ignore them, the arduino contains internal 30K pull-up resistors for each pin. So, if you wanted to simplify your parts list and wiring even further, you could connect each resistor to an analog pin and ground, and change your code to initialize each pin with:

pinMode(pin, INPUT); // set pin to input

digitalWrite(pin, HIGH); // turn on pullup resistors

Then, you just invert the logic in your code, so that the max value = high resistance and the min value = low resistance

The instrument might be slightly less accurate, with the smaller internal resistors, but it would be faster to prototype for people with limited experience / parts bins.

author
bonniee made it!(author)2015-03-06

How do you think that would impact the precision of the readngs? With something like this, a small mis-cailbration can have a lot of loud, unpleasant effects. I don't have a lot of experience using the pullup resistors.

author
tomatoskins made it!(author)2015-03-06

This reminds me a little bit of a light theremin. Looks and sounds great!

author
bonniee made it!(author)2015-03-06

Thanks! and yes, it was definitely inspired by the theremin.

About This Instructable

22,238views

146favorites

License:

Bio: Software engineer at Twitter, based in NYC. Member of NYC Resistor. I do stuff with Arduino, musical programming, and lasers. See more of my projects ... More »
More by bonniee:Internet of Dirt: a Texting PlantIllumaphone: Light-based Musical Instrument with ArduinoCaramelize Sugar onto Chocolate with a Laser Cutter
Add instructable to: