Introduction: HairIO: Hair As Interactive Material
HairIO: Human Hair as an Interactive Material
Hair is a unique and little-explored material for new wearable technologies. Its long history of cultural and individual expression make it a fruitful site for novel interactions. In this Instructable, we will show you how to make interactive hair extensions that change shape and color, sense touch, and communicate via bluetooth. We'll use a custom circuit, an Arduino Nano, an Adafruit Bluetooth board, shape memory alloy, and thermochromic pigments.
This Instructable was created by Sarah Sterman, Molly Nicholas, and Christine Dierk, documenting work done in the Hybrid Ecologies Lab at UC Berkeley with Eric Paulos. An analysis of this technology and full study can be found in our paper, presented at TEI 2018. In this Instructable you will find comprehensive hardware, software, and electronics documentation, as well as info about the design decisions we made and the struggles we faced.
We'll start with a brief system overview and examples of how to use HairIO. Next we'll discuss the electronics involved, then move to the hardware and creating the hair extensions. The last sections will cover the code and some tips for making modifications.
Links to particular resources will be provided in each section, and also collected at the end.
Step 1: How Does It Work?
The HairIO system works off two basic principles: capacitive touch and resistive heating. By sensing touch, we can make the hair extension respond to touches. And by heating the extension, we can cause color change with thermochromic pigments, and shape change with a shape memory alloy. A bluetooth chip allows devices such as phones and laptops to communicate with the hair as well, either to cause a shape or color change, or to receive a signal when a touch to the hair is sensed.
Example Interactions and Uses
HairIO is a research platform, which means we'd love to see what you do with it! Some interactions we have designed are demonstrated in the videos above, or in our complete video on Youtube.
A shape-changing braid may notify the wearer of a text message by gently tickling the wearer's ear as it moves.
Or perhaps it can give the wearer directions, moving into the field of view to indicate which direction to turn in.
The hair can change dramatically, for style or a performance. The style can morph through-out the day, or update for a particular event.
The hair can also enable social interactions; imagine braiding a friend's augmented hair, then being able to change the friend's hair color by touching your own braid from far away.
All sensing, logic, and control is handled by a custom circuit and the Arduino Nano, worn on the head. This circuit has two main components: a capacitive touch sensing circuit, and a drive circuit for switching power to the braid. A commercial hair extension is braided around a nitinol wire, which is a shape memory alloy. This wire will hold one shape when cool, and move to a second shape when heated. We can train almost any second shape into the wire (described later in this Instructable). Two LiPo batteries power the control circuit at 5V, and the hair at 3.7V.
Step 2: Electronics
Control and Capacitive Touch
The capacitive touch circuit is adapted from Disney's Touché project, via this wonderful Instructable on replicating Touche on Arduino. This setup supports swept frequency capacitive touch sensing, and allows for more complex gesture recognition than simple touch/no touch. One note here is that the capacitive touch circuit and code assume a particular Arduino chip, the Atmega328P. If you choose to use an alternate microcontroller chip, you may need to re-design the code, or find an alternative sensing mechanism.
The control circuit uses an Arduino Nano for the logic, and an analog multiplexer to allow sequential control of multiple braids off the same circuitry and batteries. Capacitive touch is sensed almost concurrently by switching rapidly between channels (so fast that it's basically like we're sensing both at once). Actuation of the braids is limited by the available power. Including more powerful, or additional batteries could enable concurrent actuation, however here we limit it to sequential actuation for simplicity. The circuit schematic provided can control two braids (but the multiplexer in the circuit can support up to four!).
For the simplest version of the circuit, leave the multiplexer out, and control a single braid directly from the Arduino.
Drive Circuit and Thermistor
We perform capacitive touch on the same wire as actuation (the nitinol). This means fewer wires/complexity in the braid, and more in the circuit.
The drive circuit consists of a set of bipolar junction transistors (BJTs) to switch the hair actuation on and off. It's important that these be bipolar junction transistors, rather than the more common (and generally better) MOSFETs, because BJTs lack an internal capacitance. The internal capacitance of a MOSFET will overwhelm the touch sensing circuit.
We also have to switch both ground and power, rather than just power, again for the sake of the capacitive touch sensing, since there is no capacitive signal from a grounded electrode.
An alternate design that uses separate sources for capacitive touch and drive can greatly simplify this circuitry, however it makes the mechanical design more complicated. If the capacitive sensing is isolated from the power for drive, we can get away with a single switch for power, and it can be a FET or anything else. Such solutions could include metallizing the hair itself, as in Katia Vega's Hairware.
The bluetooth chip we used is the Bluefruit Friend from Adafruit. This module is self contained, and only needs to be attached to the Arduino, which will handle the logic around communication.
For batteries, you want rechargeable batteries that can provide enough voltage to power the Arduino, and enough current to drive the nitinol. These don't have to be the same battery. In fact, to avoid browning out the Arduino, we made all our initial prototypes with two batteries: one for control, and one for drive.
The Arduino Nano requires at least 5V, and the nitinol draws a max of approximately 2 Amps.
We chose a 3.7 V battery from ValueHobby to drive the hair, and a 7.4V battery from ValueHobby to power the Arduino. Try not to use regular 9V batteries; they will drain below usefulness within 15 minutes and cause a lot of waste. (We know, because we tried...)
Battery monitoring: a 4.7k Ohm resistor between the power line of the drive battery and an analog pin lets us monitor the charge of the drive battery. You need this resistor to keep the battery from turning on the Arduino via the analog pin (which would be bad: you do not want to do this). The Arduino battery can be monitored with just code -- see the section on software for code demoing this.
Jumper: There's space for a jumper between the two battery connectors, if you want to use a single battery to power everything. This risks browning out the Arduino, but with proper battery selection and some software-based PWM of the drive, it should work. (Though we haven't gotten it to yet.) (If you try it - let us know how it goes!)
Step 3: Electronics Assembly
Putting the Circuit Together
We designed the circuit originally in two parts, connecting the drive and control circuits with a flexible cable. In our integrated PCB version, the circuits are condensed to a single board. The former scheme allows for more flexible placement of braids on the head, but the second is much simpler to assemble. You can find the board schematic and layout files in our Github repo.
There are two ways to make the circuits:
1) hand-make a perf board version with through-hole components according to the schematic,
2) make the PCB from the board file we provide (link above) and assemble with surface mount components.
The bill of materials for the PCB version + braids is here.
We milled our test PCBs ourselves on an Othermill, then ordered our final PCBs from the excellent Bay Area Circuits. Both in-house and professional board manufacturing will work just fine, though hand-plating or soldering all the vias is a pain.
- We used solder paste and a reflow oven or hot plate for the surface mount components, then soldered the through hole components afterwards by hand.
- We recommend the breadboard/perf board version for quick prototyping, and the PCB for reliability.
- We use short female headers to hold the Nano on the PCB, so that it can be removable. Long female headers can be soldered in not-quite-flush to the board in order to lift the bluetooth chip high enough to nest above the Arduino. (You'll also want to add Kapton tape to prevent accidental shorting).
- The bluetooth chip actually needs to be soldered to its male headers upside-down in order to match the pin ordering on the PCB layout. (Of course, you can modify this layout.) Why did we do that? Because it makes the pins match up more nicely to the Arduino layout.
Step 4: Hair Hardware Overview
HairIO is a hair extension braided around two connected lengths of wire, affixed to a connector and a thermistor for regulating temperature. It can be chalked with thermochromic pigments after full assembly. Making a HairIO braid itself consists of several stages:
1) Train the shape memory alloy to the desire shape.
2) Assemble the internal wire by crimping and soldering a length of shape memory alloy to an insulated copper wire.
3) Crimp and insulate a thermistor.
4) Attach the wire and thermistor to a connector.
5) Braid hair around the wire.
6) Chalk the hair.
We will address each of the stages in detail in the following sections.
Step 5: Assembling the Hair Wires
The first stages involve assembling the internal wires that provide shape change and resistive heating. This is where you decide the length of the braid, the desired shape when it is heated, and the type of connector you will use. If all the braids have a common connector type, they can be easily swapped out on the same circuit board for various shape and color actuations, as well as types and lengths of hair.
If you do not want shape change in a particular braid, the shape memory alloy can be replaced with a length of regular wire. If you want to support capacitive touch, the replacement wire should be uninsulated for best effect.
Training the Shape Memory Alloy
The shape memory alloy we use here is nitinol, a nickel-titanium alloy. When cool, it remains in one shape, but when heated it returns to what is called the "trained" state. So if we want a braid that curls when heated, it might be straight when cool, but be trained to a curl. You can create almost any shape that you want, though the capability of the wire to lift weight is limited by its diameter.
Cut the nitinol to the desired length of the braid, leaving a little extra for the curves during the braiding, and for connections at top and bottom.
To train nitinol, see this fantastic Instructable.
Braid types we have experimented with include curls, right-angle bends to allow the hair to stand up straight, and not training the nitinol at all. This may sound lazy, but it allows the hair to straighten out of any shape when actuated. The wire will hold a shape you bend it into when cool, e.g. a curl, then straighten out of that shape when heated. Super cool, and much easier!
Assembling the Wires
The nitinol is uninsulated, and runs only in one direction. To create a complete circuit, we need a second, insulated wire to connect at the bottom and return to the connector on top. (An uninsulated wire will cause a short circuit when it touches the nitinol, and prevent even heating.)
Cut a length of insulated copper wire to the same length as the nitinol. We used 30 AWG magnet wire. Remove the insulation at both ends. For magnet wire, the coating can be removed by gently burning the wire with an open flame until the insulation chars and can be wiped away (that takes about 15 seconds w/ a lighter). Note that this makes the wire slightly fragile at the burnt location.
Fun fact about Nitinol: Unfortunately, solder doesn't like to stick to nitinol. (It's a huge pain.) The best solution is to use a crimp to create a mechanical connection to the nitinol, then add solder to ensure an electrical connection.
Hold the end of the nitinol and the newly uninsulated copper wire together, and insert into a crimp. Crimp them solidly together. If additional connection strength is needed, add a tiny bit of solder. Cover the crimp and any remaining tail of wire with heat shrink so your wearer doesn't poke themselves with the pointy ends. It doesn't matter what kind of crimp you use at the bottom, since it is purely to make a mechanical connection between the two wires.
At the other end, we will add a crimp to each wire tip. Here, the type of crimp matters. You must use the mating crimp for your connector. These ends of the wires will be attached to the connector for interfacing with the circuit board.
Making a Stand-Up Braid:
The braids can be very subtle, or very dramatic. If you want a dramatic effect, as the headdress picture above, or in the performative situation video earlier, one additional step is needed. The braids prefer to twist rather than lift, so they must be braced to stay in the right orientation. Our brace is shaped like a stretched-out Z (check out the picture). We slipped a crimp on the nitinol, then soldered the brace to the crimp, and finally covered the whole thing in heat shrink and electrical tape.
Preparing the Thermistor
The thermistor is a heat-sensitive resistor that lets us measure the temperature of the braid. We use this to make sure that the braid never gets too hot for the user to wear. We will add the thermistor to the same connector that the braid will be attached to.
First, slide heat shrink onto the legs of the thermistor and use a heat gun to shrink it down. This will insulate the legs, to prevent the thermistor from shorting to the uninsulated nitinol. Leave a little bit of wire exposed at the end for a crimp. Again, these crimps must be the appropriate ones for your connector.
Crimp the ends of the thermistor. If you can, get a little bit of the heat shrink into the first teeth of the crimp as strain relief. Don't put too it all the way up though, since the wires must still connect for a good electrical connection.
Now the thermistor is ready to be attached to the connector.
Assembling the Connector
You can use any kind of 4-terminal connector at the top of the braid; after some experimentation, we decided on Molex Nanofit connectors. (This is what our PCB uses.) They have a low profile on the circuit board, a solid mechanical connection with a clip to keep them locked in, but are still easy to insert and remove.
The Nanofit connectors go together in three stages:
First, insert the two crimped ends of the thermistor into the two centermost receptacles on the male half of the connector.
Next, insert the two crimped top ends of the braid wire into the left-most and right-most receptacles on the male half of the connector.
Once these are in place, insert the retainer into the receptacles. This helps hold the crimps in place so the braid doesn't pull off the connector.
The female half of the connector is on the circuit board, and connects the hair terminals to the drive circuit and capacitive touch circuit, and the thermistor terminals to the Arduino for temperature sensing.
Ready to Go
Now, the wire is ready to be braided.
Step 6: Braiding and Chalking
There are several ways to braid the hair extension around the internal wires. For capacitive touch sensing, some wire must be exposed. However to have a completely natural looking braid, and hide the technology, the wire can be braided entirely on the inside. This kind of braid can't do effective touch sensing, but it can still actuate with dramatic color and shape change.
Braid Style 1: 4-Strand for Capacitive Touch
This braid tutorial will show you how to do the 4-strand braid. Keep in mind that in your case, one of the "strands" is actually the wires! Check out the pictures above for our braiding setup, following the 4-strand pattern with three hair strands and one wire.
Braid Style 2: Invisible Wires
In this braid you do a three-strand braid (this is what most people think of when they think of "a braid"), and you just bundle the wires in with one of the strands. Here's a great tutorial for a three-strand braid.
Chalking with Thermochromic Pigments
If you wish a braid to change color when it is actuated, it must be chalked with thermochromic pigments. First, hang the braids up on something, above a plastic-covered table (things will get a little messy). Follow safety instructions for your thermochromic ink (wear gloves if necessary!). Definitely wear an air mask - you never want to breathe any particulate matter. Now, take a pain brush, and scoop some thermochromic powder onto your braid, starting at the top. Gently "paint" down the braid, brushing the powder into the braid as much as possible. You'll lose some (but if it falls on your plastic table cloth you can salvage it for the next braid). You can watch the timelapse we've shared above to see how we did it!
Step 7: Wearing the Tech
The circuitboards and batteries can be mounted on a headband, or hair clip. Alternatively, for a more subtle style, the braids can be made with longer wires at the ends. These wires can be routed beneath natural hair, hats, scarves, or other features to another location on the body such as beneath a shirt or on a necklace. In this way, the hair is less immediately noticeable as a wearable technology.
The circuitry can be shrunk down, with additional revisions and integrated logic and bluetooth chips. Such a smaller circuit would be more easily hidden on a decorative hair clip, etc., however power will remain an issue, since batteries at the moment only get so small. Of course, you could plug it into the wall, but then you couldn't go very far.
You can see a super early prototype being worn in the video above. (More images of the final enclosures to be added after a public demo.)
You'll soon be able to find a 3D printable enclosure for the circuitry in our github repo. This can be slid onto a hairband, or modified for other form factors.
Step 8: Software Overview
In our github repo you will find several Arduino sketches demonstrating different ways of controlling the hair.
Sketch 1: demo_timing
This is a basic demo of the drive functionality. The hair turns on and off in a set period of seconds, and flashes the onboard LED when on.
Sketch 2: demo_captouch
This is a demo of the capacitive touch sensing. Touching the hair will turn on the onboard LED. You may have to adjust the capacitive touch thresholds depending on your environment and circuit.
Sketch 3: demo_pcb_bluetooth_with_drive_captouch
An integrated demo of bluetooth communication, capacitive touch sensing, and drive. Download the Bluefruit LE Connect app on a smartphone. The code will send a bluetooth signal when the braid is touched, printing the result to the app. Pressing buttons on the controller in the app will start and stop the actuation of the braids. Note that the pinouts are set up for our PCB version. If you have connected the multiplexer INH pin to a digital pin as in the PCB schematic, you may have to add a line in the code to drive that pin low (we just shorted it to ground).
This code also includes a calibration method, triggered by sending a "c" character via the UART interface in the app.
Capacitive Touch Calibration
Because capacitive touch sensing is sensitive to environmental factors such as humidity, or being plugged into a computer or not, this code will allow you to determine an appropriate threshold value for accurate capacitive touch sensing. You can find an example of this in the demo_pcb_bluetooth_with_drive_captouch code. One note is that capacitance also changes with heat. We have not yet handled the issue where heat after actuation triggers the "touched" state.
Examples of battery monitoring are in the demo_pcb_bluetooth_with_drive_captouch sketch. The onboard LED will light up when one battery's charge drops below a certain threshold, though it does not distinguish between the control battery and the drive battery.
Temperature Interlock (Safety Shut Off)
Monitoring the temperature of the braid lets us shut off the power if it gets too hot. This data is collected from the thermistor woven into the braid. An example of this can be found in the demo_pcb_bluetooth_with_drive_captouch sketch.
Step 9: Loading and Modifying the Code
We use the standard Arduino environment to write code for HairIO, and to upload it to the boards.
Arduino Nanos can be obtained from several sources; we bought these, which require additional firmware to operate with the Arduino environment. You can follow these instructions to set them up on your machine. If you use a standard Arduino Nano (i.e., these) you do not need to do that extra step.
When modifying the code, make sure that your hardware pins match your circuitry. If you do change a pin, make sure to update your board design and code.
It's important to note that the Illutron capacitive touch library we use relies on a particular hardware chip (the Atmega328p). If you want to use a different microcontroller, make sure it is compatible or you will have to modify that code. (We didn't want to get into that low-level of code for this project, so we deeply appreciate Illutron's work. Syncing with hardware timing can get pretty hairy!)
Step 10: Future Designs: Ideas and Guidelines for Modifications
- If you'd like to know more about the heat response behavior of the braids, you can find mathematical models of the hair in our paper. They key thing is that the color and shape change will actuate at different times and in different orders based on the amount of insulating hair around the wire, and the amount of power supplied (which changes how fast it heats up).
- Shifting the bluetooth module to the right may allow you to make the stacking height shorter, since it won't run into the Arduino USB connector. There are also Arduino boards w/ integrated bluetooth modules (but most of them have a different chip so using them would involve code changes).
- The battery connector footprints may change depending on the types of batteries you use.
- The switch footprint is generic and should probably be replaced with the footprint of what you want to use.
- You might want to be able to PWM the drive circuit to control the power through the braid; to do so the drive signal pin should be switched to D3 or another hardware PWM pin.
- If you invert the multiplexer pairings (e.g. braid1 drive and braid2 touch on channel 0, and braid2 drive and braid1 touch on channel 1, instead of both touch and drive for the same braid on a single channel), you will be able to sense capacitive touch on one braid while driving the other braid, instead of being prevented from doing any capacitive sensing at all while anything is driving.
- Some modifications might allow one battery to control both logic and drive. Several considerations include:
- High voltage (e.g. a 7.4 LiPo battery) will backdrive the Arduino through the capacitive sensing circuit and digital pin. This is not good for the Arduino in the long term. This might be fixed by including another transistor between the capacitive sensing circuit and the hair.
- Too much power draw by the hair may brown out the Arduino. This might be fixed by PWM'ing the drive signal.
- Swept frequency capacitive touch sensing can be used to detect many types of touches, e.g. one finger or two, pinching, twirling... This requires a more complicated classification scheme than the basic thresholding we demonstrate here. Capacitance changes with temperature. Improving the touch sensing code to take this into account will make sensing more reliable.
Of course, if you make a version of HairIO, we'd love to hear about it!
Step 11: Safety Notes
HairIO is a research platform, and is not meant as a commercial or daily use product. When making and wearing your own HairIO, please be mindful of the following considerations:
Since HairIO operates by resistive heating, there is the possibility overheating. If the thermistor fails or is not close enough to the braid, it may be unable to properly read the temperature. If you do not include the temperature shut-off code, it may heat further than intended. While we have never experienced burns with HairIO, it is an important consideration.
In HairIO, we use LiPo batteries as our power sources. LiPos are great tools, since they are rechargeable and can deliver high current in a small package. They also should be treated carefully; if improperly charged or punctured, they can catch on fire. Please see these references to learn more about caring for your LiPos: thorough guide; quick tips.
The ones we use are nontoxic, but please don't eat them. Read the safety guides for whatever you buy.
Step 12: References and Links
Here we collect the references and links in this Instructable for easy access:
HairIO: Human Hair as Interactive Material - This is the academic paper in which HairIO was first presented.
HairIO Github repo - Here you will find a git repo of all the schematics and code used for this demo, as well as some datasheets for important components.
Youtube - See the hair in action!
LiPo Battery Safety
Other Hair-Related Tech
Hairware, Katia Vega
Fire, The Unseen