Just to be clear: This is easy to do. If eTextiles sound difficult and scary, don’t worry: you, your younger sibling, grandparent or child are all equally qualified to making the sensor (hooking up the sensor to a computer requires you to have some basic knowledge of using Arduino or similar platform. If you don’t, find a friend who has spent more than 20 minutes playing with an Arduino, they will be able to sort the rest). If you find me too wordy, go and look at the pictures and build your sensor already.
In this tutorial I describe how to make a differential pressure sensor using only fabric. Every part of this sensor is made of fabric. Often fabric sensors will require some type of external electronics such as a voltage divider. In this design even the voltage divider is fabric. All you need is connect VCC, GND and Signal and you are ready to go.
The other interesting feature is that it is a differential sensor. This basically gives you (almost) two sensors for the cost of one. The differential sensor has two pressure pads. If one of them is ignored, it acts as a regular pressure sensor. It can also act as a dual pressure sensor: if the pad connected to GND is pressed the voltage output sinks, if the one connected to VCC is pressed, the voltage output rises. Finally the sensor can also be used to measure the difference of two pressure levels: subtract 512 from the incoming signal. The larger the magnitude of the number you read, the larger the difference in pressure and the sign (+/-) tells you which of the two is heavier.
So, not only do we get a sensor that is made completely of soft and malleable materials, we also get a super versatile gadget, capable of all kinds of cool stuff.
If you have worked with eTextiles, but are rusty on electronics, jump directly to step 4.
If you have some basic understanding of resistance based sensors, skip step 4.
If you just want to build the sensor already, jump ahead to step 5 (personally I would skip ahead to step 5 and then revisit the first couple of steps only after I’ve built the thing and it doesn’t work and then realize that if I had not skipped ahead I would have understood it better, knowing well that that’s just not how my brain works.)
Step 1: Context
Nothing happens in a vacuum. This tutorial would not exist without previous work by others. While a large number of people have done really cool textile work, Hanna Perner-Wilson, Maurin Donneaud, Cedric Honnet, Rachel Freire and David Holman are all in some way responsible for me coming up with this little widget. All of them do really cool work, if you have not stumbled across their stuff, click the links above and check them out.
Step 2: Methods & Tools
For those of us coming into functional textiles with an electronics background, switching to textiles may appear a bit intimidating. At the end of the day, we are dealing with the same underlying physical principles so a lot of the concepts stay the same, it’s just the materials and tools that change.
Rigid Electronics - Soft Circuits
Breadboard - Fabric
Cables - Conductive Fabric
Resistors and other components - ‘Smart’ Fabric
Solder - Conductive Thread
Glue Gun - Lining Glue & Iron
Soldering Iron - Sewing Machine
Step 3: How It Works
The Eeonyx material is often described as piezoresistive. This means that the resistance drops if you apply pressure to it. The way I like to think of it is that the resistance is a function of the work that an electrode needs to do to move from molecule to molecule. If molecules are far apart, the electrode needs to jump super far, this is a lot of work and causes a lot of resistance. If the molecules are close together the electrodes don’t need to jump so far, so the resistance is less. If I apply pressure to the eeonyx, this moves the molecules closer together, and the resistance sinks. If I remove the pressure the molecules move away from eachother and the resistance rises.
(Please think of my explanation as a metaphor. It helps me work with this type of material, even though I know that at least part of it is explicitly wrong. If you ever find yourself explaining piezo-resistance to a physicist and use my metaphor, you will most likely be laughed at. But for now, let’s run with it.)
I am trying myself with some ASCII art. This is how to interpret it
- | and -----will indicate electrical connections (or cables)
- /VVVVV is a resistor (their values are in the line above them)
- Numbers are used to indicate points at which we measure the voltage
Most platforms used for electronic prototyping come with a voltage regulator that keeps the voltage constant.
Let’s say we build a little circuit using our regulated power source (5v constant voltage) and a resistor, like this:
+5v ---------1-------- /VVVVV---------2-------- GND
If we measure the Voltage over the resistor (from point 1 to point 2) we will measure 5V. Now let’s increase the voltage. Like this:
+5v ---------1-------- /VVVVV--------2------ GND
If we measure from 1 to 2, we still measure the same 5v. What happens is that the current decreases (but that’s a pain to measure, so just take my word for it or remember: I = V/R).
If, instead of replacing the 2kOhm resistor with a 4kOhm resistor, but instead use 2x 2kOhm resistors something interesting happens:
2kOhm . . . . . . . . . . . .2kOhm
+5v -------------1-----------/VVVVV--------2---------/VVVVV----------3---------- GND
If we measure the voltage from point 1 to point 3, we measure 5v (because its constant, it cannot be anything else. If however, we measure from point 1 to point 2, we only measure 2.5v. If we measure from point 2 to point 3 we mesure 2.5v as well.
Lets change it up some more and replace one of the 2kOhm resistors with a 4kOhm resistor.
2kOhm . . . . . . . . . . . . . 4kOhm
+5v -------------1-----------/VVVVV---------2----------/VVVVV---------3---------- GND
Now, if we measure from 1 to 2, we should measure 1.67v if we measure from 2 to 3, we measure 3.33v. The total voltage sums up to 5v again. If we flip the order of the resistors, the voltages we measure will also flip.
What we have learned here is: The overall voltage in a circuit with a constant voltage supply will always be the same, however, we can split up the overall voltage into two parts, using two resistors. The voltage that is measure between the resistors is related to the proportions between the resistances of the two resistors. This is cool, because we can measure this voltage using one of the ADC channels (Analog Inputs) of our microcontroller (or Arduino, Teensy or whatever happens to be your weapon of choice).
Now Imagine this:
| . . . 10kOhm
+5v ---------------------- EEONYX--------I-------/VVVVV------------------ GND
The above circuit is a pressure sensor. If you press on your EEonyx, the resistance changes, causing the voltage measured by the analog input to change. The above circuit however, still requires a rigid element. But we can easily replace the remaining resistor with another piece of Eeonyx. And Voila, we have a differential pressure sensor, that can be made out of 100% textile materials:
+5v ---------------------- EEONYX--------I-------EEONYX ------------------ GND
Step 4: Preparation (Tools & Materials Needed)
- Conductive Textile - For example Ripstop Berlin (about 2 by 2 inches or 5 by 5 cm)
- Piezo Resistive Textile - For example - Eeonyx 20k piezoresistive fabric (about 2 by 1 inches, or 5 by 2.5 cm) available from Sparkfun in the US and HITEK Electronics in Great Britain
- Regular fabric - Anything that pleases you aesthetically will do (or whatever you happen to have... about 25 by 10 cm)
- Bonding Glue - For example from Amazon (about 25 by 10 cm - make sure its the paper-backed variation)
- Wax Paper (Optional, but recommended)
- 3 crocodile cables + 3 jumper cables
- 1 Arduino + USB Cable
Step 5: Preparing Conductive Fabric and Sensor Backing
Conductive Material (Rip-stop)
Cut a piece of rip stop ~ 5 by 15 cm. This will be what we build the circuit out of. You'll find it super thin and somewhat annoying to work with. To make it bit more rigid, I start by ironing on a layer of the bonding glue. I do the same for the backing of the fabric.
I try to have a piece of wax-paper between the fabric and the ironing board and between the fabric and the iron. Once glue gets on the Iron its a pain to remove (I think alcohol should do the trick, but I'm not sure).
Top & Bottom Layer
Cut two strips of non-functional textile ~ 5 by 30cm. These will be the structural material of our sensor. One of them (the bottom layer) gets the same glue treatment that we just gave the rip-stop
Step 6: Cutting the Circuit
Our Circuit has three main elements:
- A pad that connects to GND
- A pad that connects to +5v
- A large pad that connects to an Analog Input of the Arduino and that will connect to the other two pads via the Eeonyx piezo-resistive fabric.
I sketched them out roughly on the 'sticky' side of the conductive textile and then just cut them out free-hand.
Go ahead and make your own layout, if you're confused about what layouts work and which ones don't go check out my explanation in Step 4
Step 7: Gluing the Layers Together
When ironing the bonding glue, I recommend you put a sheet of wax paper between your sensor and the work surface and between your sensor and your iron. Getting glue on the iron is not fun.
- Place the GND and +5v pads
- Place the resistive fabric
- Place the Signal pad
- Put your assembled sensor on the backing fabric
- Cover with Glue
- Add the top fabric
- Iron it all together
Step 8: Crimp on a Header
Step 9: Connect to Computer and Test
Connect +5v on your sensor to +5v on your Arduino (or +3v if that is that is the voltage your operating at). Connect GND on your sensor to GND on the Arduino. Connect the Signal sheet to your Analog Input. A simple way to do this is using crocodile clips.
Open your Arduino IDE. Go to Examples/Basics/AnalogReadSerial and upload that code to your Arduino. Open up your serial monitor (the Serial Plotter is also a usefull tool for this. Thanks for that, Henning Pohl), and see if you like the output. If you don’t tinker with it until you’re happy
If you’re happy, put some bonding glue in between the top and bottom layer (except for where the conductive material touches the Eeonyx) and iron the sandwich together.
Thats about it. If you have questions, please post them here, so I can improve the tutorial. Thanks for reading.