Knitted Stretch Sensors
Knitted fabrics that integrate conductive yarn will have different amounts of resistance, depending on the size of the sample, the density of the stitches, and the yarns used. Yarns that are partially made up of metal have the unique property that their resistance changes under tension. This happens as the metal fibres in the yarn are pulled together, meaning that the current is able to flow more easily. This essentially creates a variable resistor which can then be used as a stretch sensor.
In the circuit below, the knitted stretch sensor is being used to control the brightness of an LED:
These sensors can be used anywhere a potentiometer would be used instead. Typically the signal is much noisier and harder to control, but you can still get some interesting results! One example project is the knitted synthesisers workshop.
Measuring Change in Resistance with a Voltage Divider
We can't directly measure resistance with an Arduino but we can use a circuit called a voltage divider to measure a specific voltage which we can then use to calculate resistance. Below is the circuit diagram for a voltage divider where R2 is the resistor we are trying to measure and R1 is a resistor of fixed value that we must choose (more on this later).
A voltage divider divides up the input voltage, Vin, proportional to the values of the two resistors, R1 and R2. You can essentially think of it as the resistors sharing the voltage out between the two of them according to their value. The higher the value of the resistor, the bigger the share of the voltage it gets.
If we know both resistor values, we can calculate Vout using the voltage divider equation below:
However, if we are trying to find R2 then we can instead measure Vout and use this to calculate R2.
Example
If we have a circuit with Vin=5V, R1=10kΩ, and R2=10kΩ, then the input voltage would be split in half, giving us Vout=2.5V.
However, if we have a circuit where R1=20kΩ is much greater than R2=1kΩ then the larger R1 gets most of the voltage and we are left with Vout=0.2V.
We can then calculate the value of R2 as we know the values of R1, Vin, and Vout.
Voltage Dividers and Arduino
In this instance, the purpose of using a voltage divider is not to find the exact value of R2, but to measure a changing resistance. Therefore, we don't actually need to do any of these calcuations, we can simply measure the value of Vout and use this as the sensor value as it will vary with the value of R2.
To create a voltage divider with an Arduino, we will need to connect the two resistor together in series between 5V and GND then connect the point between them to an analog pin on the Arduino. Make sure that the variable resistor (e.g. a conductive knit swatch) is in the R2 position as this is the one we want to measure.
#define sensorPin A0
void setup() {
pinMode(sensorPin, INPUT);
}
void loop() {
int val = analogRead(sensorPin);
}
Choosing R1
If you are using a voltage divider to measure the value of R2, the specific value of R1 is arbitrary, as long as it is known. However, if we want to create a sensor using a knitted swatch, the value of R1 will effect the sensitivity of that sensor.
For example, let's say we have Vin=5 and a variable resistor, R2, that varies between Rmin=1k and Rmax=10kΩ.
First lets try the value of R1=20kΩ. Using the voltage divider equation from above we can calculate the values of Vout for the max and min values of R2.
| R2 | Vout | |
|---|---|---|
| Rmin | 1kΩ | 0.2V |
| Rmax | 10kΩ | 1.7V |
This give us a total range of 1.7-0.2 = 1.5V. Now let's try R1=5kΩ
| R2 | Vout | |
|---|---|---|
| Rmin | 1kΩ | 0.8V |
| Rmax | 10kΩ | 3.3V |
This gives us a much better range of 3.3-0.8 = 2.5V.
The larger the range of Vout, the more sensitive the sensor will be. The absolute optimal value is R1 = √ (Rmin Rmax) however, you can also just find the value that is around halfway between Rmin and Rmax.
Measuring Rmin and Rmax
thenIn order to choose R1, we therefore need to know the values of R1, Vin, and Vout. We will know Vin (usually 5V) and we are measuring Vout, so the last one we need is R1.
change in resistance over R2, the the value of R1min mustand be fixed.Rmax. We wantcan to choosedo this valueby someasuring thatour weswatch have the biggest change in Vout as R2 moves from its minimum to its maximum value to make the sensor as sensitive as possible.
Measuring the Resistance
When trialling knit stretch sensors, it's important to know the range of resistances you are working with. You can measure their resistance usingwith a multimetermultimeter.
Attach the crocodile clips to the edge of the sample, and connect the other ends to the multimeter. Move the wheel of the multimeter to the setting with the Ω symbol, and press the 'mode' button until you also see a Ω on the screen.
Once the system is connected, you should see a reading of the sample's resistance on the multimeter. Try stretching the sample and the number should decrease! Therefore, the unstretched reading is Rmax and the stretched reading is Rmin. Note that the letters next to Ω refer to the magnitude: k stands for 'kilo' (x1000), and M stands for 'mega' (x 10,000). You want your sample to be at least a few kΩ for thisthe voltage divider to work.
Making a Voltage Divider
To be able to measure the change in resistance of your knitted sensor, you need to use a circuit called a voltage divider. This consists of two resistors placed in series, meaning that the voltage applied is divided between the two, relative to their resistance. For example, in a voltage divider circuit with two resistors of equal value, the voltage would be evenly split in half between the two. If one resistor had a vastly larger value, it would take up the majority of the voltage and the other would have very little.
WeThese can then measurebe theused voltageto betweenfind the two resistors. If we know theyour value of oneR1. resistorDon't and the voltage being applied across both, we can determine the value of the other resistor. Therefore,worry if wethere haveisn't a variable resistor (like a conductive knitted swatch), we measure the change in resistance.
We can do this by wiring the knitted swatch in series with a resistor and connecting the point between them to an analog pin on an arduino like the diagram below. You can then use analogRead() to measure the value.
To determine the value of the non-variable resistor, first measure the resistance of your conductive swatch as described in the section above. You need to have the range of resistances, so do this with the fabric not stretched then with it stretched. Choose a value for the resistor that is approximately in the middleexact ofvalue theseyou twohave valuescalculated! (e.g.It if your swatch varies between 100 and 200 ohms, your resistor woulddoesn't need to be 150exact, ohms).
Foraround morethe informationright area to give you a good amount on voltage dividers, click here.sensitivity.



