9. E-Textiles and Wearables II#
This week we went further into e-textiles, learning about ATtiny and actuators.
What I Made#
I made a bunch of different e-textile swatches ( ಠ◡ಠ )
ATtiny soft breakout and touch sensor
Thermochromic ink on a conductive thread heating element
More tests with thermochromic ink
AtTiny#
Last time we did e-textiles we used an Arduino Uno, which is a great place to start when working with electronics! this time around we moved on to the ATtiny, a much smaller microcontroller which is slightly less powerful than the Uno, but can still do a lot and only takes a few extra steps to work with.
Setting up#
There are a couple of steps to getting the ATtiny set up and ready to use! We followed Emma Pareschi’s instructions, and all the information you need is there.
Arduino as programmer#
The ATtiny can’t be connected directly to a computer to upload sketches, but we can use the Arduino Uno as a programmer This just means putting the ATtiny onto a breadboard, and using a few jumper cables to connect it to the Uno. Like this:
Within the Arduino IDE, you need to go to the Tools dropdown menu:
- Board: make sure you have the right board selected
- Processor: choose the version of ATtiny you are using
- Clock: select the correct clock speed for the version of ATtiny you have
- Programmer: select ‘Arduino as ISP’
If you have trouble uploading, you may need to add a capacitor between the Uno’s Ground and Reset Pins. I didn’t need to do this with my ATtiny, but others at TextileLab Amsterdam (who were using different variations of ATtiny) did, and they used 10 microFarad electrolytic capacitors, with the + side in Reset and the - side in Ground.
Also, before you upload a sketch to the ATtiny using the Arduino for the first time, go to Tools, and click ‘Burn bootloader’! You only need to do this the first time.
Making a Soft Breakout#
Using a breadboard to program the ATtiny is fine, but as one of the benefits of the ATtiny is its small size, having it stuck in a big rigid breadboard isn’t the ideal scenario for wearable applications. I decided to make a soft breakout for the ATtiny! A breakout is basically small circuit board that makes the pins of your microcontroller easier to access (more on that here), and I wanted something that would make it easier to make connections with alligator clips. For this I used:
- An 8 pin IC socket: this is a little holder which the ATtiny can slot into, allowing it to be added and removed, rather than being permanently stitched in to the circuit.
- Copper conductive thread
- A needle with a large enough eye to fit the conductive thread
- Regular (non-conductive) thread
- A piece of scrap fabric - I chose one that was stiff enough to provide structure, but still easy to sew through.
- Clear nail polish for sealing loose threads
-
Pliers
-
First I used the pliers to bend the legs of the IC socket, so that I could sew them onto the fabric. And apparently forgot to take a picture of this part :)
- Then I sewed a trace for each pin. First I sewed tightly around the leg of the socket, making a good electrical connection between the leg and the conductive thread.
- Then I used a chain stitch to sew a conductive trace all the way to the edge of the fabric.
- At the end of each trace I sewed a few extra stitches to make a reasonably sized conductive pad to clip an alligator clip onto.
- I stitched a trace between the Ground pin of the ATtiny and the negative side of the coin cell battery holder, and did the same for the +5V pin of the ATtiny and the positive side of the battery holder. For the positive trace, I passed the trace through the middle of the socket (which doesn’t come into contact with anything) so that it didn’t come into contact with any of the other traces.
- Using regular cotton thread, I sewed the battery holder onto the fabric, to make sure it was secure.
- Because of the small size of the ATtiny, it was a challenge to make sure none of the traces touched each other, and some are very close together. To prevent short-circuits, and to secure any loose threads, I painted over all of the conductive thread knots with clear nail polish.
- After doing this, I tested all of the connections with a multimeter to make sure no short-circuits had occurred.
Lighting an LED by touch#
To test my ATtiny breakout, I adapted a sketch by David Mellis from the website of the MIT’s High Low Tech group. I used his code with no alterations, and it’s available at the link above!
Preparing to use actuators: MOSFET Circuit#
For most of this week we were making actuators, and pretty much all of these needed a bit of extra circuitry, as they use more current than the Arduino pins can provide on their own. Thankfully it’s not too hard to do this!
Instead of turning a motor, say, on and off by directly connecting it to an Arduino pin, the motor is connected to a separate power supply, and we use a MOSFET - a kind of transistor - to switch on and off the current that flows from the power supply to the motor. We can control the MOSFET using the Arduino!
At TextileLab Amsterdam we built this on a breadboard first, but then a few of us decided to recreate the paper circuit version from the class notes. To do this you need:
- A piece of thick paper or card
- Copper tape (preferably the kind with conductive adhesive)
- A piece of regular tape
- A MOSFET (ours was an IRF530)
- Soldering iron and solder
- Pliers to bend the legs of the MOSFET
- Optional 9V battery clip if you plan on using a 9V battery as a power supply
If you’ve never used copper tape before, I highly recommend this Chibitronics guide, which has some useful tips on how to get it to look nice, make neat corners, and more.
This is the circuit:
And to make it:
- Apply the copper tape in the pattern shown below. Make sure to use a piece of regular tape to insulate the middle and left MOSFET traces from each other.
- Carefully use the pliers to bend the legs of the MOSFET so that they are far enough apart from each other that the copper traces won’t touch, and so that the MOSFET can lie flat on the paper.
- then solder the MOSFET legs and the 9V battery clip to the copper tape.
Actuator 1: Shape Memory Alloy#
The first kind of actuator I experimented with was some flexinol wire. Flexinol is a thin nickel-titanium alloy that contracts when heated, and you can use this to create motion! I took a lot of inspiration and practical advice from Jie Qie’s flexinol origami crane project, where she uses flexinol wire to create origami cranes that have flapping wings.
My most successful experiment was a paper rectangle that I sewed flexinol wire onto in a v-shape. Powered with a 9V battery for a couple of seconds at a time, this curls up nicely (or weirdly, depending on your opinion!). Jie’s method of stitching the wire onto the paper, and soldering the edges to copper tape, works really well in containing the wire while still allowing it to stretch and contract.
First I just powered it with a 9V battery:
And then I controlled it using the ATtiny, contracting it for 1 second, and letting it rest for 3 seconds:
I also tried a couple of experiments to make self-folding origami, using the miura-ori pattern (which I’ve become mildly obsessed with from previous weeks’ projects). So far I haven’t come up with a configuration that works well, but I did learn that if you use too short a piece of wire, and have it sewed in just the right configuration, you can use it to melt cotton stitches. Not exactly what I had planned, but interesting to know (ʘ‿ʘ)
Arduino code#
I used a simple sketch to turn the flexinol actuator on and off. It’s an adaptation of the classic ‘blink’ sketch, but with a longer ‘off’ time to give the flexinol some time to cool down, because we don’t want it to overheat!
void setup() {
//Initialise pin 1 for output
pinMode(1, OUTPUT);
}
void loop() {
digitalWrite(1, HIGH); // On - contract the flexinol
delay(1000); // wait for a second
digitalWrite(1, LOW); // Off - let the flexinol relax
delay(3000); // wait for 3 seconds
}
Actuator 2: Thermochromic ink#
At TextileLab Amsterdam we had a thermochromic pigment that is black at low temperatures, but goes transparent above 27 C. Irene and I experimented with this on cotton canvas - one plain piece, one that had been dyed with hibiscus, and one dyed with madder (from the natural dyes portion of week 4!).
- The ink we used needs to be mixed 50/50 with a binding solution. We didn’t want to use all the thermochromic ink, so we tried using pipettes to remove a few ml of each solution and add them to a bowl. This ended up being a bit messy, but it worked out ok.
- We taped our fabric samples to a silicon mat to avoid staining the table (or rather to avoid further staining the table that we destroyed while doing natural dyes).
- We tried applying the ink to the fabric with a small roller, and also by spreading it with a small piece of acrylic. Using the acrylic worked better, as it distributed the ink more evenly and resulted in less wasted ink than with the roller.
- The instructions we found for the ink recommended ‘curing’ the treated fabric at 160 degrees, so we decided that the quickest way to do this would be to iron them. A quick googling of ‘iron temperatures’ suggested that we’d be near enough to 160 degrees if we set the iron to the ‘wool’ setting.
And it works! I made a few different heating elements to try it out.
Conductive thread heating element#
I made two heating elements with stainless steel conductive thread (total resistance approximately 15 Ohms). One I stiched to a piece of card, the other I taped. Powered via the MOSFET circuit using a 9V battery, these gave these results:
Eeontex heating fabric#
I also had some heating fabric from Eeontex. This requires a higher voltage (minimum 12V for good results!) to heat up properly, and there’s some great documenation here on Adafruit about how to use it. I just tested a small square, but would like to go back to this and try different things.
Actuator 3: Flip-dots#
The third actuator I tried this week was a flip-dot: creating a coil of wire that becomes an electromagnet when current is passed through it, and using this to flip a magnetic bead, depending on the direction of the current through the wire.
Making the coil#
I made a coil of enamelled wire - 60 loops - by wrapping it around a marker and then sliding it off carefully. I secured the coil by wrapping the ends of the wire around it a couple of times. Next it’s important to remove the enamel (which is an insulating layer) from the ends of the coil, so that we can connect them to a circuit. The easiest way to do this is to get a lighter and heat the wire until it turns black. Then wipe off this black residue with your hands, and you’re done!
I made one coil where I just stitched it onto a piece of fabric with purple cotton thread. And another one where I did a kind of blanket stitch around the coil with pink embroidery floss, then used thin copper thread to secure it and the end wires to a piece of fabric.
Making magnetic beads: a first attempt#
As for beads, I tried making my own by lodging a magnet inside a piece of foam, and a blob of hot glue, but these weren’t particularly nice looking. But then Wendy went to a local bead shop and brought back hematite beads! But they turned out to not be particularly magnetic, unfortunately!
But I can at least show that the coils are working:
Making magnetic beads: a second, more successfull, attempt#
A couple of weeks after doing this assignment, I was Christmas shopping in Dublin and came across Formcard - a mouldable, biodegradable bioplastic, that comes in handy card shapes, and becomes malleable when dropped in boiling water. In other words, perfect for making magnetic beads for flipdots!
Formcard turned out to be pretty easy to use. I knew I’d only need a little bit of material, so I cut off a small section. First I tried scoring the material with a craft knife and bending it to snap a piece off. But as the material is slightly flexible, this didn’t work super well. However, using a scissors to cut off a piece of material worked just fine!
I dropped the cut piece of Formcard into a cup of freshly boiled water and left it to soften for about ten seconds. Then I fished it out with a pliers (later switching to a spoon, because that was much easier), placed a small magnet in the centre, and rolled it into a ball with my hands. Then when it was cool, I painted one side black (after testing it to see roughly which part would face directly up/down when current goes through the coil!)
Things I learned while doing this:
- Formcard will only soften properly if the water is very hot. But you can also reheat it as many times as you like to make new things.
- When wet, Formcard will stick to other plastics. It cools and sets quickly, which is nice because you don’t have to wait long to use the thing you made. But it also means you need to work fast!
- The first ball I made was too heavy and didn’t work great, so I dropped it back in the hot water and pulled off some of the material on the outside. Then it worked!
To test my new magnetic ball, I used an adjustable power supply, but you can also use a 9V battery (or maybe even AA batteries, depending on the strength of your magnet, the number of windings your coil has, and the weight of your magnetic ball, among other things!). I tried a couple of different voltage / current settings, but got good results with the voltage set to 6V, and the current to 400mA.
It would be interesting to:
- See what would change if I made the ball smaller
- Try making different coil shapes
- Try attaching thread to hold the ball in place, to see if the flipdot could be attached onto clothing