Course Description

Art B2050, Fall 2013, DIAP at CCNY
A survey of modern electromechanical construction. Lessons interweave hardware, firmware, software and networking. Specific focus on paper and cardboard prototyping.

Wednesday, December 11, 2013

Week 14, 12/11: Music Box 2

All the files for our music box can be found here: http://lauralippincott.com/musicbox

Here's the Sketchup file I have for us to start from. It has a cutout for each component, and interlocking box joints that require no glue or nails. We'll need to build a linkage to lift the lid, and a dancer to spin on the continuous rotation servo. Basel has composed a melody for us using the Pitches library.



#include "pitches.h"

// notes in the melody:
int melody[] = { NOTE_D3, NOTE_F3, NOTE_A3, NOTE_G3, 
NOTE_C3, 0, NOTE_C3, NOTE_D3, NOTE_F3, 
NOTE_A3, NOTE_D3, NOTE_F3, NOTE_A3, 
NOTE_G3, NOTE_C3, 0, NOTE_C3, NOTE_F3, 
NOTE_F3, NOTE_A3 };

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = { 34, 20, 20, 25, 45, 20, 20, 30, 
40, 30, 55, 23, 56, 40, 35, 23, 67, 5 };

void setup(){
}

void loop(){
  for (int thisNote = 0; thisNote < 18; thisNote++) {
    int noteDuration = 1000/noteDurations[thisNote]; // one second divided by note duration
    tone(8, melody[thisNote], noteDuration);
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    noTone(8); // stop the melody
    delay(1000); // pause for a second
  }
}

Wednesday, December 4, 2013

Week 13, 12/4: Music Box

1. Piezo Sensor: Phyllis
We're still having trouble getting readings from the piezo sensor, but the idea is that an initial knock will activate the box. Deliverables: datasheet, circuit diagram, detectKnock() function that has a boolean knockDetected.

2. Standard Servo: William
William's job is to build the linkage that translates the motion of the servo to the door lifting up. Deliverables: datasheet, circuit diagram, openDoor() and closeDoor() functions, linkage.

3. Photoresistor: Shiang
When the door opens, light will hit the photoresistor and activate the RGB LED. The photoresistor has a boolean for lightDetected. When the box is closed, lightDetected is false. When the box is open, the brightness of the LED will be inversely proportional to the brightness of the room. Deliverables: datasheet, circuit diagram, detectLight() function, global boolean.

4. Continuous Rotation Servo: Michael
The motor will spin a dancer clockwise during the day and counterclockwise at night. When the global variable lightDetected is false, the motor won't move. Deliverables: datasheet, circuit diagram, spinDancer() function.

5. Gyroscope: Marianna
The values for the XYZ of the gyroscope will be mapped to the RGB of the LED. Deliverables: datasheet, circuit diagram, readGyro() function, gyroXYZ[] array.

6. Piezo Buzzer: Basel
Basel is composing a melody for the dancer. It should be responsive in some way to the motions of the dancer via gyroXYZ[]. Deliverables: datasheet, circuit diagram, playMelody() function, melody.

7. Ping Sensor: Robert
An always-on ping sensor will deactivate the box when the viewer walks away. Deliverables: datasheet, circuit diagram, readPing() function.

8. RGB LED: Clarinda
The RGB LED will be influenced by both the photoresistor and the gyroscope. The RGB values will be stored in an array, and mapped to the XYZ array of the gyroscope. Deliverables: datasheet, circuit diagram, changeColor() function, global ledRGB[] array.

The things we'll need to work on collectively are the master circuit diagram, the code architecture, and the box. I think we should 3D print the box. This is what I have so far in SketchUp; we can figure out how to add holes to mount all the components and Arduino in it. Inline image 1
I'm excited about this, hope you guys are too! We'll only end up with one, but with good design and documentation, everyone could easily make one of their own.