Introduction: Laser Piano

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

Step 1: Components Needed

Electrical:

1 Arduino Uno Rev3

1 Servo Motor

1 Capacitive Touch Sensor

5 5mW laser diodes

http://www.ebay.com/itm/100pcs-mini-650nm-6mm-5V-5...

5 Photo Resistors

2 2N2222 NPN Transistors

2 Wooden Skewers

1 1W 8 Ohm Speaker

Electrical Tape

Jumper Wires

1 USB Cable

1 5V 500mA Power Source (USB to Jumper Cable)

1 Enclosure

1 Breadboard

3D Printed Parts:

1 Laser Piano Base

1 Laser Piano Top

1 Solid Totoro

Software:

Arduino IDE

AutoDesk Inventor

Step 2: 3D Printed Parts

The following ZIP file contains all of the STL files that are needed to build the Laser Piano. The best results were achieved by using a black ABS filament at a 0.2 mm layer height. If needed, an acetone vapor bath can be performed on the pieces to smooth out rough edges.

Step 3: Electrical Schematic

This schematic shows the proper wiring for the laser piano. Since Fritzing does not include a capacitive touch sensor component, the schematic uses a dummy place holder. This place holder is the component just above the servo motor. The dummy place holder is wired exactly how a capacitive touch sensor would be wired to this circuit. Another thing to note is that Fritzing does not include a 5V 500mA power supply. To accommodate for this, I used DC power supply. This power supply is found just to the right of the dummy place holder. Again, this power supply is wired exactly how any 5V 500mA power supply should be wired to this circuit.

Step 4: Arduino Code

The .ino below contains the code for the Arduino Uno. The file must be opened in the Arduino IDE available at the official Arduino website. This code sets up the photoresistors and the touch sensor. The touch sensor is set up with an interrupt service on pin #2 of the Arduino. When the touch sensor experiences a capacitance change, the interrupt service begins and calls the checkTouchSensor function. The main loop of this code calls the checkLasers() function which continuously runs through the array of photoresistors, looking for a voltage change. When a voltage change is observed, the Arduino sends a modulated control signal to the 2N2222 NPN Transistor which controls an external power supply connected to the speaker. The modulation of this control signal depends on the integer returned by the setFrequency function. This integer returned is passed to the Tone() function which controls the pitch of the speaker. The reason we used a transistor to control the speaker is due to the current limitations on the pins of the Arduino. At 5V and 8 Ohms, the speaker would draw 625mA of current, enough to fry the Arduino. Using the Arduino to control the passage of external power to the speaker allows us to have a nice crisp sound without using external sound boards. We also use a 5V power supply to power the lasers due to a similar current limitation.

Step 5: Assembly:

The first step is to hot glue all of the photo resistors into the small holes in the Laser Piano Top piece.

Next, cut two 6-inch skewers and glue them on the smaller holes on either side of the Laser Piano Top piece. Set this part aside for now.

Take the Laser Piano Base piece and hot glue all of the lasers into the small holes. Take the Laser Piano Top piece and align the skewers with the base and hot glue everything together.

Now, simply wire the photo resistors together and run the cables down the side into the electronics enclosure. Do the same with the lasers.

Drill a hole big enough for the servo motor in the enclosure lid and hot glue the servo motor. Mount the Totoro Figurine onto the servo motor.

Drill holes for the speaker and hot glue the speaker onto the inside of the enclosure.

Drill a hole on the side for the touch sensor. Wire it through the hole and hot glue the touch sensor to the side of the box.

Finally, wire everything up as per the schematic supplied above.

Congratulations! You have successfully built your very own laser piano!

Step 6: Using the Laser Piano

Now that you have assembled the Laser Piano, simply plug in your 5V 500mA power supply for the lasers (I used a USB to Jumper Cable) and your Arduino power supply.

Touch the sensor to turn on the laser array. To play a note, simply block any of the lasers. To turn the Laser Piano off, touch the touch sensor again and unplug the power supplies.

Enjoy!