Engineering Projects/SmartShoe/Howard Community College/Fall2012/p2501PKH
Problem Statement
[edit | edit source]To design and create a prototype that will accurately determine the height of a wearer's jump.
Team Members
[edit | edit source]Summary
[edit | edit source]Through research of previous teams at Howard Community College, we found that no group or team had really worked on this project. Having nothing to work upon, led us to research other outlets for our project. We modified the arduino sketch that was provided for the class project at the beginning of the semester. After the modification, we verified that the program was accurately measuring the height. Finally, we fabricated the device so it was capable of attaching to a shoe.
Poster
[edit | edit source]Week 1 & 2
[edit | edit source]Today we learned of our group and formulated the goals for our four weeks and a came up with a problem statement. Once we had a base for our project, we set up the team page on wikiversity. We than began researching. Unfortunately no other groups have took on this project besides the "class project", so we are starting with a blank slate. We do however have part of the arduino code for using the accelerometer and outputting readings to the accelerometer. We also found an article where a the physics of the original smart shoe is reverse engineered and explained in detail; the information we withdrew from this article should prove valuable for our project.
Since the majority of this project deals with the arduino and the accuracy of our arduino code between now and next class each member of the group will start working on studying and learning from the arduino tutorials referenced in the tutorial section of our page. The goal of this is to become fluent in arduino to allow us to surpass our goals.
Today we got together as a group and discussed how to implement the arduino code along with the equation to convert the accelerometer readings and time into height of jump. After looking up and discussing the proper equation we came up with the following code, that will measure the height of a jump in meters:
/*Measuring height from acceleration and time readings, using an accelerometer and arduino.
Output is displayed on serial monitor.
October 17, 2012 -- Patrick Thoreson. */
const int zpin = A0;
int az = 0;
unsigned long start,finish
;
double height, elapsedMS, elapsedS;
void setup() {
Serial.begin(9600);
}
void loop() {
az=analogRead(zpin)-400;
if (abs(az)>200) {
start=millis();
Serial.println("Took Off!");
delay(200);
az=analogRead(zpin)-400;
while (abs(az)<200) {
az=analogRead(zpin)-400;
}
finish=millis();
elapsedMS=(finish-start);
elapsedS = elapsedMS/1000;
height = 1.22625*(elapsedS*elapsedS);
Serial.println("Landed!");
Serial.print("In the air for ");
Serial.print(elapsedMS);
Serial.println("ms");
Serial.print("Height = ");
Serial.print(height);
Serial.println(" Meters");
delay(500);
}
delay(20);
}
To test this code, we built a small circuit between the arduino and the accelerometer. The code works, but will have to be calibrated. The setup is pictured on the side in a thumbnail.
After we tested the code and arduino/accelerometer we started discussing how we wanted to fabricate the arduino in terms of the shoe. We came to consensus and would like to fabricate as such that it can be detached and attached easily to many different variations of shoes. A decision matrix and brainstorming session will shortly ensue.
Week 3 & 4
[edit | edit source]- The third week we began selected our design and began fabricating it. We chose not to use a prebuilt case due to it's bulk and decided to build our own so we could enhance and produce the results we wanted. The design that was selected is very simple yet effective. It is a copper clip attached to the bottom of the Arduino board, and how it works is it slides under the shoe laces, and the clip pushes against the board. This locks the Arduino in place on the top of the shoe. We did however have to compensate for this design in our code a little bit. The accelerometer we used is variable to the degree of incline it is on. It is supposed to be on a completely flat surface, however the top of a shoe is slightly downward sloping. To compensate this we adjusted the readout values of the Z-pin on the accelerometer, just slightly.
- One of the flaws of this design initially was the soldering under the Arduino would catch onto the shoe laces and stressed against them. To stop this we found some thin styrofoam and uses this as a layer to decrease the friction between the board and the shoe, and provide a smooth surface.
- The parts for wireless communication were ordered early last week and we still are waiting for them.
- The fourth week was focused on configuring and trying to take our project wireless. We were seriously delayed by slow shipping and did not receive the necessary parts for this task until too late. We received the RF link pari components 4 days before the end of the project cycle, and this simply did not allow enough time for us to build a complete code and troubleshoot/test the wireless capability.
- However we went to our backup plan and were able to create a somewhat makeshift code that would take the value of a jump, store it into the Arduino, and than read it out once plugged back into a computer. There were limitations with this however and it is not very practical. You need 3 different codes, to do this effectively, and you must run each code once per jump. This is very time consuming and just not worth the effort.
There are a few restrictions on storing and reading data.
- You need 2 separate sketches as I could not find a function that worked properly that would check to see whether the plug was connected or not.
- You must reset the memory every time you wish to write a new value, thus basically adding a 3rd sketch.
- Only one jump may be recored and logged at a time.
The library used for storing data is called EEPROM and it is built into Arduino.
The code for this is listed below:
/*Read and output code*/
#include <EEPROM.h>
int addr = 1;
double value;
void setup()
{
Serial.begin(9600);
}
void loop(){
value == EEPROM.read(addr);
double elapsedMS = value*4;
double elapsedS = elapsedMS/1000;
double height = 1.22625*(elapsedS*elapsedS);
Serial.print("Height = ");
Serial.print(height);
Serial.println(" Meters");
delay(500);
delay(20);
}
------------------------------------------------------------------------------------------
//Write code
#include <EEPROM.h>
const int zpin = A0;
int az = 0;
unsigned long start,finish;
double height, elapsedMS, elapsedS;
void setup() {
Serial.begin(9600);
}
void loop() {
az=analogRead(zpin)-400;
if (abs(az)>200) {
start=millis();
Serial.println("Took Off!");
delay(200);
az=analogRead(zpin)-400;
while (abs(az)<200) {
az=analogRead(zpin)-400;
}
finish=millis();
elapsedMS=(finish-start){
int addr=1;
double val = elapsedMS/4;
EEPROM.write(addr, val);
delay(100);
}
}
Decision List
[edit | edit source]Material List
[edit | edit source]Software List
[edit | edit source]Tutorials
[edit | edit source]Portland State University Arduino Tutorials
Arduino Main Tutorials
Next Steps
[edit | edit source]The next step for this project is to get a fully functioning RF link or other wireless communication. The real problem we had was just time prioritization; We ran out of time before we could finish what we had hoped to do. Primarily establish a wireless connection to transmit our data.