The Making of an Accelerometer Jacket

Designed by ThunderLily for a collaboration with designer Minika Ko for the KOllision runway show, the ac·cel·er·om·e·ter jacket fuses fashion, technology and art. The goal is to use a business suit as a canvas and create a vision of the future of power for women, the artwork redefines the interpretation of movement by illustrating the strength and power of a woman to generate light and give direction.

Using an accelerometer to detect the direction of movement, a flora microprocessor and Neopixels, the jacket is programmed to change color on the X,Y or Z axes.

Materials:

Flora micro processor

Flora accelerometer

Flora Neopixels

Conductive thread

Needles

Woven tape (approximately 1.5 metres)

STEP 1: Sketching

Drawing out your designs provides the first step in iterative design, allowing you — the designer — to brainstorm your ideas on paper and map out how all the different elements will align. How many lights will you use? Where will you place the accelerometer and microprocessor?

Accelerator jacket

Step 2: Connecting the hardware

Ensure that your stitches around the terminals are tight, loose connections create problems, flickering lights or no connection at all.

Connect the Microprocessor to Acclererometer :

GND — gnd

SCL#3 — SCL (#3 is the number of the pin)

SDA #2 — SDA (#2 is the number of the pin)

3.3v — 3V

Connect the Microprocessor to the Neopixels:

VBATT (+ve) — +ve

*GND — -ve

terminal #6 — →

*Connect the ground first, and when disconnecting, disconnect the ground last.

Note that the Neopixels are directional so ensure that the microprocessor connects to the arrow that goes into the neopixel → and the out arrow connects to the next light.

sewing the accelerometer.JPG

The fabric for the jacket is stretchy, which can be a problem when integrating technology into a garment especially when using conductive thread. This jacket is designed to demonstrate movement and direction and will be worn by a dancer, so it will be subject to extreme directional movement which can make the connections unstable. To counteract this I used a strip of woven tape that is flexible but not stretchy, then applied this to the jacket.

Eight neopixels seems to be the max that can be effectively sequenced from the microprocessor with a 3.5V liPo battery. Conductive thread…is at the core of most of our wearble projects, but it does not carry much current — try combining multiple threads on the +ve and -ve terminals to decrease the resistance.

IMG_4348a.jpg

Copy and paste the following code into Arduino. Be sure to have the correct board set for the code to work on your flora: Tools/Board/Adafruit Flora. If you are using a different microprocessor then update the code and the board to reflect the microprocessor of your choice.

//include the necessary libraries

#include <Wire.h>

#include <Adafruit_Sensor.h>

#include <Adafruit_LSM303_U.h>

#include <Adafruit_NeoPixel.h>

//define how many NeoPixels you have in your strip. I am using 8

#define NUM_PIXELS 8

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, 8, NEO_GRB + NEO_KHZ400);

Adafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(54321);

int32_t currentRgb[NUM_PIXELS * 3];

int32_t decay[] = {1,2,4,8,16,32,64,128};

void setup()

{

Serial.begin(9600);

if (!accel.begin())

{

Serial.println("Oops ... unable to initialize the LSM303. Check your wiring!");

while (1);

}

for (int i = 0;i < NUM_PIXELS*3;i++) {

currentRgb[i] = 0;

}

strip.begin();

strip.show();

}

//a is for acceleration. The acceleration I noted is in the region of +12 to -12

int normalize(int a) {

if (a < 0) {

a = -a;

}

if (a > 12) {

a = 12;

}

return a*20;

}

//record the acceleration on the X, Y or Z axes

void loop()

{

sensors_event_t event;

accel.getEvent(&event);

Serial.print("Accel X: "); Serial.print(event.acceleration.x); Serial.print(" ");

Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" ");

Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.print(" ");

int32_t c[3];

c[0] = normalize(event.acceleration.x);

c[1] = normalize(event.acceleration.y);

c[2] = normalize(event.acceleration.z);

//if you want to visualize the results, this will print it to the seial monitor

Serial.println();

for (int i = 0;i < 3;i++) {

Serial.print(c[i]);

Serial.print(" ");

}

Serial.println();

//for each pixel

for (int pix = 0;pix < NUM_PIXELS; pix++) {

//for each RGB

for (int colorI = 0; colorI < 3; colorI++) {

//apply the current acceleration with a given decay

currentRgb[pix * 3 + colorI] = (c[colorI] + currentRgb[pix * 3 + colorI]*(decay[pix] - 1))/decay[pix];

}

/* rather than having all the NeoPixels change color at the same time, the color will "decay" along the line so that the new color will be at one end

and the old color will be at the other end and the colors in between will show in proportions identified in the decay*/

strip.setPixelColor(pix, strip.Color(currentRgb[pix * 3], currentRgb[pix * 3 + 1], currentRgb[pix * 3 + 2]));

}

strip.show();

//time lag 20 milli seconds

delay(20);

}

Jacket from the Kovasky collection by Minika Ko

Jacket from the Kovasky collection by Minika Ko