Introduction: Soundgraffiti With Arduino Mega

So we haven been working on the new soundgraffiti board. 

This is an installation wich creates sounds using sprayed water.

The connection is made with water. We used copper plates as our sensor. the plates had a cutout line in the middle of 0,1 mm. Once water hit this line it would connect both sides of the plate an close the circuit. 

The closed circuit sends a 'on' status to the arduino and our laptop with pure data. This started the burning of a white LED and the begin of a sample loop.

What you need:
-Led's
-breadboard
-arduino (uno/mega)
-laptop
-Pure data software
-a lot of cables
-soldering iron
-tin
-samples/music
-plexi
-a big piece of mdf/or other wood
-lasercutter
-Cnc
-copper plates


Step 1:

the first thing we needed to do was to check how we could build this installation, using water as a connector.

We cut  out a small piece from a copper plate so the circuit would be broken.
We tried out this connection with just one  sensor and one LED light. 

When this worked we started to create our wiring for 2-3,.. led's.



Step 2:

It was very important that we had a clear visual schedule that explained our wiring.
At the end of our project we used more than 80 wires so a clear schedule comes in handy.

We made ours in illustrator, for each sensor/Led it is the same.

This was completed so we started creating our code for all the 15LED's.

The code for Arduino and pure date you can find at the last step.

Step 3:

When all of that was done we began to create our copper plate sensors and the drawing for our board.

The board has been drawn in illustrator and cut out using a cnc.
The copper plates are cut out using a cutter.

Step 4:

Because we wanted a somewhat clean front view of our installation we created a support for our arduino and cables.

This was a small support made out of wood. 
We cut out holes in it because this was easier to connect all the cables coming from the lowest layer of sensors.

As you can see we spend quite a lot of time sorting out and labeling the cables. 
This isn't necessary but i would recommend it to any of you ;-).

We used two breadboards, one is  negative and the other one is for the 5v.




Step 5:

The code.

Arduino code:

/*
*/

  const int ledPins[] =  {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};  // verschillende ledpins

  // variabelen
  int connectionState[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};   // schakelaar uit

  void setup() {
    pinMode(A0, INPUT);
    pinMode(A1, INPUT);
    pinMode(A2, INPUT);
    pinMode(A3, INPUT);
    pinMode(A4, INPUT);
    pinMode(A5, INPUT);

    pinMode(A6, INPUT);
    pinMode(A7, INPUT);
    pinMode(A8, INPUT);
    pinMode(A9, INPUT);
    pinMode(A10, INPUT);
    pinMode(A11, INPUT);
    pinMode(A12, INPUT);

    pinMode(A13, INPUT);  
    pinMode(A14, INPUT);

    for(int i = 0; i < 18; i++){
      pinMode(ledPins[i], OUTPUT);
    }

    Serial.begin(9600);
  }

  // arduino 2
  // for(int i=0;i<6;i++){
  //   int temp = analogRead(i);
  // Serial.print("analog1");
  // Serial.println(i);
  // Serial.printl(temp);
  // }


  void loop(){

    // haal waarde op van switchPin1
    connectionState[0] = analogRead(A0);
    connectionState[1] = analogRead(A1);
    connectionState[2] = analogRead(A2);
    connectionState[3] = analogRead(A3);
    connectionState[4] = analogRead(A4);
    connectionState[5] = analogRead(A5);
    connectionState[6] = analogRead(A6);
    connectionState[7] = analogRead(A7);
    connectionState[8] = analogRead(A8);
    connectionState[9] = analogRead(A9);
    connectionState[10] = analogRead(A10);
    connectionState[11] = analogRead(A11);
    connectionState[12] = analogRead(A12);
    connectionState[13] = analogRead(A13);
    connectionState[14] = analogRead(A14);

    for(int i = 0; i < 18; i++){

      if (connectionState[i] > 4) {
        connectionState[i] = 1000 + i;
        if (i<6){
        Serial.print("drum");
        Serial.print(i);
        Serial.print(" ");
        Serial.println(connectionState[i]);
        } else if (i > 5 && i < 12){
        Serial.print("synth");
        Serial.print(i);
        Serial.print(" ");
        Serial.println(connectionState[i]);
        } else if (i > 11 && i < 18){
        Serial.print("string");
        Serial.print(i);
        Serial.print(" ");
        Serial.println(connectionState[i]);
        }
        delay(300);
        digitalWrite(ledPins[i], HIGH);
      }
    }
  }