User:Medelen8/ENES100/Smart Shoe Implement A

Goals for implementation performance, cost and quality
1.Casing 2.Re-soldering.
 * Build a fitting case that can hold the necessary smart shoe hardware and for that to be achieved the following criteria needs to be met.
 * Fix dimensions for switch
 * Modify 3D models of case and sliding door
 * Print prototype of case
 * Test different clip designs
 * Test prototype case with 9V battery and dummy components
 * Refine 3D model
 * Print second prototype of case and, if necessary, sliding door

3.Write code for shoe (transmitter + height calc)
 * Modify height calc code to calibrate accelerometer in setup function
 * Make sure height calc gives answer in inches, and is correct
 * Adjust parameters to eliminate false jumps; make it foolproof
 * Merge transmitter code with existing height calc code
 * Make sure height message is only sent after each jump
 * Write code for receiver
 * Add code to convert from inches to feet
 * Add code to display both inches and feet
 * Create Processing sketch that displays large, colorful text
 * Get Arduino sketch to communicate with Processing sketch to send it the height info

The manufacturing and/or purchasing of parts
Before this phase of the project could be completed, we needed to buy the transmitter and receiver, we also needed to build a case that will contain the accelerometer, arduino micro,and transmitter. According to sparkfun, the tranmitter costs $3.95, while the receiver costs $4.95. With the aid of the Makerbot, we were able to build the required casing for the shoe.the material of the clip that will be used to clip the device to the shoe can be in aluminium or nylon plastic with a matte finish and slight grainy feel to make that flexible and strong.We can find any of those material at any store for a good price.

Finally we decide to choose those two design for the case and the sliding door because it is more efficient and we can easily remove the smart shoe inside it.

The assembly of parts into larger constructs
Arduino no.1       GND > GND Digital pin 13 -> Data 5V pin -> VCC And attached a wire as an antenna to the ANT pin on the transmitter. Arduino no.2    GND > GND Digital pin 13 -> Digital Out 5V pin -> VCC And attached a wire as an antenna to the ANT pin on the receiver. -We downloaded and uploaded the following Library to the Arduino software: -Virtual Library: http://www.airspayce.com/mikem/arduino/VirtualWire/ Next, we started by testing the two smart shoe devices we already have (the ones we used in the Science and Engineering Festival in Washington last weekend). We figured out that one of them was still working fine, but the other one wasn't unfortunately. After we tried to make sure of the codes and everything, we found that one of the wires was broken (the wire that is connected to the VCC pin of the accelerometer, so no acceleration values were measured causing no results). So we went to the lab, and soldered that broken wire using the electric soldering tool, and made sure that all the other connection are fixed and in good shape. Then, we went back and uploaded the codes, and gladly it also started working again. After fixing that, we were ready to add a switch. However, we needed first to figure out how exactly the switch worked. It has 6 metal pins on its bottom, so we weren't sure what the best way to connect the wires was. In order to figure that out, we didn't use the final smart shoe devices we mentioned in the beginning, instead, we used the device we actually built last week using Arduino Uno. So, we attached a 9V battery and connected it to the Arduino instead of the USB cable. Then, we put the switch 'ON', and added that to the circuit between the battery and the arduino. By experiment, we tried to connect the wires in many different ways, until we figured out how they should be connected to make the switch functional. ̇̇̽* This is a picture of us testing how to connect the wires to the switch. And as you can see, the switch is functioning, and the arduino's lights are on, which means the switch is ON. Next, we took that switch off this circuit, and brought one of the 'Final' smart shoe devices (MiniPro). we cut the red wire (+) that comes from the battery's snap, added the switch using the same pins we tested, soldered the connections and added some tapes to make sure there is no shorts anywhere.
 * Re-soldering of the connections/wires between the arduino micro, the 9V battery, the switch, the accelerometer and the transmitter
 * The accelerometer measures the acceleration of the jump
 * The Arduino Micro processes and utilizes the data that comes from the accelerometer to calculate the jump's height.
 * Then, comes the RF transmitter's role to send the final calculations from the Arduino Micro to the RF receiver.
 * The RF receiver, which is connected to an Arduino Uno to the computer, receives that data, to be finally displayed on the screen.
 * Therefore, we built the following circuits:
 * RF transmitter's circuit:
 * RF receiver's circuit:
 * This following picture is while I was cutting/un-soldering the red(+) wire to add the switch on it:
 * These are picture showing the process of adding/testing the switch:
 * Switch is ON (left image)                                           * Switch is OFF (right image)

After that, we tested the device to see if everything is fixed, in place and appropriately connected, and we got results every time I imitated a jump. Finally, we had to figure out a way to modify on the box (case) in order for it to fit the whole device with the battery then. Since not much time was left for our presentation of the smart shoe in the seminar, we weren't able to do my best on this part. Nevertheless, I was able to make a small cut in the plastic box/case, just to enable the wires of the switch to come out of the case when it is being closed. So, our switch is currently placed out of the case on the side. we added some tapes to make sure the switch stays in its place and doesn't move violently when the device is used, so that the wires/soldering don't get damaged.
 * An image of what the 'Results' looked like:
 * Cutting the case:
 * Images of the case including the device with the switch (ready to be used):

The break down of high level components into module designs (including algorithms and data structures)
We noticed that the digital pins on both arduinos, that are being used with the transmitter and the receiver respectively, have not been declared in the codes. So, we declared the pins, after I had rebuilt the circuits as follow:

And the modified codes I used are: Transmitter code: Receiver code: In purpose of making the receiver print the value of height in both inches as well as feet, I tried to edit on the receiver's code as follow:
 * First, I tried to divide the value of [i] in the buffer by 12 like this:

But, unfortunately, that wasn't successful. I had nothing printed on the screen. But, the printed result was: ( h=11 ) instead of the mathematically actual value of [ 16/12=(1.33) ]. After many unsuccessful trials, I believe I should work more on understanding how the value of [i] in the buffer is being seen by and dealt with by the arduino; to be able to have mathematically accepted results. Moreover this week, I attempted to combine the codes of all the accelerometer, the transmitter and the receiver. To send the measured and calculated jump height instead of just a constant number. So I came up with these combined codes:
 * Then, I tried to slide the division inside the brackets like this:
 * Transmitter+height of jump calculation code:


 * Receiver code (with 'feet' units):

The low-level design (coding)
These are the sketches developed in preparation for the USA Science & Engineering Festival in April 2014.

Smart Shoe Transmitter Arduino sketch (load on Sparkfun Pro Micro 5V board):

Smart Shoe Receiver Arduino sketch (load on Arduino UNO board):

Smart Shoe Display Processing sketch (run on laptop):

The integration of software in electronic hardware (size of processor, communications, etc)
We connected the Arduino to the accelerometer that has the transmitter br/> So, I have the total of three circuits. The previous one, and these two:

Test and analysis procedures
We are going to print the case of the smart shoe and see that it is adaptable and convenient, which will help us to decide the final choice for the case. This was my first attempt:

To solve that problem, we had to move the lines in which these variables are declared, we deleted them from the 'void setup' section and re-printed them at the very beginning of the code. To solve that, with the assistance of Professor Mark Edelen, We changed the code of a transmitter Finally, I was left with this code (after editing): After that, we started to use the codes that were developed to be used at the Engineering Festival and tested them. Since that time, we are getting great results. There were some problems that happened to our smart shoe device while we were using/testing it. For example, it stopped working at the 2nd day of the festival. Also, when my group and I demonstrated it at the Engineering Seminar, the communication between the smart shoe and the receiver in some cases was going off, and the messages were not received/printed on the screen. Therefore, I had to do some testing, in an attempt from me to know what the problem(s) was/were. What I did to solve this issue, I cut the wire until I reached the soft/un-stiffed part of it, and re-connected the wire to the switch, soldered the joint again. These images show you what I did with regard to this wire:
 * First problem: we kept getting error messages from the arduino program when I tried to upload the previous code. The messages told me that each and every single variable that was used in the code of the 'height calculation' is not declared.
 * Second problem: Although the error messages' problem was solved, we were getting no results when we tried to move the accelerometer. we got nothing printed on the monitor of the the receiver.
 * Testing our 'Newest' version of the smart shoe:
 * While I was testing, I noticed that sometimes the power was going off (the light of the arduino goes off) while moving the smart shoe. So, I took a look at the wires/connections and soldered joints, I found that one of the wires of the switch was becoming loose due to the tough jumping. I also noticed that that wire specifically was stiffed, and didn't have much tolerance, so it wasn't able to handle the pressure.

The image on the left shows the result when I tried the smart shoe near to the receiver. The one on the right shows what I got when I tried it on a larger distance (about 4-5 meters away), I didn't get results:
 * In addition, while I was testing the smart shoe, I noticed that it worked just fine when I jumped near to the receiver (about 1 meter away). However, when I tried to go further away form the receiver and jump (about five meters away), I noticed that nothing was received (no results on screen). I guess that what happened with us last week, when we demonstrated it in the Seminar.

How I dealt with this issue: I changed the Antenna of the receiver. I replaced the old (shorter) antenna with a new (longer) one. After that, I did the testing again, and gladly this time, I got results.

To fix that, I had to bent the wires in a way that assures that the accelerometer sets properly in place. After that, I tested the smart shoe again, it worked fine in the beginning. But, unfortunately, while testing, and jump after jump, I noticed that sometimes, the results on screen didn't match, for instance, when I jumped about 15 inches, the result printed on the screen was 1 inch! What I noticed while testing, that although the new printed case is tighter than the old plastic case we used before, there is still a tiny space, that allows the device to move/wiggle inside the case while jumping. That little wiggling while jumping surely caused that fake results, because when you jump, the accelerometer senses your jump, and the timer goes on, then right after it wiggles insid the case (before actually landing) the accelerometer thinks that you landed, and turns off the timer. That means: numbers that does't match the reality. To solve that, I added a small rectangular-shaped sponge on the top of the device, then closed the door of the case. So that everything sat in place just fine and tight. Then, I jumped again, and gladly I got the smart shoe to work properly every time I tested it since then.
 * Finally, after printing the case using the makerbot, I put the smart shoe device inside it and tested it again. I noticed that the communication problem came back again. During the testing, I noticed that when the smart shoe device is put inside the new case, the accelerometer does not set horizontally (so it doesn't get calibrated properly).

The verification of performance to system requirements
We finally got some results from the smart shoe so now it is working perfectly.We got an image of what it looks like * An image of what the 'Results' looked like:
 * At the beginning, unfortunately, when it came to the results we were getting when we tried to move the arduino with the accelerometer pretending that it was like a jump, we kept getting some huge numbers. Sometimes positive numbers, and sometimes negative. But we couldn't figure out what was also going on wrong also, causing that problem.
 * But gladly now, after editing the codes, and using our final codes (the ones which were developed for the Engineering Festival), and doing all the modifications on the smart shoe device and its receiver, we are able to get real results that match the real heights of jumps, each and every time someone uses our smart shoe device. And the previous paragraph could tell you that.

Sourcing, partnering, and supply chains
-Arduino software -Autodesk Inventor -Makerbot -Accelerometer -Transmitter

Possible implementation process improvements
-We can add a velcron on the case to make it more solid as possible -Find the arduino code from Nike for their Smart shoe device First we used a box hat we bought in a store this is a picture of the box

And later we created a box with the 3D print base from the dimensions of this box, we also added a spounge to allow a space between the smart shoe and the case,

Next Steps
Right now, we are almost done , i think the next step will be to see how to incorporate a velcro directly on the case for every size of shoes to allow a beter efficiency when we put on the shoes.
 * 1) Modify on clip design
 * 2) Choose a better way to attach the printed case to the shoe.