13. Skin Electronics¶
Results¶
Experiment 1: a public transport chipcard that can be used as skin electronics, Loes Bogers, 2019
--------¶
Experiment 2: glowing neopixel crystals, to embed into a wig or headpiece (I didn't do this in the end because I quite like the wearable public transport chipcard idea, Loes Bogers, 2019
Material explorations¶
I started this week by doing some material exploration based on inspiring projects before settling on an idea. So I tried out a few things that are within reach (within reason). I will see what works out well and then continue one or more of the ideas.
We had a table full of amazing hair pieces, make-up, lashes, gems, glitters and stuff people had brought from home. I was totally in my element.
Fabulous, pic by Bea Sandini, 2019
Embedding crystals in a hair piece¶
I really enjoyed earlier work growing capacitive alum crystals with Bare conductive ink (week 9), so to start here, I tried growing a clear alum crystal on top of an RGB LED board, I grew black diamonds (capacitive crystals) on a string of conductive thread, and a fake mustache, using the instructions I described already in week 9.
I thought about growing them directly on (synthetic) hair, but that would also turn the hair into a scaffold and make it very stiff. So I decided to make strings that I can work into a wig for example (I have very short hair :D).
Growing the sensor: black diamonds The crystal on the string grew beautifully: as one solo crystal with a gorgeous shape. Very happy. The mustache is a bit of a mess, I might not use it. The last time I made these, one cluster broke in two as I tried to embed it into a swatch. To prevent this one from coming off the string I put a crimp bead at the bottom so it cannot slide off.
A new batch of black diamonds, Loes Bogers, 2019
Growing crystal LED boards
Then I experimented with several techniques to try and grow a clear alum crystal on the LED of an RGB neopixel. Ideally I'd finish with a neopixel that:
- has a beautiful big crystal or cluster in the middle of the LED
- and covering the surface of the board
- leaving the contacts clear for connecting
- doesn't fall apart :)
I got quite good results after some trial and erroring! Bea had a good idea of glueing silk on to give it a mesh to attach too. This had been a very successfull substrate before, resulting in huge crystals.
Four techniques, from left to right: 1) sanded and metal wire, 2) silk and conductive thread, 3) silk and plastic string, and 4) seed crystal glued to top, Loes Bogers, 2019
NR | SURFACE | SUSPENSION | METHOD | RESULTS |
---|---|---|---|---|
1 | sanded LED pocket | suspended with metal wire | add while solution is hot | very little growth |
2 | hotglued silk to top | suspended with conductive wire, soldered | add while solution is hot | clusters of small crystals all around board and on wires, chip still accessible due to presoldered wires. But circuit is shorted!! |
3 | hotglued silk to top | Plastic string | add while solution is hot | clusters of small crystals all around board, not on string, chip accessible after carefully breaking off some crystals from the back |
4 | hotglued seed crystal to top | Sitting on bottom of jar | add while solution is lukewarm* | clusters with even smaller crystals, forming a halfdome around top half of the board, botom half still clear of crystals and accessible electronics. |
three neopixels with seed crystals hotglued on top, Loes Bogers, 2019
* the seed crystal dissolves if you put it in while the water is too hot. Do not put it in until it's luke warm, but also not too cold because then the crystals have already started forming and are less likely to attach to your seed crystal. Find a sweet spot. I compare it to tea: if it's nice and hot and you'd drink it. It's too hot. If it gets to the point where you think "I have to drink it now, if I wait a minure longer it will be cold" that's a good moment to put the crystal in :)
Such beauties! clockwise, starting from the top: 1) sanded, suspended with metal wire, 3) sild and plastic string, 2) silk, conductive thread, 4) seed crystal sitting on bottom of jar, Loes Bogers, 2019
Clearly, for this purpose, NOT suspending the board had the advantage of keeping the back of the board clear of crystals so it's still possible to solder the pads after. But at the same time forming a beautiful strong cluster in the shape of a dome on the top of the board. The crystals are smaller with the seed crystal than with the glued silk though. It would be worth trying the silk technique in combination with letting the board sit on the bottom. So I did a few of those too, and some looked pretty nice.
Important!: when you are not suspending the substrate in the solution, but letting it sit on the bottom, you have to take it out on time. I let them grow for about 2 hours before I took them out. I left a few overnight and they were just one big hard rock the next day. So really time when you should be taking them out and use transparent cups so you can monitor the process.
Left: bottom of the board with the seed crystal is totally clean, with the others I had to carefull break away some crystal clusters to free up the connector pads again. This makes the clusters weaker and easier to break altogether, Loes Bogers, 2019
Hooking up the neopixels
I followed the Adafruit neopixel hookup guide
Install Gemma board etc
I used this guide to install the Arduino SAMD board support and the Adafruit SAMD
Install Adafruit_NeoPixel via Library Manager
From the Sketch menu, > Include Library > Manage Libraries... In the text input box type in "NeoPixel". Look for "Adafruit NeoPixel by Adafruit" and select the latest version by clicking on the popup menu next to the Install button. Then click on the Install button. After it's installed, you can click the "close" button (Source
Schematic using Gemma
I hooked up the RGD neopixels like so, following the instructions in this tutorial
Hooking up neopixel to Gemma board, image via Learn.Adafruit.com
Simple code test
select Sketchbook→Libraries→Adafruit_NeoPixel→strandtest
(If the Adafruit_NeoPixel rollover menu is not present, the library has not been correctly installed, or the IDE needs to be restarted after installation. Check the installation steps above to confirm it’s properly named and located.)
Select your board type and serial port from the Tools menu, and try uploading to the board. If the NeoPixels are connected and powered as previously described, you should see a little light show.
My Gemma didn't show up and I was getting a bit fed up so I continued to develop the code on my Arduino Uno and I'll transfer it later. With the UNO, I could upload the strandtest and see the working LEDs. That all worked fine so I proceeded to solder up my LED crystals so I could connect them and see how the light is being filtered through the alum.
Soldering
It turned out to be quite challenging to hook all these babies up. One crystal crumpled while soldering, and the one with the conductive thread attached turned out to be totally shorted. Meh. So in the end I had 3 left. Two of them work fine, but one just won't light up yet and needs some debugging. The signal connection isnt very stable but also hard to reach.
What is important is that each GND and 5V pad will have two wires attached (one going to the previous pixel and one to the next). So plan your soldering and connect both at once. I didn't go through-hole because the crystal prevented me from pushing the wire through, so I just soldered solid core wires to the top of the pad. Fine in most cases but one I guess (where it did go through but then didn't make a good connection, ugh).
Not easy to solder, but a bit of paper underneath helped a lot, Loes Bogers, 2019
RGB colors?
I refreshed my knowledge of making colors with an RGB LED. This tutorial explains how to pick a color and then recreate it with an RGB LED. Then I went and found some nice code for a fading LED using a sine wave (that's a very nice way of fading I think, very elegant solution lol) and found this code here by Jason Yandell. Thanks Jason! I changed the color and defined a nice range for the speed of the breathing, that I want to control by touching (or nearly touching) the conductive crystal.
//Written by: Jason Yandell
//Modified by Loes Bogers, 2019
#include <Adafruit_NeoPixel.h>
#define PIN 10
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.setBrightness(85); // Lower brightness and save eyeballs!
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
int TOTAL_LEDS = 2; // only using 2 LEDs for now
float MaximumBrightness = 150; // don't set to 255 unless powering with 5V
//Speedfactor between 0.008 and 0.05 is nice
float SpeedFactor = 0.008; // nice and relaxed
float StepDelay = 5; // ms for a step delay on the lights
// Make the lights breathe (65535 is amount of steps)
for (int i = 0; i < 65535; i++) {
// Intensity will go from 10 - MaximumBrightness in a "breathing" manner
float intensity = MaximumBrightness /2.0 * (1.0 + sin(SpeedFactor * i));
strip.setBrightness(intensity);
// Now set every LED to that color
for (int ledNumber=0; ledNumber<TOTAL_LEDS; ledNumber++) {
strip.setPixelColor(ledNumber, 100, 100, 255); //violet=ish
}
strip.show();
//Wait a bit before continuing to breathe
delay(StepDelay);
}
}
Shine shine shining on, Loes Bogers, 2019
More control over the neopixels
So that worked out very beautifully! I had a little bit of a harder time using an analog sensor to control this code though. So that will take some more work but I'm entering an area I would like to get a little better at so let's drill down. Browsing some forums got me some good insights:
You, like every other NeoPixel newbie, have discovered that the Adafruit examples are blocking code. They simply run the Led patterns from start to finish without regard for anything else that you'd like to do at the same time. Makes sense because their purpose is to demonstrate the capabilities of the Led strips and how to use the NeoPixel library. They're really not meant for integration into larger projects.
To do other things at the same time you'll need to "unwind" the loops and learn to do timing with the millis() function instead of delays. Adafruit has a tutorial showing one (but not the only) way of doing this.
So I followed the link to find out that it is a lovely tutorial telling me I'm not the only one with these questions (yay!)
So how do you get it to pay attention to external inputs while generating all those mezmerizing pixel patterns? Some of the most common Neopixel questions in the Adafruit forums are:
- How can I make my Neopixel project respond reliably to button presses?
- How can I run two (or more) different Neopixel patterns at the same time?
- How can I make my Arduino do other things while my Neopixel pattern is running?
In this guide, we’ll look at some ways to structure your Neopixel code to keep it responsive and make it more amenable to multitasking.
The Update function can be called from your loop() or a timer interrupt and you can update many patterns simultaneously on each pass, while monitoring user interactions at the same time.
Excellent, this is exactly what I was looking for. The tutorial by Bill Earl suggests to work with millis() instead of delays() and not work within one loop but use the Update() function instead. It requires a bit of C++ code, which I always find a bit confusing so it's supernice to have it spelled out like this for better understanding. I'm sure I'm not the only learning struggling to take this hurdle :D The full code is pretty complete and gives a lot of options I probably won't use but instead scale down and use only a few of the functions and adapt them to my setup.
Before running this code, make sure to install the neopixel library. This tutorial explains how.
#include <Adafruit_NeoPixel.h>
// Pattern types supported:
enum pattern { NONE, RAINBOW_CYCLE, THEATER_CHASE, COLOR_WIPE, SCANNER, FADE };
// Patern directions supported:
enum direction { FORWARD, REVERSE };
// NeoPattern Class - derived from the Adafruit_NeoPixel class
class NeoPatterns : public Adafruit_NeoPixel
{
public:
// Member Variables:
pattern ActivePattern; // which pattern is running
direction Direction; // direction to run the pattern
unsigned long Interval; // milliseconds between updates
unsigned long lastUpdate; // last update of position
uint32_t Color1, Color2; // What colors are in use
uint16_t TotalSteps; // total number of steps in the pattern
uint16_t Index; // current step within the pattern
void (*OnComplete)(); // Callback on completion of pattern
// Constructor - calls base-class constructor to initialize strip
NeoPatterns(uint16_t pixels, uint8_t pin, uint8_t type, void (*callback)())
:Adafruit_NeoPixel(pixels, pin, type)
{
OnComplete = callback;
}
// Update the pattern
void Update()
{
if((millis() - lastUpdate) > Interval) // time to update
{
lastUpdate = millis();
switch(ActivePattern)
{
case RAINBOW_CYCLE:
RainbowCycleUpdate();
break;
case THEATER_CHASE:
TheaterChaseUpdate();
break;
case COLOR_WIPE:
ColorWipeUpdate();
break;
case SCANNER:
ScannerUpdate();
break;
case FADE:
FadeUpdate();
break;
default:
break;
}
}
}
// Increment the Index and reset at the end
void Increment()
{
if (Direction == FORWARD)
{
Index++;
if (Index >= TotalSteps)
{
Index = 0;
if (OnComplete != NULL)
{
OnComplete(); // call the comlpetion callback
}
}
}
else // Direction == REVERSE
{
--Index;
if (Index <= 0)
{
Index = TotalSteps-1;
if (OnComplete != NULL)
{
OnComplete(); // call the comlpetion callback
}
}
}
}
// Reverse pattern direction
void Reverse()
{
if (Direction == FORWARD)
{
Direction = REVERSE;
Index = TotalSteps-1;
}
else
{
Direction = FORWARD;
Index = 0;
}
}
// Initialize for a RainbowCycle
void RainbowCycle(uint8_t interval, direction dir = FORWARD)
{
ActivePattern = RAINBOW_CYCLE;
Interval = interval;
TotalSteps = 255;
Index = 0;
Direction = dir;
}
// Update the Rainbow Cycle Pattern
void RainbowCycleUpdate()
{
for(int i=0; i< numPixels(); i++)
{
setPixelColor(i, Wheel(((i * 256 / numPixels()) + Index) & 255));
}
show();
Increment();
}
// Initialize for a Theater Chase
void TheaterChase(uint32_t color1, uint32_t color2, uint8_t interval, direction dir = FORWARD)
{
ActivePattern = THEATER_CHASE;
Interval = interval;
TotalSteps = numPixels();
Color1 = color1;
Color2 = color2;
Index = 0;
Direction = dir;
}
// Update the Theater Chase Pattern
void TheaterChaseUpdate()
{
for(int i=0; i< numPixels(); i++)
{
if ((i + Index) % 3 == 0)
{
setPixelColor(i, Color1);
}
else
{
setPixelColor(i, Color2);
}
}
show();
Increment();
}
// Initialize for a ColorWipe
void ColorWipe(uint32_t color, uint8_t interval, direction dir = FORWARD)
{
ActivePattern = COLOR_WIPE;
Interval = interval;
TotalSteps = numPixels();
Color1 = color;
Index = 0;
Direction = dir;
}
// Update the Color Wipe Pattern
void ColorWipeUpdate()
{
setPixelColor(Index, Color1);
show();
Increment();
}
// Initialize for a SCANNNER
void Scanner(uint32_t color1, uint8_t interval)
{
ActivePattern = SCANNER;
Interval = interval;
TotalSteps = (numPixels() - 1) * 2;
Color1 = color1;
Index = 0;
}
// Update the Scanner Pattern
void ScannerUpdate()
{
for (int i = 0; i < numPixels(); i++)
{
if (i == Index) // Scan Pixel to the right
{
setPixelColor(i, Color1);
}
else if (i == TotalSteps - Index) // Scan Pixel to the left
{
setPixelColor(i, Color1);
}
else // Fading tail
{
setPixelColor(i, DimColor(getPixelColor(i)));
}
}
show();
Increment();
}
// Initialize for a Fade
void Fade(uint32_t color1, uint32_t color2, uint16_t steps, uint8_t interval, direction dir = FORWARD)
{
ActivePattern = FADE;
Interval = interval;
TotalSteps = steps;
Color1 = color1;
Color2 = color2;
Index = 0;
Direction = dir;
}
// Update the Fade Pattern
void FadeUpdate()
{
// Calculate linear interpolation between Color1 and Color2
// Optimise order of operations to minimize truncation error
uint8_t red = ((Red(Color1) * (TotalSteps - Index)) + (Red(Color2) * Index)) / TotalSteps;
uint8_t green = ((Green(Color1) * (TotalSteps - Index)) + (Green(Color2) * Index)) / TotalSteps;
uint8_t blue = ((Blue(Color1) * (TotalSteps - Index)) + (Blue(Color2) * Index)) / TotalSteps;
ColorSet(Color(red, green, blue));
show();
Increment();
}
// Calculate 50% dimmed version of a color (used by ScannerUpdate)
uint32_t DimColor(uint32_t color)
{
// Shift R, G and B components one bit to the right
uint32_t dimColor = Color(Red(color) >> 1, Green(color) >> 1, Blue(color) >> 1);
return dimColor;
}
// Set all pixels to a color (synchronously)
void ColorSet(uint32_t color)
{
for (int i = 0; i < numPixels(); i++)
{
setPixelColor(i, color);
}
show();
}
// Returns the Red component of a 32-bit color
uint8_t Red(uint32_t color)
{
return (color >> 16) & 0xFF;
}
// Returns the Green component of a 32-bit color
uint8_t Green(uint32_t color)
{
return (color >> 8) & 0xFF;
}
// Returns the Blue component of a 32-bit color
uint8_t Blue(uint32_t color)
{
return color & 0xFF;
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos)
{
WheelPos = 255 - WheelPos;
if(WheelPos < 85)
{
return Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
else if(WheelPos < 170)
{
WheelPos -= 85;
return Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
else
{
WheelPos -= 170;
return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}
};
void Ring1Complete();
void Ring2Complete();
void StickComplete();
// Define some NeoPatterns for the two rings and the stick
// as well as some completion routines
NeoPatterns Ring1(24, 5, NEO_GRB + NEO_KHZ800, &Ring1Complete);
NeoPatterns Ring2(16, 6, NEO_GRB + NEO_KHZ800, &Ring2Complete);
NeoPatterns Stick(16, 7, NEO_GRB + NEO_KHZ800, &StickComplete);
// Initialize everything and prepare to start
void setup()
{
Serial.begin(115200);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
// Initialize all the pixelStrips
Ring1.begin();
Ring2.begin();
Stick.begin();
// Kick off a pattern
Ring1.TheaterChase(Ring1.Color(255,255,0), Ring1.Color(0,0,50), 100);
Ring2.RainbowCycle(3);
Ring2.Color1 = Ring1.Color1;
Stick.Scanner(Ring1.Color(255,0,0), 55);
}
// Main loop
void loop()
{
// Update the rings.
Ring1.Update();
Ring2.Update();
// Switch patterns on a button press:
if (digitalRead(8) == LOW) // Button #1 pressed
{
// Switch Ring1 to FADE pattern
Ring1.ActivePattern = FADE;
Ring1.Interval = 20;
// Speed up the rainbow on Ring2
Ring2.Interval = 0;
// Set stick to all red
Stick.ColorSet(Stick.Color(255, 0, 0));
}
else if (digitalRead(9) == LOW) // Button #2 pressed
{
// Switch to alternating color wipes on Rings1 and 2
Ring1.ActivePattern = COLOR_WIPE;
Ring2.ActivePattern = COLOR_WIPE;
Ring2.TotalSteps = Ring2.numPixels();
// And update tbe stick
Stick.Update();
}
else // Back to normal operation
{
// Restore all pattern parameters to normal values
Ring1.ActivePattern = THEATER_CHASE;
Ring1.Interval = 100;
Ring2.ActivePattern = RAINBOW_CYCLE;
Ring2.TotalSteps = 255;
Ring2.Interval = min(10, Ring2.Interval);
// And update tbe stick
Stick.Update();
}
}
//------------------------------------------------------------
//Completion Routines - get called on completion of a pattern
//------------------------------------------------------------
// Ring1 Completion Callback
void Ring1Complete()
{
if (digitalRead(9) == LOW) // Button #2 pressed
{
// Alternate color-wipe patterns with Ring2
Ring2.Interval = 40;
Ring1.Color1 = Ring1.Wheel(random(255));
Ring1.Interval = 20000;
}
else // Retrn to normal
{
Ring1.Reverse();
}
}
// Ring 2 Completion Callback
void Ring2Complete()
{
if (digitalRead(9) == LOW) // Button #2 pressed
{
// Alternate color-wipe patterns with Ring1
Ring1.Interval = 20;
Ring2.Color1 = Ring2.Wheel(random(255));
Ring2.Interval = 20000;
}
else // Retrn to normal
{
Ring2.RainbowCycle(random(0,10));
}
}
// Stick Completion Callback
void StickComplete()
{
// Random color change for next scan
Stick.Color1 = Stick.Wheel(random(255));
}
Making RFID skin electronics¶
Inspiration
Loved the Oyster Card Nails done by Lucie Davis! So I went looking for some guidance instructions as to how to get the chip out of a card to put it in something else. I found this Instructable by ProjectSugru.
Dissolve RFID chip from a card
Get a card. Check how much money there's on it. Maybe you don't want to lose 50 euros on this experiment. In the Netherlands, you can check the balance of anonymous OV chipcard here.
Put the public transport card in a non-plastic bowl and cover with aceton. I used a glass pot. Let it sit a little while.
Pouring aceton over an RFID card inside a glass bowl, Loes Bogers 2019
The tutorial says 6-12 hours, but my card was completely disintegrated within an hour. So keep an eye on it. Carefully take out the coil and chip. Rinse it again in acetone, and then in water. Let it dry for 20 mins or so.
Disintegration of the plastic encasing (approx. 1 hour), Loes Bogers, 2019
You can pull it a little to help it along, but it should really come right off. If you cannot easily lift the plastic peels off the chip and coil, just leave it be a few more minutes
Disposing of the aceton
Best to let aceton on wet towels and bowls evaporate until they're totally dry before throwing them out and cleaning them. While wet, the aceton keeps eating away at plastics such as bin bag, pipes, what have you :D
Recoiling the coil
I let the chip and coil dry, peopled off whatever residue was still there, carefully, and untangled the coil. It's about a metre long. I then recoiled the wire by shaping it around a small cylindrical jar that I then stuck to a piece of vinylsticker (we ran out of painting tape) to flatten it and keep it together.
*Re-coiling the coil carefully, kept in place with a vinyl sticker, Loes Bogers, 2019*
Testing the coil After all this handling I went down to the metro station to see if my RFID chip was still working. It feels a bit weird to do it, like you're cheating the system haha. Which of course I'm not even doing because I'm not changing anything about the card or the information on it, just giving it a new wrapper
Concept: fake implant No that this all still works, what do I do? I didn't want to make any kind of wearable or bracelet for this that people could mistake for "making it easier" to use a data tracking system to use public transport. I think it's very weird for example that people who benefit from paying with cash are worse off or can't travel with this system at all. It does not make sense to me. So I thought of gestures to highlight this fact that we're all willing to comply with these big systems that take our data in the name of ease of travel and convenience.
So I thought of bowing as a gesture to open the gates to the metro system. In a way we are all bowing to the system anyway, so let's make that explicit and stop pretending we control such a system when in fact it's playing us. If bowing should be the interaction, then the chip would have to be placed on a person's forehead.
FormX liquid latex used to cast the RFID chip, Loes Bogers, 2019
As this is skin electronics I thought it should become an extension of that organ. I would love to be brave enough to just implant it, but I'm definitely not, so I decided to cast the RFID tag in a transparent/yellowish tone liquid latex. The chip started "pooping" as the latex cured. This latex cures by evaporating ammonia (it's stinky)! Which caused some of the chip to leak a brownish liquid. I'm not sure what effect that has on its functioning but there's only one way to find out. I will continue with the form factor for now and test it. If it doesn't work I can try other methods of casting the chip in a bit of latex.
*Latex makes the RFID chip poop, Loes Bogers, 2019*
I have theater make up sealer from Kryolan that I added on top so I can paint over it nicely with any foundation in any skin tone, to make it blend with my skin tone as if it were implanted under the skin. This sealer is used to seal special FX rubber noses etc.
Kryolan product placement next to my RFID chip, Loes Bogers, 2019
After a good amount of sealing and drying, I peeled off the chip and glued it to my skin using Kryolan Prosaide (a skin glue used for wigs and mustaches). Then I covered it with some Kryolan TV stick in my skin tone, and powdered it off. TV stick is a concealer with extremly high coverage. You can still see that there's something there - the edges will show a little - but with some theater wax you'd be able to camouflage the edges much more. Now off to bow to the machine!
Prosaide and the chip in liquid latex, Loes Bogers, 2019
Rub on some of the adhesive, Loes Bogers, 2019
Distribute it a bit, Loes Bogers, 2019
...and stick it on!, Loes Bogers, 2019
optional: cover it up with some Kryolan TV stick and set with powder, Loes Bogers, 2019