Introduction: Debbie's Light Up Trapeze Pants

Prepare to be fabulous and create a party wherever you go! Debbie's trapeze pants are perfect for the trapeze artist that wants just a little extra shine. But the fun doesn't stop there! Take them jogging, hula hooping, biking, or dancing! Wherever you end up, you will shine fabulously and bring the fun!

These pretty little things were produced in the Utah State University Craft Technologies Class, taught by professor Deborah Fields. A special thanks to Deborah Fields, and Janell and Tommy Amely for superior help with this project and always keeping things fabulous.

Note: This is an project that requires patients, sewing, and programming. It is totally doable with help from tutorials and maker spaces. These materials were purchased through https://www.adafruit.com. I used Arduino, find here: http://www.arduino.cc/ as a programming platform.

WHAT YOU NEED:

Materials:
1. Leggings (We used a workout/yoga legging with a reinforced waist)
2. Bias Tape view here from your local fabric/craft store
3. Velcro view here
4. Matching Tread view here
5. 3/4 Inch Shear Ribbon view here from your local fabric/craft store

6. Neopixels (26 used in this tutorial) view here
7. *Gemma X 2 + Gemma Charger X 1 view here
8. Flora Accelerometer X 2 view here

9. Cat-5e Cable (found at your local electronics shop or second hand store)
10. Battery X 2 (I used a 3.7V, 1200mAh) view here
11. Conductive Thread view here
12. USB mini cable
13. Computer :)
14. *USB Converter to program the Gemma. Gemma can only handle a USB 2. If you have a newer computer with a USB 3 you need to buy a converter. I did not have to do this.


Tools:
1. Wire Cutters/Strippers
2. Sewing Needle
3. Pins
4. Soldering Iron
5. Scissors
6. Pencil
7. Sewing Machine (optional)
8. Helping 3rd Hand (optional) view here

Step 1: The Platform of the Party: Bias Tape

Note: For the trapeze pants I had to take into consideration where the most wear and stress would be on the pants. The outside leg would show off the lights, allow for maximum movement, and limited impact on the neopixels.

Goods:
1. Sewing Machine
2. Scissors
3. Leggings ( please do a cheetah print!)
4. Bias Tape
5. Thread
6. Pins

a. Lay pants flat and pin the top of bias tape to the desired location.

b. Folded the top over about 1/4 in to make a seam and pinned it. Pin all the way down the pant and create another seam at the bottom of the bias tape. Then, sew, removing pins as you go.

Note: It gets a little tight at the end, so keep checking to make sure you are only sewing what you want to sew. I frequently stopped and checked around the presser foot with my hands. Also, keep your needle down (if you have that option).

Step 2: The Framework: Neopixels and Conductive Thread

Goods:

1. Neopexels
2. Conductive Thread
3. Needle
4. Pencil

1. Neopixel layout: Lay neopixels in the desired location. I had 13 for each leg and wanted them to be closer together the closer they came to the foot. With a pencil, I marked the location of each neopixel.

2. Connecting the + (positive) and - (negative) ports with conductive thread: Starting about 1.5 in. from the foot and working upward, I attached the first neopixel's + port first. I tied a knot in the bias tape and wrapped the conductive thread around the port 4 times. I sewed up to the next pencil mark where I wanted the next neopixel. Repeat this method with the - ports. Now you are really becoming a sewing nerd.

3. Connecting the information line: This step uses the same method as step 2, only there must be a break at each neopixel. Example: Connect neopixel 1 ">" to neopixel 2 ">". Cut and tie both ends before repeating on the following neopixels. They must all point in the same direction. Do not connect the line under the neopixel.

Step 3: Let's Get This Party Started! Connecting the Accelerometer to the Gemma, Gemma to Neopixels

Goods:

1. Gemma X2
2. Accelerometer X 2
3. Cat-5e cable
4. Soldering Iron
5. Wire Cutters/Strippers

Note:
Cat-5e is made up of several small coated wires twisted together inside of a plastic sheath. Cutting away the outer sheath exposes the smaller coated wires that you will use.


Diagram:
I drew a diagram of my Gemma and accelerometer. I identified the positive, ground, and analog pins on each. Only one of the axis on the accelerometer needed to be connected/used. There are two power outs on the Gemma, the "Vout" which is 6 volts and the "3Vo" which is 3 volts. The accelerometer is connected to the 3 volts because the neopixels needs the 6 volts.

Accelerometer to GemmaConnections:
a. Prepare: Cut three, 4 inch sections of Cat-5e wire. Remove the plastic coating on the last 1/2-3/4 inch on both ends of each piece of wire, exposing the copper wire.

b. Before soldering the connections attach wires to pins temporarily by wrapping the wire on itself. Make sure connections are as solid as possible. Do not solder until you have uploaded test code in a future step.

c. Beginning from the accelerometer (Acc), take one of the 4 inch Cat-5e wire section and connect pin "X" to Gemma pin "A1." Wrap wires as securely as possible.

d. Take another 4 inch Cat-5e wire and connect Acc. pin "+" to Gemma pin "3Vo." Again, wrap wires as securely as possible.

e. Lastly, use another 4 inch Cat-5e wire and connect Acc. pin "-" to Gemma pin "GND." Wrap wires as securely as possible.

f. Double check all of the wiring is the same as the diagram.

Gemma to Neopixels Connections:

a. Prepare: Cut three more, 4 inch Cat-5e pieces. Remove the plastic coating on the last 1/2-3/4 inch on both ends of each piece of wire, exposing the copper wire.

b. Beginning at the Gemma take a 4 inch Cat-5e wire and connect pin "+" to the first neopixel pin ">." Again, wrap wires as securely as possible.

c. Use another 4 inch Cat-5e wire and connect Gemma pin "GND" to neopixel pin "-." Wrap wires as securely as possible.

d. Use another 4 inch Cat-5e wire and connect Gemma pin "Vout" to neopixel pin "+." Wrap wires as securely as possible.

e. Double check all of the wiring is the same as the diagram.

Double Check:
Make sure all connections from neopixels to Gemma, and Gemma to Accelerometer are solid. I completely missed connecting two of my neopixels, altogether.

GREAT JOB SO FAR!

Step 4: The Language of the Party: Coding

Wow! The structure of your trapeze pants are complete! This is awesome! You're almost ready to light up!

Goods:

1. Computer
2. USB mini
3. everything that you have assembled to this point :)

Important Notes about Gemma:
I used Arduino (http://www.arduino.cc/) as the programming platform for my Gemmas.
There are many warnings about using capacitors and resistors when using this many neopixels. I did not do this. If you are changing the amount of neopixels or using bigger batteries beware.
Gemma's cannot handle the speed at which the new computers USB 3's export information. If you have a USB 2 you are in good shape. Otherwise, purchase a converter.
Tutorials for Gemma: https://learn.adafruit.com/introducing-gemma/introduction
Tutorials for Neopixels: https://learn.adafruit.com/adafruit-neopixel-uberguide/overview , https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices

Testing Gemma and Neopixels:

a. Connect your Gemma to your computer using the USB mini cable. In order to upload the code you must push the small black button on the top of the Gemma. When it starts to blink, begin uploading.
*** It will not upload any code if you do not push the button ***

b. Test the Gemma by uploading the test 'Blink' code below. The small red light on the Gemma should blink. If you have problems or issues visit the Gemma tutorial link above.

CODE:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.

To upload to your Gemma or Trinket:
1) Select the proper board from the Tools->Board Menu
2) Select USBtinyISP from the Tools->Programmer
3) Plug in the Gemma/Trinket, make sure you see the green LED lit
4) For windows, install the USBtiny drivers
5) Press the button on the Gemma/Trinket - verify you see
the red LED pulse. This means it is ready to receive data
6) Click the upload button above within 10 seconds
*/

int led = 1; // blink 'digital' pin 1 - AKA the built in red LED

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);

}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}



c. Test the neopixels by uploading the 'Neopixels Strand Test' code below. If you have any trouble visit the Neopixels tutorial link above.
CODE:

#include

#define PIN

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino 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(60, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

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

void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
// Send a theater pixel chase in...
theaterChase(strip.Color(127, 127, 127), 50); // White
theaterChase(strip.Color(127, 0, 0), 50); // Red
theaterChase(strip.Color( 0, 0, 127), 50); // Blue

rainbow(20);
rainbowCycle(20);
theaterChaseRainbow(50);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void rainbow(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256; j++) {
for(i=0; i strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}

// 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) {
if(WheelPos < 85) {
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}


d. Finally, Upload the 'Debbie's Pants' Code below:


#include

const int PIN= 1;
const int ACCEL= 1;
const int NUMBER_O_PIXELS = 13;

const int min_accel = 350;
const int max_accel = 650;
int accelRead= 0;

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino 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(NUMBER_O_PIXELS, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

void setup() {
pinMode (PIN,OUTPUT);
pinMode (ACCEL,INPUT);
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}

void loop() {
// Some example procedures showing how to display to the pixels:
accelRead = analogRead(ACCEL);
accelRead = map (accelRead, min_accel, max_accel, 0, 255);
accelRead = constrain (accelRead, 0, 255);

setStripColor(accelRead , (255-accelRead) , 0);
delay(5);



}

void setStripColor(int RED, int GREEN, int BLUE){
for (int i = 0 ; i strip.setPixelColor(i , RED,GREEN,BLUE);
}
strip.show();
}


e. You can change the code around to your liking :)

Step 5: Get Yourself a Beer Coozy! We're Making an Electronics Pouch!

You can't have electronics without a cute little pouch!

Goods:

1. Neoprene or some sort of thick material (you can use an old beer coozy)
2. Velcro (not the sticky kind)
3. Needle and Thread
4. Sewing machine
5. Paper and pencil

I thought the best place for the pouch would be by the ankle because the accelerometer needed to take readings from the place that would move the most.

Pouch Pattern and Construction:

a. On a sheet of paper, line up the accelerometer, Gemma, and battery. Mark between each, leaving enough room for the seam (see picture). Draw one side with a flap and one without. Cut out the paper pattern, place it on your material, and trace. Cut it out and sew it together like shown, creating three pockets.

b. To add the velcro, cut desired length and width and sew. I put the pokey side of the velcro on the flap so it wouldn't scratch Debbie's leg. We will sew the patch on later.


Step 6: Seal It Up!

With all the moving around you're about to do in this amazing creation, we better make sure all the connections are secure. Grab your glue gun and soldering iron! We've got a party to start.

Goods:

1. Soldering iron
2. Glue gun
3. Gemma, accelerometer, and neopixels

Soldering:

a. Make sure all wires are to desired length before soldering. Put the electronics in the pouch and check to see that there will not be excess length. If shorter wires are desired cut and rewrap.

b. Solder all wires to pins on the Gemma and accelerometer.

c. Lastly, solder ONLY the info line from the Gemma to the neopixels. Do not solder the "+" and "-" on the neopixels.

Gluing:

a. Seal and reinforce all soldered areas with hot glue, completely covering wires to the plastic. Apply hot glue to the data pin, "+", and "-" pins on the first neopixel connected to Gemma. This is important in preventing breakage.

Step 7: Protect the Neopixels

Goods:

1. Sheer Material
2. Pins
3. Needle and Thead

Lay it down:

a. Measure enough ribbon to cover the entire length of the bias tape, including about an inch to continue into the inside of the leg.

b.Turn the ribbon under at the top, creating a seam to prevent fraying. Pin in place.

c. I attempted to sew this with a machine, but failed miserably. I ended up sewing it, which took a long time.

Attach the Pouch:

a. Using about 2 pins, set pouch in desired position. I only sewed three of the four sides in place because it just felt right.


Step 8: Finished Product

I hope you enjoyed this project. It was a team effort for sure! But with everything complete and in this little guide, you will be off and cartwheeling in no time!

Thanks to all that made this project possible :)

Sensors Contest

Participated in the
Sensors Contest

Arduino Contest

Participated in the
Arduino Contest