User:Fnarmouq2655/ENES100/Project 1

Project Preference
-Smart Shoe -BioVest -Mobile Robot Hallway Navigation.

Problem Statement
''In one or two sentences, describe the project that your group will be working on. Identify what CDIO phase (Conceive, Design, Implement, or Operate) your group will complete in this project cycle.''

Week 1 Narrative
This first week of our project was mostly about reading through the CDIO reports of the previous groups; to gather information in order to know what the project is all about, what they already have done and most importantly, what we, Cora, Emanuel and I, should do to lead the project to success.

We figured out that the project is almost completed, but we have three main problems to solve:
 * To know how to power the device without using the USB cable as the power supply.
 * To know how connect the device to the computer wirelessly.
 * To figure out an efficient way to attach the device to the shoe.

So, my task was to do research on 'how to power it'. Therefore, I did my researches, and found that the Arduino Micro can be powered via an external power supply, which can come either from a DC power supply or battery. And that leads from a battery or DC power supply can be connected to the (Gnd) and (Vin) pins. Also, I found that the board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The CDIO report of the previous group:[]

Week 2 Narrative
This week, my task was to understand how all the parts of the smart shoe (the accelerometer, the transmitter and the receiver) integrated and worked together with the Arduino to measure the height of a jump. So, I did my research and also went back to the previous group's CDIO report, and understood that the accelerometer ADXL335 that we are using is supposed to measure the acceleration (which should be with a minimum full-scale range of ±3 g). And that it can measure the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration. Then, we are supposed to use the value of acceleration that is read by the accelerometer to find the height of the jump, of course, using the motion equations. And we were glad when we first knew that the previous group already have that code (to measure the height of the jump) written. But, unfortunately, when I tried to use that code after connecting the accelrometer to the arduino, it failed. So, Cora and me had to dig into that code and find what was going wrong. We were able to do that, and modified the code, tested it, and succeeded.

Here is the 'working' code after our modification:

Moreover, I also tried to get the transmitter and the receiver to communicate. In order to do that, I first tried to use the codes from the previous group. But, unfortunately, these codes also failed. So, I did a little bit of research, and tried to find some sample codes to get these parts to function at least (then to modify on the code to benefit the smart shoe). I was able to find some, but the problem is: every time I try a code, I get a similar Error Message, which is: 'vw_setup is not declared'. I tried a lot to find a solution for that error, but it seems to be complicated, and I hadn't enough time last week to finish that task. Therefore, my task for next week will be to solve that error, and get the transmitter and the receiver communicate hopefully.

Week 3 Narrative
For this week, my task was to actually build the circuit to power up the Arduino with a 9v battery. So that is what I did. And to achieve that, I brought:
 * Arduino Uno/micro
 * 9V battery
 * 9V battery snap
 * Switch
 * wires

I also had to use a voltmeter, to make sure of the battery and the connections.

First, I attached the 9V battery to the snap. Then, I connected the the red wire of the snap (the battery's (+) pole) to the 'Vin' pin of the arduino uno. And connected the black wire (the battery's (-) pole) to the Ground pin 'GND'. As shown in the sketch:

But unfortunately, that did not power the arduino up. So, I used the voltmeter to check the battery status. It showed that it was dead. So, I had to replace the battery. Then, I reconnected the circuit, and the arduino started working. After that, I also tried the same circuit with the arduino micro (that we are planning to actually use in our project) and it started working also.

Secondly, in purpose of saving the battery's life, as it is going to be always connected to the arduino micro, I decided to add a switch to the circuit. That way, we can always control when the battery is being used and when it is not. And in order to do that, I connected the (+)red wire from the battery to one of the 3 pins located on the bottom of the switch (but not the one in the middle). And then, I connected a separate wire between that same pin and the 'Vin' pin on the arduino. Next, I connected the (-)black wire to the pin in the middle of the bottom of the switch, and also a separate wire to connect that pin to the 'GND' on the arduino. Finally, I tried the switch, and it worked. The sketch of the circuit:

At the end, I decided not to get all the connections soldered for this time; because I believed that would affect the final shape and the volume the (arduino+battery+switch) would take in the case that Cora is designing. So, I would do that next week when we meet again and discuss the best way to fit with design.

Week 4 Narrative
For this week, I had two tasks to accomplish: First, to accomplish my first task, and based on the circuits' sketches I drew last week, I actually re-built the circuit by connecting the battery to the switch, then to the Arduino Micro. At first, I noticed that the battery and the wires were getting extremely hot each time I connected the battery to the snap, to a point that the snap melted and got damaged. So, I figured out that this can happen if the (+) and (-) wires are touching. Therefore, I made sure that when I re-built a new circuit again to solder all the connections in a way that guarantees the (+) and (-) wires not to touch each other. These are some images to show what I did: And these are images that the circuit controlled by a switch, notice when the switch is off and when it is on:
 * To work on the connections between the battery and the Arduino Micro
 * To work on the connections between the accelerometer and the Arduino Micro, and test its code (to measure the height of the jump).

Second, to accomplish my second task, I also used the electric soldering iron to solder the connections between the accelerometer and the Arduino Micro, as shown in the sketch below and the previous pictures also: After that, to test the accelerometer, I connected the Arduino micro to the computer via USB cable (since the transmitter we have might be broken). Then I uploaded the code we used previously to calculate the jump height, but unfortunately, I kept getting unacceptable results. So, to solve that problem, I measured (read) what the accelerometer reads when it is at rest, by aploading the following code:

The reading was 517. So I went back to the code we used before, and modified it (I wrote 517 instead of 606, which is the previous reading of the accelerometer when at rest). I also changed the sensitivity value of the acceleromoeter from 100 to 250; to make it more appropriate and suitable to the jump sensitivity.

Finally, this is the final code we are going to be using to measure the jump's height by the accelerometer attached to arduino Micro: