Tuesday, February 14, 2017

Week of February 8th - 15th

-This week I continued to edit my code but kept running into difficulty. I am trying to display an acceleration in the micro range (10^-6) and higher.

-Meeting with my advisor this week so we can discuss the issue.

-Started to design the apparatus so I can separate the Arduino and accelerometer in order to minimize any additional vibrations.

-I attached a picture of the current setup.



Tuesday, February 7, 2017

Week of February 1st - 8th

-Locations have been chosen to measure vibration data

  • Elevator Shaft
  • Comp Sci Classroom (directly under telescope location)

-Ready to collect data based on my calculated parameters.
  • Data will be recorded at a period of 0.01 seconds (T = 0.01sec)
  • Record at a rate of 100Hz - 50Hz
  • Resolution of 0.0025 of a second
-Need to make a few more changes to the code based on these parameters.

For the following week I want to determine the best way to record data. I used the plotter in Arduino (attached screenshots to the post).





Week of Jan 25th - February 1st

-Continuing to improve Arduino code in order to start collecting data.
-Adjusted the delay based on Arduino capablilties.
-Below is the code used in order to start collecting data

Will continue to improve this code in the coming week.

*/
/**************************************************************************/

#include <Wire.h>
#include <Adafruit_MMA8451.h>
#include <Adafruit_Sensor.h>

Adafruit_MMA8451 mma = Adafruit_MMA8451();

void setup(void) {
  Serial.begin(9600);
  
  Serial.println("Adafruit MMA8451 test!");
  

  if (! mma.begin()) {
    Serial.println("Couldnt start");
    while (1);
  }
  Serial.println("MMA8451 found!");
  
  mma.setRange(MMA8451_RANGE_2_G);
  
  Serial.print("Range = "); Serial.print(2 << mma.getRange());  
  Serial.println("G");
  
}

void loop() {
  // Read the 'raw' data in 14-bit counts
  mma.read();
  Serial.print("X:\t"); Serial.print(mma.x); 
  Serial.print("\tY:\t"); Serial.print(mma.y); 
  Serial.print("\tZ:\t"); Serial.print(mma.z); 
  Serial.println();

  /* Get a new sensor event */ 
  sensors_event_t event; 
  mma.getEvent(&event);

  /* Display the results (acceleration is measured in m/s^2) */
  Serial.print("X: \t"); Serial.print(event.acceleration.x); Serial.print("\t");
  Serial.print("Y: \t"); Serial.print(event.acceleration.y); Serial.print("\t");
  Serial.print("Z: \t"); Serial.print(event.acceleration.z); Serial.print("\t");
  Serial.println("m/s^2 ");
  
  /* Get the orientation of the sensor */
  uint8_t o = mma.getOrientation();
  
  switch (o) {
    case MMA8451_PL_PUF: 
      Serial.println("Portrait Up Front");
      break;
    case MMA8451_PL_PUB: 
      Serial.println("Portrait Up Back");
      break;    
    case MMA8451_PL_PDF: 
      Serial.println("Portrait Down Front");
      break;
    case MMA8451_PL_PDB: 
      Serial.println("Portrait Down Back");
      break;
    case MMA8451_PL_LRF: 
      Serial.println("Landscape Right Front");
      break;
    case MMA8451_PL_LRB: 
      Serial.println("Landscape Right Back");
      break;
    case MMA8451_PL_LLF: 
      Serial.println("Landscape Left Front");
      break;
    case MMA8451_PL_LLB: 
      Serial.println("Landscape Left Back");
      break;
    }
  Serial.println();
  delay(500);
  
}