Skip to content
Snippets Groups Projects
week13.md 30.9 KiB
Newer Older
fibasile's avatar
fibasile committed
# 13. Skin Electronics

Loes's avatar
Loes committed
##Results
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
![](../images/wk13wear4.jpg)<br>*Experiment 1: a public transport chipcard that can be used as skin electronics, Loes Bogers, 2019*

<iframe width="560" height="315" src="https://www.youtube.com/embed/FA9Pf4BjvgY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

--------
-------

Loes's avatar
Loes committed

<iframe src="https://giphy.com/embed/jro8mAq9OXjxpuZP4m" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>

*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*


Loes's avatar
Loes committed
##Material explorations
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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.
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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. 

![](../images/wk13_drag.jpg) *Fabulous, pic by Bea Sandini, 2019*

Loes's avatar
Loes committed
###Embedding crystals in a hair piece
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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](https://class.textile-academy.org/2020/loes.bogers/assignments/week09/).
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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). 

Loes's avatar
Loes committed

**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. 

![](../images/wk13_blackdiamonds.jpg)*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 :)

Loes's avatar
Loes committed
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. 

![](../images/wk13_4crystaltechniques.jpg)*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.

![](../images/wk13_seedcyrstalhotglue.jpg)*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 :)

![](../images/wk13_4crystals.jpg)*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. 

![](../images/wk13_crystalback.jpg)*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](https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation)

*Install Gemma board etc*

I used this [guide](https://learn.adafruit.com/adafruit-gemma-m0/using-with-arduino-ide) 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](https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation)

*Schematic using Gemma*

I hooked up the RGD neopixels like so, following the instructions in this [tutorial](https://learn.adafruit.com/flora-rgb-smart-pixels/hook-up-alligator-clips)

![](../images/wk13_hookup.jpg)*Hooking up neopixel to Gemma board, image via [Learn.Adafruit.com](https://learn.adafruit.com/flora-rgb-smart-pixels/hook-up-alligator-clips)*

*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).

![](../images/wk13_soldering.jpg)*Not easy to solder, but a bit of paper underneath helped a lot, Loes Bogers, 2019*
Loes's avatar
Loes committed

Loes's avatar
Loes committed
*RGB colors?*
Loes's avatar
Loes committed

I refreshed my knowledge of making colors with an RGB LED. [This tutorial](https://learn.adafruit.com/adafruit-arduino-lesson-3-rgb-leds/using-internet-colors) 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](https://codebender.cc/sketch:136737#NeoPixel%20Breathe.ino) 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.
Loes's avatar
Loes committed

```
//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);

	}
}

```

<iframe src="https://giphy.com/embed/jro8mAq9OXjxpuZP4m" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>

*Shine shine shining on, Loes Bogers, 2019*
Loes's avatar
Loes committed


167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
**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](https://learn.adafruit.com/multi-tasking-the-arduino-part-3?view=all) has a tutorial showing one (but not the only) way of doing this. 
>
> – [gfvalvo on the Arduino forum](https://forum.arduino.cc/index.php?topic=574421.0)

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](https://www.ardu-badge.com/NeoPatterns) 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));
}

```



Loes's avatar
Loes committed
###Making RFID skin electronics 

**Inspiration**

<iframe width="560" height="315" src="https://www.youtube.com/embed/J9rWkgxH3zk?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

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](https://www.instructables.com/id/Transform-your-Oyster-travelcard-with-sugru/).

**Dissolve RFID chip from a card**
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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](https://www.ov-chipkaart.nl/ov-chip-en-gebruik/gebruik/ov-reishistorie-en-saldo-anonieme-kaart.htm).
fibasile's avatar
fibasile committed

Loes's avatar
Loes committed
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. 

<iframe src="https://giphy.com/embed/W5aMAG9O2W0UNX3JP2" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>

*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. 

<iframe src="https://giphy.com/embed/fAbJApkqqRlFYOIxxu" width="480" height="360" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/fAbJApkqqRlFYOIxxu"></a></p>

*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

Loes's avatar
Loes committed
**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. 

<iframe src="https://giphy.com/embed/icP1oRKK3qcE78ZqSH" width="480" height="360" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p>*Re-coiling the coil carefully, kept in place with a vinyl sticker, Loes Bogers, 2019*</p>

**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

<iframe width="560" height="315" src="https://www.youtube.com/embed/et9T_m5meNE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

**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. 

![](../images/wk13_pvsElastica.jpg)*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.

<iframe src="https://giphy.com/embed/htkHA3xu29mig3Rokh" width="480" height="360" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p>*Latex makes the RFID chip poop, Loes Bogers, 2019*</p>

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. 
Loes's avatar
Loes committed

Loes's avatar
Loes committed
![](../images/wk13_sealerkryolan.jpg)*Kryolan product placement next to my RFID chip, Loes Bogers, 2019*
Loes's avatar
Loes committed

Loes's avatar
Loes committed
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!

![](../images/wk13wear1.jpg)<br>*Prosaide and the chip in liquid latex, Loes Bogers, 2019*
![](../images/wk13wear2.jpg)<br>*Rub on some of the adhesive, Loes Bogers, 2019*
![](../images/wk13wear3.jpg)<br>Distribute it a bit*, Loes Bogers, 2019*
![](../images/wk13wear4.jpg)<br>*...and stick it on!, Loes Bogers, 2019*
![](../images/wk13wear5.jpg)<br>*optional: cover it up with some Kryolan TV stick and set with powder, Loes Bogers, 2019*

Loes's avatar
Loes committed
<iframe width="560" height="315" src="https://www.youtube.com/embed/FA9Pf4BjvgY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>