F-wings, an Optical Show

P2290643

Hey y’all!

For my Halloween Costume, I made light-up fairy wings using the following ingredients:

  1. 12 and 24 gauge wires for the frame
  2. White stockings/tights to cover the frame
  3. .75 mm fiber optic cables to provide light patterns on the wings
  4. Neopixel RGB LED strips
  5. 3D printed couplings to make sure the fiber optic cable ends were flush with the LED strip
  6. Flora micro-controller to control the light animations
  7. 330 Ω resistors and wires to connect LED strips to Flora
  8. Foam board as a base and cover for the electronics on the middle
  9. Ample amounts of hot glue to connect the fiber optic cables and LED strips to the couplings
  10. Arduino code for the light animations
  11. Nylon thread to sew the fiber optic cables in place on the wings
  12. External battery pack to power wings

 

Some new skills I learned doing this project:

  • How to use a 3D printer.
  • How to work with end-glow fiber optic cables and what the different types of fiber optic cables are.

My biggest challenges with the project were:

  • 3D printing the couplings. It took a fair amount of time to measure everything and build the shape in Tinkercad.
  • Soldering wires in my circuit and to the Neopixels. Either the wire was popping off, or the “input ” copper pad kept melting, or the wire would break where the wire insulation ended. I ended up having to redo parts of the circuit several times.
  • The battery pack I used kept shutting down power after about 1.5-2 min because my circuit didn’t draw enough power.

 

Special thanks to Ted, Helen, and Pantea for helping me finish my costume. Thank you to Becky and Rhea as well for helping me put my costume on. I wouldn’t have made it to the parade without all of you!

 

Process Photos:

Halloween Wings Circuit-2.png

#include 

#define PIN 6

// use define instead of integer because PIN not changing, so treat as a constant.
// variables change, but constants don't. Constants take up less space.
// if doing a variable need an equal sign and a semicolon at end

#define NUM_LEDS 8

#define BRIGHTNESS 80

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
// NEO_RGBW Pixels are wired for RGBW bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

// Adafruit_NeoPixel strip is like the "int" on regular arduino

void setup() {

// Always have to use strip.begin and strip.show when coding neopixels

strip.setBrightness(BRIGHTNESS);
strip.begin(); // Intitialize the pixels
strip.show(); // Initialize all pixels to 'off'
//use strip.show(); every time want to change the strip color

//for setup, "strip" is the name of the object we named above "Adafruit_Neopixel strip = [...]"
}

void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 50); // Red
// 50 at end is the wait time
colorWipe(strip.Color(0, 255, 0), 50); // Green
colorWipe(strip.Color(0, 0, 255), 50); // Blue
colorWipe(strip.Color(0, 0, 0, 255), 50); // White

rainbowFade2White(3,3,1);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
//uint32_t is a special type of data but essentially just a fancy integer
//c is the name of the integer, and turns colorwipes in code earlier into a local function call
for(uint16_t i=0; i<strip.numPixels(); i++) {
//for loop starts at 0 and counts up by 1 until reaches until it reaches strip.numPixels
// which is the max number of pixels set at beginning
strip.setPixelColor(i, c);
strip.show();
//update all the pixels
//if put strip.show outside for loop, all the colors will show at once
delay(wait);
//wait
}
}

void rainbowFade2White(uint8_t wait, int rainbowLoops, int whiteLoops) {
float fadeMax = 100.0;
int fadeVal = 0;
uint32_t wheelVal;
int redVal, greenVal, blueVal;

for(int k = 0 ; k < rainbowLoops ; k ++){

for(int j=0; j<256; j++) { // 5 cycles of all colors on wheel

for(int i=0; i< strip.numPixels(); i++) {

wheelVal = Wheel(((i * 256 / strip.numPixels()) + j) & 255);

redVal = red(wheelVal) * float(fadeVal/fadeMax);
greenVal = green(wheelVal) * float(fadeVal/fadeMax);
blueVal = blue(wheelVal) * float(fadeVal/fadeMax);

strip.setPixelColor( i, strip.Color( redVal, greenVal, blueVal ) );

}

//First loop, fade in!
if(k == 0 && fadeVal < fadeMax-1) { fadeVal++; } //Last loop, fade out! else if(k == rainbowLoops - 1 && j > 255 - fadeMax ){
fadeVal--;
}

strip.show();
delay(wait);
}

}

delay(500);
for(int k = 0 ; k < whiteLoops ; k ++){

for(int j = 0; j < 256 ; j++){

for(uint16_t i=0; i < strip.numPixels(); i++) { strip.setPixelColor(i, strip.Color(0,0,0, j ) ); } strip.show(); } delay(2000); for(int j = 255; j >= 0 ; j--){

for(uint16_t i=0; i < strip.numPixels(); i++) { strip.setPixelColor(i, strip.Color(0,0,0, j ) ); } strip.show(); } } delay(500); } void whiteOverRainbow(uint8_t wait, uint8_t whiteSpeed, uint8_t whiteLength ) { if(whiteLength >= strip.numPixels()) whiteLength = strip.numPixels() - 1;

int head = whiteLength - 1;
int tail = 0;

int loops = 3;
int loopNum = 0;

static unsigned long lastTime = 0;
while(true){
for(int j=0; j<256; j++) {
for(uint16_t i=0; i<strip.numPixels(); i++) { if((i >= tail && i <= head) || (tail > head && i >= tail) || (tail > head && i <= head) ){ strip.setPixelColor(i, strip.Color(0,0,0, 255 ) ); } else{ strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); } } if(millis() - lastTime > whiteSpeed) {
head++;
tail++;
if(head == strip.numPixels()){
loopNum++;
}
lastTime = millis();
}

if(loopNum == loops) return;

head%=strip.numPixels();
tail%=strip.numPixels();
strip.show();
delay(wait);
}
}

}
void fullWhite() {

for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
}
strip.show();
}
// 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);
}
}

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

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

// 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 strip.Color(255 - WheelPos * 3, 0, WheelPos * 3,0);
}
if(WheelPos < 170) { WheelPos -= 85; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3,0); } WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0,0); } uint8_t red(uint32_t c) { return (c >> 8);
}
uint8_t green(uint32_t c) {
return (c >> 16);
}
uint8_t blue(uint32_t c) {
return (c);
}

 

led-fiber optic couplings.png

P2290654

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s