Sound sculpture prototype with Arduino and accelerometer

 

Part 1.  10/2/17.

Using tape and plaster is not ideal. My next steps are: making smooth, sandable sculptures using styrofoam and clay, then casting them in a foam resin that will allow for sound to travel from inside the enclosure. 

 

 

 

Part 2. Update. 10/9/17.

I made a roly-poly enclosure so that it can move and make music on it's own when pushed. I used plaster to create a heavy center of mass on the bottom.

 

I am happy with the fact that the rolly polly effect is working. The rolling could be smoother and the shell more polished. I have yet to try 3d printing and resin casting for these shapes. Questions remain:

1. What's the best way to fasten the Arduno inside the shape? 

2. How do I make it so that the Arduino turns off on it's own when the shape isn't moving - do i have to use a button or can it shut off and on by movement activation? Perhaps a touch sensor can act as a button.

I think the easiest way to make an enclosure that can open and close easily is to download a 3d printable container with a screw lid, then modify the top of the lid and body of the jar using Blender. The result would be a shape that opens and closes without a noticeable, distracting latch. 

 

Sound

For the first pass I'm happy with the synth sound. For the next iteration, I'd like to try to use the Mozzi library to create some more variation of sound and manipulate the relationship between current and sound mapping so that it's not mapped linearly. Perhaps some unexpected inverse relationship can be explored. 

 

Code

I found a library in the documentation that came with my accelerometer and used it in my own code, which used the variables that the accelerometer produced to manipulate the frequency of sound synthesized by the speaker. 

 

#include <Wire.h>               //Include the Wire library
#include <MMA_7455.h>           //Include the MMA_7455 library

MMA_7455 accel = MMA_7455();    // Make MMA7455 object
int SpeakerOut = 9;
char xVal, yVal, zVal;          // Return value variables


void setup() {
  Serial.begin(9600);           // Use the Serial Monitor window at 9600 baud
  
  // Set the g force sensitivity: 2=2g, 4=4g, 8-8g
  accel.initSensitivity(2);
  
 // Provide oiffset values so that sensor displays 0, 0, 63
 //  (or close to it) when positioned on a flat surface, all pins
 //  facing down
 
 // Update the numbers with your own values from the MMA7455_CalibrateOffset sketch.
  accel.calibrateOffset(0, 0, 0);

  pinMode(SpeakerOut, OUTPUT);
}

void loop() {
 
  // Get the X, Y, anx Z axis values from the device
  xVal = accel.readAxis('x');   // Read X Axis
  yVal = accel.readAxis('y');   // Read Y Axis
  zVal = accel.readAxis('z');   // Read Z Axis
  
  // Display them in the Serial Monitor window.
  Serial.print("X: = ");
  Serial.print(xVal, DEC);
  Serial.print("   Y: = ");
  Serial.print(yVal, DEC);
  Serial.print("   Z: = ");
  Serial.println(zVal, DEC);
  delay(1000);

int frequency2 = map(yVal, -90, 90, 100, 680);


}