Light Up Halloween Hat

I wanted to create a circuit for my halloween costume that would make it colorful and help to stand out! I decided to do a basic color mixing code and incorporate LED's onto my hat.

Supplies:

-Conductive Thread

-Sewing Needle

-Lilypad

-3 RGB LED's

-Usb cable/battery

-Scissors

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Prepare Code

For this code I only used 3 LED's, you can include more or less.

nt RGB_red = 12;
int RGB_green = 13; int RGB_blue = 14;

// The colored LEDs along the bottom edge of the board:

int redLED = 6; int greenLED = A7; int blueLED = A8;

void setup() { // Make all of our LED pins outputs:

pinMode(RGB_red, OUTPUT); pinMode(RGB_green, OUTPUT); pinMode(RGB_blue, OUTPUT); pinMode(redLED, OUTPUT); pinMode(greenLED, OUTPUT); pinMode(blueLED, OUTPUT); }

void loop() {

// This code will step through the six primary and secondary colors, plus white and black. // For each of these colors, we'll turn the necessary RGB LEDs on or off. // We'll also turn on the same LEDs on the bottom edge, so you can see what's being mixed.

// Black (all LEDs off)

// RGB LEDs: digitalWrite(RGB_red, LOW); digitalWrite(RGB_green, LOW); digitalWrite(RGB_blue, LOW);

// Bottom-edge LEDs digitalWrite(redLED, LOW); digitalWrite(greenLED, LOW); digitalWrite(blueLED, LOW); delay(0);

// Red (red LED on)

digitalWrite(RGB_red, HIGH); digitalWrite(RGB_green, LOW); digitalWrite(RGB_blue, LOW); digitalWrite(redLED, HIGH); digitalWrite(greenLED, LOW); digitalWrite(blueLED, LOW); delay(1000);

// Yellow (red and green LEDs on)

digitalWrite(RGB_red, HIGH); digitalWrite(RGB_green, HIGH); digitalWrite(RGB_blue, LOW); digitalWrite(redLED, HIGH); digitalWrite(greenLED, HIGH); digitalWrite(blueLED, LOW); delay(1000);

// Green (green LED on)

digitalWrite(RGB_red, LOW); digitalWrite(RGB_green, HIGH); digitalWrite(RGB_blue, LOW); digitalWrite(redLED, LOW); digitalWrite(greenLED, HIGH); digitalWrite(blueLED, LOW); delay(0);

// Cyan (blue and green LEDs on)

digitalWrite(RGB_red, LOW); digitalWrite(RGB_green, HIGH); digitalWrite(RGB_blue, HIGH); digitalWrite(redLED, LOW); digitalWrite(greenLED, HIGH); digitalWrite(blueLED, HIGH); delay(1000);

// Blue (blue LED on)

digitalWrite(RGB_red, LOW); digitalWrite(RGB_green, LOW); digitalWrite(RGB_blue, HIGH); digitalWrite(redLED, LOW); digitalWrite(greenLED, LOW); digitalWrite(blueLED, HIGH); delay(0);

// Magenta (red and blue LEDs on)

digitalWrite(RGB_red, HIGH); digitalWrite(RGB_green, LOW); digitalWrite(RGB_blue, HIGH); digitalWrite(redLED, HIGH); digitalWrite(greenLED, LOW); digitalWrite(blueLED, HIGH); delay(10);

// White (all LEDs on)

digitalWrite(RGB_red, HIGH); digitalWrite(RGB_green, HIGH); digitalWrite(RGB_blue, HIGH); digitalWrite(redLED, HIGH); digitalWrite(greenLED, HIGH); digitalWrite(blueLED, HIGH);ujlo9p0;- delay(1000); }

Step 2: Draw Circuit

Make sure you have a plan for your circuit so you can sew easily and no threads become crossed. Attach the LED's to their corresponding pin and make sure all the negative sew tabs are connected and go back to the negative sew tab on the lilypad.

Step 3: Sew

Start sewing nice and neatly, if you mess up just take out the thread and start over. Make sure no thread is crossing as this will short circuit the lights.

Step 4: Test It Out!

If done correctly, once your battery is connected to the Lilypad and you turn it on, the three LED's will change color until you turn it off.

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    Discussions