Documentation:
Step 1: We soldered the electronic parts (the wire and the sensor together).
Step 2: We connected the tilt sensor to the breadboard and that to the Arduino Uno to begin coding.
Step 3: Then we re defined the code that was given to us in the recitation instructions and checked if the sensor worked.
Step 4: Once we checked the sensor, we taped it onto Vicky’s arm and ran the code.
Step 5: Try different things to test out the code.
Serial monitor in action
Since I wasn’t able to get good photos of myself, I took a video of one of my partners Tina doing the action of a bicep curl to test the sensor. From this video I took two screenshots (one when her arm was fully extended and one when her arm was curled) which showed that its going to range from a 172 degree angle to a 32 degree angle.
Videos of the process:
Uses for the device:
Some potential uses for a device like this, other than bicep curls, could be other lifting exercises such as deadlifts or squats. Not to mention it could be used to count strokes on a run, which can also help estimate the distance one has ran or walked during a workout.
Reflection:
Some things that I noticed about the behavior of the sensor was that it was very sensitive so it sometimes counted multiple bicep curls if we moved our arm too fast, so if this were a product the warning on it might be to go slow. Another thing to note was that if the sensor is shaken, nothing happens to the counter. When we shook the counter up and down sometimes the counter would count, but side to side there was little to no effect unless we intentionally changed the direction in which the sensor was moving. Personally, I think that this sensor could have many uses in the workout industry. Actually, modern watches already have implemented technology like this one that counts steps, measures movements, and tracks paths. If I were to re-make this project, perhaps I would add a buzzer that beeps every time a bicep curl is complete.
The Code:
*placed at the end due to formatting issues*
int SENSOR_PIN = 2; int tiltVal; int counter=0; void setup() { pinMode(SENSOR_PIN, INPUT); Serial.begin(9600); } void loop() { tiltVal = digitalRead(SENSOR_PIN); Serial.println(tiltVal); delay(10);put your setup code here, to run once: { if(digitalRead(SENSOR_PIN) == HIGH) {for(int counter = 1 ; counter <= 10; counter = counter +1) digitalWrite(SENSOR_PIN, HIGH); delay(250); digitalWrite(SENSOR_PIN, LOW); delay(250); } else { digitalWrite(SENSOR_PIN, LOW); }
Leave a Reply