User:Pbarring9583/ENES100/Project 1

Project Preference
1. Shaker table 2. Arduino based air hockey 3. Smart shoe

Week 1 Narrative
Me and my group we are designing a Automatic Shaker Table to simulate the earthquake and it's destruction. This first week we didn't got done enough because it was everyone's first time. We first started with asking question to each other about what can we do design an automatic shaker table and what ideas we can take from the manual shaker table group. Then we started brainstorming some ideas about where to start and what to do first. My task is to design a frequency knob, I researched about how can we connect a frequency knob to the table and how can we make it work to change the frequency of table when it's shaking. i found some ideas of other frequency knobs, but i didn't got more good ideas. Maybe by next week i'll get some more ideas to make it work.

Week 2 Narrative
On the second week of our project my group and I finally came up with a basic design for our shaker table. First my group and I made few diagrams to figure out how we can connect a motor, arduino, on/off switch and frequency knob with a breadboard and attach it to the table so that everything is hidden under the table and at correct spot. To fit everything under the table, we decided to use 3ft by 3ft sized table and 3ft by 3ft by 6inch box where everything will be fitted. We also did some research on the internet to get a feel of how everything can be put together. Then we chose the design that we all agreed is the best and will work easily. My main task for this week was to find the frequency range of a earthquake and the frequency at which it is dangerous. I did research on the internet over the weekend and found out a lot of important information about earthquakes. The frequency of earthquake can range from 10-50 HZ. The average effective earthquake frequency is around 31 HZ. The magnitude of earthquake can be measure by the Richter scale. On this scale, a magnitude of below 2.5 is very minor and not felt by humans. The magnitude of 6.0 is more likely to cause damage to the people and is 10 times larger than magnitude of 5.0. The average magnitude of an earthquake is 7.0 on the Richter scale. This is all I learned about earthquake and it's frequency, now I have to work with my group to find the frequency codes for arduino and install them in the arduino.



Week 3 Narrative
For the third week of our project, our group decided to write down some questions about the things we need for a successful project. The questions we came up with were, 1. How will the design work? 2. How many motors we need to use? 3. How much turbulence should the table exhibit when simulating an earthquake? The other issues that we wanted to focus on were the CDIO Report, PowerPoint Presentation, and the arduino coding. We did some drawings for the table of how should it look like and also conducted preliminary research online to come up with other ideas of how the table will work. We found the website “http://www.geo.mtu.edu/~jdiehl/ETM.pdf”. After looking at this website, we decided to use the same table design, but use a motor in place of a drill to simulate the seismic activity of an earthquake. My task for this week was to get the arduino coding to control the motor and to change its frequency. Through my research to find the codes to control the speed of a motor, I found some codes, but they are not the way we wanted to use. I had to do some changes to the codes so that we can easily control the motor’s speed. I found the codes for the arduino from this website http://playground.arduino.cc/Main/DCMotorControl#.Ux0dD_ldXy0. The codes for the arduino are below with some of the changes that I made which should help control the motor speed. Though I do not have access to an arduino, I will test these codes in the class. Moreover, I decided that we will use the potentiometer to control the frequency of the table. /* * Switch test program */

int pot = 0; int relay = 2; int motorPin = 11; int analogPin = 3;  // potentiometer connected to analog pin 3 int val = 0;        // variable to store the read value

void setup                   // run once, when the sketch starts { Serial.begin(9600);           // set up Serial library at 9600 bps pinMode(pot, INPUT); pinMode(relay, OUTPUT); pinMode(motorPin, OUTPUT); }

int getPot { int v; v = analogRead(pot); v /= 4; v = max(v, 90); v = min(v, 255); return v; }

int motorFoward { analogWrite(motorPin, getPot); delay(1000); digitalWrite(motorPin, LOW); delay(1000); digitalWrite(relay, HIGH); Serial.println(getIR); delay(1000); }

void loop                    // run over and over again { motorFoward; val = analogRead(analogPin);  // read the input pin analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255

}

Week 4 Narrative
For this last week of our project, my task was to figure out the proper codes for the arduino and find a way to connect the motor to the motor shield so everything works as a unit. Currently, I have found the correct codes to control the motor with the monster shield and the codes for the arduino to control the speed of the motor. The major obstacle I’m facing is the circuitry of the motor and how everything should be connected together. We decided to use an 8 pin stepper motor because of the motor’s power and speed which met the requirements we needed. I searched on internet to find information about the 8 pin stepper motor; however I couldn’t found any information about this motor. My group also tried to help me to find the information about the motor to power it up, but we weren’t successful. I wasted a lot of time trying to make it work, but I didn’t have any success. I tried to change the wires around, but again we were unsuccessful. I went to these websites to try and figure out how the wires are connected to the arduino, but the websites proved to be useless because the motor and motor shield used in the website were different from the ones we had, therefore, we were unable to get the motors working. 1.	http://arduino.cc/en/Tutorial/MotorKnob#.UyZSk_ldXy0 2.	http://arduino.cc/en/Tutorial/StepperBipolar#.UyZTJ_ldXy0 3.	http://bildr.org/2012/11/big-easy-driver-arduino/ 4.	http://learn.adafruit.com/downloads/pdf/adafruit-arduino-lesson-16-stepper-motors.pdf

This is what we got while trying to make the motor work with motor shield. The motor didn't spin, but we figured out that the motor is getting the current correctly. This tell us that there is something else we doing wrong.

This is the code I finalized with my group to control the motor. const int stepsPerRevolution = 48; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on the motor shield Stepper myStepper(stepsPerRevolution, 12,13); // give the motor control pins names: const int pwmA = 3; const int pwmB = 11; const int brakeA = 9; const int brakeB = 8; const int dirA = 12; const int dirB = 13; int x = 0; void setup { Serial.begin(9600); // set the PWM and brake pins so that the direction pins // can be used to control the motor: pinMode(pwmA, OUTPUT); pinMode(pwmB, OUTPUT); pinMode(brakeA, OUTPUT); pinMode(brakeB, OUTPUT); digitalWrite(pwmA, HIGH); digitalWrite(pwmB, HIGH); digitalWrite(brakeA, LOW); digitalWrite(brakeB, LOW); // initialize the serial port: Serial.begin(9600); // set the motor speed (for multiple steps only): myStepper.setSpeed(2); }
 * 1) include 

void loop { myStepper.step(48); myStepper.step(-48);

delay(2000);

}