Step 1: Prepare your tilt sensor
In the first step, Jason and I soldered the tilt sensor to the wires. While I was soldering, Jason held the wire and the tilt sensor together. The soldering process went smoothly. I was surprised how hot the metal and the insulator of the wires got because I initially was holding onto the insulator of the wires. But since it was hot I had to hold it a bit further away.
Step 2: Refine the Code
In the second step, we copied the code to make the tilt sensor print something in the console. Then we modified the code so that there would be a count for the number of reps and after 8 reps, the console would tell you that you’ve done one set of curls.
int SENSOR_PIN = 2; int tiltVal; int prevTiltVal; int count; void setup() { pinMode(SENSOR_PIN, INPUT); Serial.begin(9600); } void loop() { tiltVal = digitalRead(SENSOR_PIN); if (tiltVal != prevTiltVal) { Serial.println("BICEP CURL"); Serial.println(count); prevTiltVal = tiltVal; count += 1; if (count == 9) { Serial.println("YAY YOUVE DONE ONE SET OF CURLS"); count = 0; } } delay(10); }
Step 3: Wear your sensor
In the third step, we used masking tape to attach the tilt sensor and the wire to Jason’s forearm. We had to make multiple adjustments since the sensor didn’t always work properly. But after some trial and error we found out that the sensor works by the movement of some object inside the sensor. The sensor would change from HIGH and LOW (or vice versa) at more than 45 degrees. When Jason’s arm is rotated, nothing happens since the tilt sensor’s object moves up and down from gravity. When Jason shook is hand, the sensor would change from LOW to HIGH constantly. If the wires were held several centimeters away and it was tilted, then the tilt has to be more significant for a change from LOW to HIGH.
Step 4: Bicep Curl Workout
Step 5: Exercise Challenge
For an exercise challenge, I think this device could be used for HIIT (High Intensity Interval Training)
3. Draw your own illustration sketches that showcase how a person would use this interactive training device.