12. Skin Electronics#

This week we learned about applying electronics to skin!

What I made#

I went slightly off track from the assignment for this week, because I got really into the idea of making skin electronics interfaces on my arm. I had a lot of fun this week making two different projects:

A skin touch sensor with conductive paint

all touch sensors

A device that allows you to hear magnetic fields

finished product

Research#

“I don’t want to be human. I want to see gamma rays, I want to hear X-rays, and I want to smell dark matter. Do you see the absurdity of what I am? I can’t even express these things properly, because I have to—I have to conceptualize complex ideas in this stupid, limiting spoken language, but I know I want to reach out with something other than these prehensile paws, and feel the solar wind of a supernova flowing over me. I’m a machine, and I can know much more.

The quote above is from the sci-fi / soap-opera-set-in-space series Battlestar Galactica (the mid-2000’s reboot, rather than the late 70’s original series, to be specific). A Cylon - who looks like a human but is a machine - angrily confronts his creator about why she made him to be a human, with human senses, when she could have given him the ability to sense all manner of things. I was reminded of this when a friend sent me this video:

I also thought of this, where a Buzzfeed reporter got an rfid chip implanted in his hand. I would totally do this is it didn’t require using a big scary needle to get the chip in there:

So for this week I decided to make two different projects that explored a) expanding human senses, and b) adding sensors to the skin

Project 1: Touch sensors on skin#

The idea behind my first project was to use conductive paint to make geometric touch sensors that I could stick to my skin with latex. I originally thought about this for two people: one wearing the touch sensor, and another wearing leds, a vibrating motor, or something else that would be activated by touching the touch sensor on the first person. But this would need a way for the two people to be connected - whether wired or wireless - e.g. by using two Arduinos with Bluetooth modules to allow them to communicate with each other. Doable, for sure, but a good bit of work. So I decided to start by making a system which would be entirely contained on my own body.

My inspiration for this project came from the short story Scanners Live in Vain by Cordwainer Smith. In this story mankind has figured out how to explore space for the first time (this was written in 1950, more than a decade before humans actually went to space). But to endure ‘the horrors of space’, the space explorers, or ‘scanners’, had to disconnect all of their senses except vision - so that’s touch, smell, taste and hearing all cut off.

First prototype#

My plan for the touch sensor was to cast latex on fabric, and paint conductive paint on top of that. The latex allows for the sensor to be easily stuck to the skin, the fabric acts as a scaffold to strengthen the latex (so I can use a thinner layer of latex), and the conductive paint forms part of an electrical circuit that allows touch to be detected.

First conductive paint sensor#

I cast a thin layer of latex on a thin woven fabric, then cut off a piece, and used an acrylic shape (an unused piece from a mould I made for the soft robotics class last week) as a stencil to paint on the conductive paint with a paintbrush. I made sure to cover the entire shape with no gaps separating different parts, to make sure that there was a good electrical connection between all parts. but I didn’t paint the paint on too thickly, because it becomes rigid when solid, and the thicker the layer, the more likely that it’ll crack (which means a break in the circuit and is therefore bad!)

After leaving my sensor to dry for about ten minutes, I connected it up to an Adafruit Gemma with a touch sensing sketch uploaded (more on how all that works below), and it worked! The Arduino sketch turns the onboard LED on the Gemma on when the sensor is touched, and this worked pretty well. When I touched the very tip of the sensor on its own, the LED didn’t turn on, but this could be fixed by adding a thicker layer of conductive paint.

I taped the sensor and the Gemma to my arm and tested this as well:

prototyping collage

Creating geometric touch sensors#

After prototyping, I moved on to making a new design for my touch sensors (now that I was sure the concept worked!). I really really like Lissajous Curves, so I decided to use these as my sensor. I did this by:

Grasshopper definition for Lissajous Curves#

Lissajous curves are a type of very-pleasing-to-look-at-curves that are described by the equations:

x(t)=aSin(\omega t + \delta); y(t)=bSin(t)

You don’t need to know or love maths to make these curves, but I used these equations to make a Lissajous curve generator in Grasshopper.

lissajous generator in grasshopper

The code basically:

I played around with different values of the angle \delta, and the ratio A/B, and ‘baked’ a few curves that I liked into Rhino.

Editing in Illustrator#

Once I had a few curves I liked, I imported them into Illustrator and turned them into outlines, by using the ‘Offset Path’ Function (in Object > Path > Offset Path). I changed the document settings to use mm as the unit of measurement, made each shape 40mm wide, and offset the path of each one by 2mm.

For laser cutting the outlines of the shapes on fabric, I used Pathfinder > unite to merge each shape into just an outline.

different curve files

For both files for laser cutting and vinyl cutting, the stroke weight was set to 0.001, and the files were exported as .ai files, version CS2 (see my week 2 documentation for more on this!).

Laser cutting#

I chose a silver coated canvas for this project. Having also used the same fabric for my modular garment in week 2, I used the same settings:

This cut through just fine. I decided to cut a second set of shapes, at 1.5 times the size, as I was concerned that the lines of my Lissajous curves would be too narrow to create a good touch sensor with conductive paint. But as it turned out, they worked pretty well, and I didn’t end up using the larger shapes.

Vinyl cutting#

The next thing to do was to vinyl cut stencils to place on top of my fabric outlines, so that I could carefully paint conductive paint to create the shape of the Lissajous curves. At Fablab Amsterdam we have a Roland GX-24 vinyl cutter, and Wendy let me use her laptop to communicate with the vinyl cutter, rather than trying to convince the my computer to install drivers for it. I used scraps of silver vinyl, with the settings:

Once the vinyl cutter was finished, I weeded the pieces I didn’t need, and placed transfer paper on top.

stencils ready

Stencilling#

With my stencils ready, the next thing to do was transfer them onto the fabric. This was a little tricky as the vinyl didn’t stick very well to the fabric, but I managed by pulling off the transfer paper slowly, and at an angle almost parallel to the fabric.

Then I used a paintbrush to paint on a thin layer of conductive paint, making sure there were no gaps. I used a pliers to remove the vinyl pieces from the fabric - pinching the vinyl with the pliers lifted allowed me to lift the pieces off without smudging the paint. I did this while the paint was still wet to avoid cracks and tears in the paint, which can happen!

stencil process

Touch sensing with Adafruit Gemma#

Adafruit Gemma is a super small (and cute) Arduino-compatible board that’s designed for wearable projects (mostly ‘wearable’ as in e-textile projects for sewing into fabric, but you can wear it on your skin as well ◕◡◕). Adafruit have a really great and thorough guide to getting started with Gemma, so if you’re using one for the first time, I definitely recommend going and reading it. In summary:

Gemma setup#

Touch sensor code#

I adapted a sketch from Dave Melis at the MIT Media Lab, for touch sensing with an ATtiny. This is a great little sketch that works really reliably (unlike a lot of capacitive touch sensing projects, in my experience!). The Gemma is basically an ATtiny with some added bells and whistles, so I just needed to make a few changes to the code to get it to work with the Gemma.

The code below has also been changed to light a Neopixel instead of a regular LED. When the touch sensor is touched, it toggles on/off two Neopixels. Here’s the circuit diagram:

touch sensor circuit diagram

//This sketch includes parts from:
// - Dave Melis's touch sensor code for ATtiny http://highlowtech.org/?p=1653
// - Adafruit example sketches for controlling Neopixels

#include <Adafruit_NeoPixel.h>
#define PIN 1

Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_GRB + NEO_KHZ800);

int calibration = 0;
int previous;
int togglestate = LOW;

void setup()
{
  //Calibrate the touch sensor!
  for (int i = 0; i < 8; i++) {
    calibration += chargeTime(PB2);
    delay(20);
  }
  calibration = (calibration + 4) / 8;

  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop()
{
  int n = chargeTime(PB2);

// check if the state of the touch sensor has changed
  if (previous <= calibration && n > calibration) {
    if (togglestate == LOW) togglestate = HIGH;
    else togglestate = LOW;

    if(togglestate==LOW) {
      strip.setPixelColor(0,0,0,0); //if touch sensor not being touched, turn Neopixels off
      strip.setPixelColor(1,0,0,0);
    }

    else { // but if they are being touched...
      strip.setPixelColor(0,255,0,255); //Make the first one this colour
      strip.setPixelColor(1,100,0,255); //And the second one this colour
    }
   }

  previous = n; //record the state of the LED - is it on or off
  strip.show(); //Turn the Neopixels on or off!
  delayMicroseconds(500);
}

//This function detects when the touch sensor is being touched
byte chargeTime(byte pin)
{
  byte mask = (1 << pin);
  byte i;

  DDRB &= ~mask; // input
  PORTB |= mask; // pull-up on

  for (i = 0; i < 16; i++) {
    if (PINB & mask) break;
  }

  PORTB &= ~mask; // pull-up off
  DDRB |= mask; // discharge

  return i;
}

Wiring and Powering#

Cold soldering the sensors#

I used more conductive paint to ‘cold solder’ wires to the touch sensors. to make the sensors detachable from the Gemma, I got a couple of long jumper cables (with at least one ‘female’ end), cut and stripped one end, and cold soldered that to the sensor.

cold soldering

Removable connections with Gemma#

To make my components able to be attached and detached from the Gemma, in a slightly neater way than using alligator clips, I first soldered metal snaps to the pads of my Gemma. However, this was a little fiddly, particularly as I needed to solder the snaps to the top of the board, as the bottom would be covered with latex. After trying this out for a few minutes, I decided to come up with a new plan

The second thing I tried, which was more successful, was to use a pliers to pull out the metal pins from a couple of male headers, and solder that to the pins. Although I am only using four of the pins in this project, I soldered a male header to each pin, to make it more flexible in case I want to change the code or the circuit in future.

I also detached an arm from one of the mannequins to figure out where to put the wires, and how much wire I needed! I used flexible silicon wire and jumper cables to make connections between the components.

wiring Gemma

Power#

To power this circuit I chose a small 3.7V LiPo battery. This is enough to power the Gemma, and small enough to not take up too much space on my arm :)

However, it’s very important to be careful with LiPo batteries, as they can overheat and/or explode if damaged. They need to be charged with a special charger, and removed at the first sign that they are heating up, or look visibly damaged.

I’ve also added a bit of tape to the place where the power and ground wires are soldered to the battery - these connections are often very weak and will break off easily, so reinforcing them with some tape or Sugru is a good idea.

Also, after doing all that I ran into a classic problem with capacitive touch sensing, which is that the touch sensor works just fine when plugged into a laptop, but when battery powered, it doesn’t work. I’ve run into this problem before, yet somehow thought it wouldn’t happen this time :)

For now I’m powering the circuit via a micro usb cable from my laptop, but if I have time I’ll try making new sensors (maybe with something more conductive than conductive paint) and see if that improves the situation.

Adding latex and insulating#

To finish the circuit and make it wearable on skin, latex was added to the underside of the components. Instead of making an ‘electronic sleeve’ for my arm out of latex, I decided to just add latex to the bottom of the individual components.

First I painted the bottom of my components with clear nail polish, to avoid any weird reactions between the latex and the metallic components (which can make the latex turn brown and weird). Then I cut circles out of an already-cast-and-dried sheet of latex that Cecilia cast during soft robotics week, and stuck these to the bottom of my hard components with a thin layer of new latex. I left these to dry overnight - you need to leave them to dry properly, as the latex can create short circuits while wet.

insulation

For the sensors, I just painted a thin layer of latex onto them, which was enough to make them stick to my arm. When doing tests on some of my them, I found that - painting a layer of latex on top of my sensors could turn them yellow-ish, which I didn’t want - painting latex on the back side of my sensors mixed with the conductive paint - which is water soluble, and muddied the pattern on the front.

So, I decided to only coat the bottom of my remaining sensors with latex, and first coated them with clear nail polish, which does not re-wet the conductive paint.

touch sensor collage

Final product#

So, does it work? Kind of. Off my skin, on a non-conductive surface, it works just fine:

On my skin, it does work if securely attached. the touch sensor code calibrates to its environment when the Gemma is first turned on, so with the latex on the back insulating it from my skin, it’s able to detect touch. However, I haven’t yet managed to properly attach it with latex (I think I need to use a thicker layer), and taping it on with double sided tape kind of works:

Bonus: Two touch sensors on one Gemma#

I further edited the code to make two of the pins into touch sensors. I didn’t end up using this in my project (because I have limited space on my arm and it was starting to look a bit cluttered with multiple touch sensors), but I’ve included the code at the end of this page if you want to use it.

Project 2: Extending human senses / hearing magnetic fields#

I’m really interested in the idea of ‘enhancing’ humans to allow us to sense and understand different kinds of data, and expand our understanding of the world around us. I’m not sure if it’s a good or bad idea to do this, but I think that some humans

I started to think about how I could turn this into a skin electronics project:

An idea I was interested in exploring was sensing electromagnetic fields. Last year I took part in a hardware hacking workshop by Nicolas Collins, as part of the SOUND CHECK exhibition at Science Gallery Dublin. One nice thing we did in the workshop was ‘magnetic field sniffing’ using an inductor. Like this:

So, I decided to do this, but make it wearable! For this I needed to:

Making inductors#

An inductor is, as far as I’m concerned, one of the most amazing electronic components. It’s just a coil of wire, but has so many uses. In our case, placing the inductor near a magnetic field (from any electrical device) induces a current in the inductor coil. We can amplify this with an audio amplifier, pipe that signal into a speaker, and listen to the magnetic fields!

Inductor material#

I used copper enamelled wire for my inductors (what gauge?). The ‘enamel’ is an insulating coating on the wire, which means it can be wound up into tight coils without creating a short circuit. However, in order to connect the wire to a circuit, you need to remove the enamel from the ends of your piece of wire, either by sanding it, or burning off the enamel with a lighter.

decorative traces

Getting the right inductance value#

The strength, or inductance (measured in Henries / H), of the inductor depends on the radius of the coil, the number of turns, the spacing between the turns, and the material the coil is made of, among other things. So for my device to work, I’d need an inductor in the right range to pick up the magnetic fields of everyday devices like my laptop and phone.

Instead of trying to figure this out form first principles, I googled some circuit sniffing tutorials, and found people recommending inductors between 1000 uH and 10,000 uH. Further googling led me to this inductance calculator, which solved this problem for me. the inductor I eventually used had a diameter of approx 5cm, with 100 turns.

making inductors

Tricky things#

There are a couple of challenging things to take into consideration when making an inductor, as I found out.

Different inductor shapes#

Circular and triangular inductors both worked well, and I tried making a long cylindrical one, but that was harder to secure after winding, and ended up springing out of its neat coil into a big ol’ mess. I also really wanted to make a spiral inductor (which is possible, and there is another calculator for that), but creating a nice flat spiral proved tricky.

different inductors

Amplifying the signal#

With the inductor sorted, the next task was to turn it into sound. Just hooking the inductor up to a small speaker wouldn’t work, as the current picked up by the inductor is too weak to drive the speaker and actually make sound. So, we need an amplifier!

I used a mono amplifier from Adafruit. This is the basic circuit:

amplifier circuit

Putting it all together#

After finishing the prototype, I decided to make a few changes to the design, and then connect it all together.

Decorative circuit traces#

When making my final inductor, I make sure to leave plenty of slack wire at each end, so that I could twist these ends into a sine-wave-ish pattern. The wire thus doubles as functional and decorative, which I like!

decorative traces

/ Making removable connections#

I wanted the inductor to be removable, so that different shapes, diameters, and designs could be attached and tested out. For this I cut up a female-to-female breadboard jumper cable, and soldered the ends to the ends of the inductor wires. then I covered these with heat shrink to protect the solder joints, and to insulate them from each other and prevent short circuits.

removable connections

I also wanted to be able to plug in and out the listening device - earphones, speakers, etc - so I soldered a 3.5mm audio jack to the side of the mono amp that connects to the speaker. A stereo, rather than mono, amplifier would have been even better for this, as a mono amplifier just sends sound to one speaker. But I used what I had ¯_(ツ)_/¯

Adding latex#

As with my first project, I painted the back of my components with clear nail polish, then added latex, to enable them to be stuck to my skin

I did not remember to take good photos of this.

Ideas for further development#

It would be nice to try different inductor shapes and sizes, and see how much the inductance value affects the sounds that can be detected. I’d also like to try reading the signal into an Arduino and visualising the magnetic fields with LED brightness / colour, or using it to determine the vibration speed of a little vibrating motor.

finished product