Introduction: Arm Flex Sensor Sleeve

Picture of Arm Flex Sensor Sleeve

I am a personal trainer and I have found
through my own experience with exercise as well as through coaching others that strength training is taken to a higher level when we actively engage our muscles during each rep. Too often, we rely on the machine or free weight (we are moving) to do the muscle contraction for us.

This product measures when you are contracting your arm muscles and lights up at our max contraction potential. There are two buttons to set the min and max flexion points that determine how many lights during a specific arm workout. Not only do these buttons and the adjustable strap allow for the sleeve to be used on anybody, but they also allow us to change our min and max points as we get stronger.

While I am working on creating a more reliable flex sensor (the conductive paint used wears with time), this project is a proof of concept of the potential to measure other large muscle contractions while exercising! This can be used to motivate us to actively engage in each rep as well as correct our form if we are not supposed to be using our arms for a specific exercise. Enjoy!

Step 1: Step 1: Collect Materials

1. Bare conductive paint and paintbrush

2. Compression sleeve

3. Elastic band

4. Rope

5. Conductive thread and needle

6. 3 10k resistors

7. 2 Lilypad buttons

8. 4 Lilypad LEDs

9. Alligator clips (a lot)

Step 2: Step 2: Create Flex Sensor

Picture of Step 2: Create Flex Sensor

Cut 2” wide piece of elastic and two 6” pieces of rope

Sew one rope to each end of elastic

Paint one layer of conductive paint on elastic band, being sure to smooth out any uneven paint globs. Let paint dry for 20 minutes or more

Step 3: Step 3: Copy Code

copy this code into your Arduino IDE, with adafruit flora board and serial port selected

/*
SET UP of pins, wires, buttons, and flex sensor flex sensor connected to two leads, one connected to 5V, one connected to an analog pin and a 10kresistor connected to GND push buttons connected to two leads, one connected to GND, one to DIGITAL pin and resistor to 5V (QUESTION: do lilypad buttons need resistors?) LEDs connected to two leads, one to digital pin, one to 330 resistor and GND */

const int stressPin = 6; //analog pin that reads flex sensor --> change to A5 for lilypad int ledPins[] = {1,0,2,3}; //LED pins --> change to 9,10,11,A2 int zero_bottom = 10; //pin which takes in the button to zero the point of minimal flex of the arm //change to 5 for lilypad int zero_top = 9; //pin which takes in the button to zero the point of maximal flex of the arm //change to 6 for lilypad

int startValue; int endValue;

int startPosition; int endPosition; int stressPosition; //Variable that stores the current value from what is read in from the stress sensor

int avg1 = 0,avg2 = 0,avg3 = 0; int avgA = 0,avgB = 0,avgC = 0,avgD = 0;

void setup() { Serial.begin(9600); int index; for(index = 0; index <= 3; index++) { pinMode(ledPins[index],OUTPUT); } pinMode(zero_bottom,INPUT); pinMode(zero_top,INPUT); }

void loop() { startValue = digitalRead(zero_bottom); //when button not pushed value = 1 while(!startValue) { //when not 1, value =0 which sends code into loop to read flex sensor startPosition = analogRead(stressPin); startValue = digitalRead(zero_bottom); //allows the while loop to stop } endValue = digitalRead(zero_top); //same concept here for second button while(!endValue) { endPosition = analogRead(stressPin); endValue = digitalRead(zero_top); } //Averaging avg1 = (startPosition + endPosition)/2; avg2 = (startPosition + avg1)/2; avg3 = (endPosition + avg1)/2; avgA = (startPosition + avg2)/2; avgB = (avg2 + avg1)/2; avgC = (avg1 + avg3)/2; avgD = (avg3 + endPosition)/2; stressPosition = analogRead(stressPin); Serial.println(); Serial.print("Start: "); Serial.println(startPosition); Serial.print("End: "); Serial.println(endPosition); Serial.println(); Serial.print("avgA: "); Serial.println(avgA); Serial.print("avgB: "); Serial.println(avgB); Serial.print("avgC: "); Serial.println(avgC); Serial.print("avgD: "); Serial.println(avgD); Serial.println(); Serial.println(stressPosition); // Sets the LEDS if (stressPosition < avgD){ digitalWrite (ledPins[0], HIGH); digitalWrite (ledPins[1], HIGH); digitalWrite (ledPins[2], HIGH); digitalWrite (ledPins[3], HIGH); } if (stressPosition < avgC && stressPosition >= avgD) { digitalWrite (ledPins[0], HIGH); digitalWrite (ledPins[1], HIGH); digitalWrite (ledPins[2], HIGH); digitalWrite (ledPins[3], LOW); } if (stressPosition < avgB && stressPosition >= avgC) { digitalWrite (ledPins[0], HIGH); digitalWrite (ledPins[1], HIGH); digitalWrite (ledPins[2], LOW); digitalWrite (ledPins[3], LOW); }

if (stressPosition < avgA && stressPosition >= avgB) { digitalWrite (ledPins[0], HIGH); digitalWrite (ledPins[1], LOW); digitalWrite (ledPins[2], LOW); digitalWrite (ledPins[3], LOW); }

if (stressPosition > avgA) { digitalWrite (ledPins[0], LOW); digitalWrite (ledPins[1], LOW); digitalWrite (ledPins[2], LOW); digitalWrite (ledPins[3], LOW); } }

The most important parts of my code:

· avg1 = (startPosition + endPosition)/2;

· avg2 = (startPosition + avg1)/2;

· avg3 = (endPosition + avg1)/2;

· avgA = (startPosition + avg2)/2;

· avgB = (avg2 + avg1)/2;

· avgC = (avg1 + avg3)/2;

· avgD = (avg3 + endPosition)/2;

this part of the code is responsible for setting the four points for each LED to turn on. The first button is pressed at the point of min flexion (straight arm), recording the “start position” value and keeping all the lights off. The second button is pressed at the max flexion (arm bent, bicep muscles contracted), recording the “endposition” value and turning on all four lights. One light, two lights, and three lights will turn on depending on how much your bicep is flexed compared to two set points. Therefore ¼ of your max flexion will turn one light on, ½ will turn two, ¾ will turn three, and your max flexion will turn all four lights on.

Step 4: Step 4: Create a Flex Sensor That Works

Connect one alligator clip to the
flex sensor and to 3.3V on the adafruit board

Connect another alligator clip to the flex sensor (2” away from the other lead) and to a resistor. On the same side of the resistor connect another alligator clip to analog pin D12. On the opposite side of the resistor, connect another alligator clip to GND.

Upload the code to the adafruit

· Make sure you select the adafruit flora board and a serial port

Open the serial monitor and make sure the resistance decreases as you stretch the elastic flex sensor

Step 5: Step 5: Connect Everything With Alligator Clips

Picture of Step 5: Connect Everything With Alligator Clips

Buttons: negative end goes to GND,
positive ends go to resistors connected to 3.3V and analog pins D10 and D6

· Be sure to connect 3.3 V to one side of the resistor by itself and the analog pin and + side of the button to the other side of the resistor

LEDS: negative end goes to GND, positive ends go to digital pins SCL, SDA, TX, and RX

Sometimes (a lot of times) things won't work the first time! troubleshoot each part separately and don't forget to re upload code multiple times, select a different serial port, and pray if you're having trouble!

Step 6: Step 6: Upload Code and Stretch Flex Sensor to Turn on Lights

Press the button connected to D6when flex sensor isn’t stretched to set min

Press the button connected to D10 when flex sensor is stretched to set max

Step 7: Step 7: Sketch Out Design

Picture of Step 7: Sketch Out Design

warning: this step takes time

look at my sketch above which has no wires crossing. feel free to try a new way!

Step 8:

Step 9: Step 9: Sketch Design With Fabric Markers on Sleeve

Step 10: Step 10: Prep and Sew!

Picture of Step 10: Prep and Sew!

Cut sleeve down the middle of the back for easier sewing

Sew on the flex sensor with regular thread

(Be sure to sew on the insides of the rope so that the rope is still free to move)

Bend each side of the resistors with plyers to adapt for sewing

(See tutorial on: https://www.sparkfun.com/tutorials/281)

Sew flex sensor, LEDs and buttons according to circuit design

Step 11: Step 11: Test Out Your Product

Picture of Step 11: Test Out Your Product

Test out code by hooking up sewed on circuit with USB to Arduino code on computer. Make sure this works correctly before you insulate the wires with puffy paint

Attach lipo battery to adafruit microcontroller on sleeve, turn on switch, and disconnect from computer. Your product should now be untethered from the computer!

Step 12: Step 12: Start Flexing!

Sew back together sleeve with sewing machine and voila!

Comments

MsSweetSatisfaction (author)2014-08-17

Very neat project. If you want to get rid some of those extra steps that are empty here's a instructable on how to use the editor: https://www.instructables.com/id/How-to-Make-an-Ins...
Thanks for sharing!

About This Instructable

1,604views

8favorites

License:

More by lpetru01:Arm Flex Sensor Sleeve
Add instructable to: