Wednesday, November 28, 2012

Nov 27 - More Final Project

So this week we've made a lot of progress with our project. We glued on the 3D printed feet, put together our hardware, taped the acrylic and board together to give us a consistent surface, and started working on the programming. Hardware wise, we're done. Now we just have to tackle the software.

So far, we only have the code we've worked with in Arduino. This basically just takes the input from the piezzos. Any time any of the buzzers give an output that is more than 10, four numbers (one for each buzzer) get printer in a line in the serial monitor.

Here's the bit of code we currently have:


const int sensorPin = 0;
const int ledPin = 13;
const int THRESHOLD = 100;

void setup()
{
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  int inp0 = analogRead(A0);
  int inp1 = analogRead(A1);
  int inp2 = analogRead(A2);
  int inp3 = analogRead(A3);  
  
  if(inp0 > 10 || inp1 > 10 || inp2 > 10 || inp3 > 10) {
    Serial.println("Wave Detected!");
    while(inp0 > 10 || inp1 > 10 || inp2 > 10 || inp3 > 10){
      Serial.print(inp0);
      Serial.print(",");
      Serial.print(inp1);
      Serial.print(",");
      Serial.print(inp2);
      Serial.print(",");
      Serial.print(inp3);
      Serial.println();
      
      inp0 = analogRead(A0);
      inp1 = analogRead(A1);
      inp2 = analogRead(A2);
      inp3 = analogRead(A3);
      }
    Serial.println("Wave Ended!");
    }
}

The printing of Wave Detected and Wave Ended is simply a good visual for determining when there are vibrations and when there are not. 

Thursday we're going to start looking at how we are going to use Processing to create a visual display to go with our drum!

Nov 12-Another Final Project update

So after playing with the piezzo's, we grew worried that we might have to change our project. They were not very sensitive and weren't really picking up a whole lot of the vibrations very well. However, with the help of Dr. Hamid, we tried using a resistor with the piezzo's. Suddenly, everything worked brilliantly.

So now we have our four piezzos wired with header pins and we've cut out our acrylic and board. We also got four little rubber feet to raise up our board. We drilled the holes in our board to make it easy to run the wires through, and then superglued our piezzos onto the board. We also superglued the feet to the bottom of the board.

However, after putting the feet on, we realized that they were too short-we had calculated for the height of the breadboard, but hadn't considered the height of the wires coming out of the breadboard. So with some help, I designed new feet and printed them out on the 3D printer. They should be ready by next class period.

Currently, we've written a program that monitors the input from the sensors and gives us a print of the vibrations. It's a bit hard to read at the moment, but it tells us that each of the sensors are working properly. We'll work on formatting the output a bit better in the future.

Monday, November 12, 2012

Nov 8-Final Project Update

This week we've begun to work on our final project. We've sketched out a few drawings of what we want our drum head to look like and the materials that we will need.

Our drum will be made of two layers, one acrylic and one wood. In between these two layers, we will have four piezzo buzzers (one in each corner) to sense vibrations. These layers will be held together with electrical tape. We plan to run the wires through holes in the wood board so that the only thing visible from the top is the buzzers. The buzzers will each run to an analog pin in the arduino and then to ground. There will also be 4 small rubber feet in each corner to hold the board above the arduino and breadboard.

Nov 6-One Way Serial Communication

Introduction:
This week in lab, we were instructed to do an exercise involving one way serial communication. We were allowed to pick any two input sensors, so we decided to do ours utilizing piezzo buzzers since our final project will possibly involve using these sensors.

Procedure:
First, we hooked up a simple circuit with two piezzo buzzers. Next, we opened Arduino and created a program that would read the results from the sensors in the serial monitor. However the reading that this type of program was giving was just a string of random numbers, which was not helpful for our purposes. So we used CoolTerm to help make sense of the garbage.

Next we imported this to Processing. We used the bytes that were pulled in from the sensors and the Arduino to create a graph.

Here is a screenshot and a video: