Introduction: Nightsafe Turn-Signal Running Vest

This vest is designed with one ring of lights to turn on when it gets dark outside, the other half of a ring to blink left when you press the left turn switch, and the other half of that ring to blink right when the right turn switch is pressed.

Step 1: Outline Led, Arduino, and Switch Placement on Vest

1. Draw a circle of 16 evenly spaced dots in a circle on the inside of your jacket. This is where your LEDs will go!

2. Every other LED will be a different color. So the pattern will start white at the top of the circle, then blue, white, blue, white blue...until the circle is complete.

3. The button switches will be at the top, front of your vest. Stick them through the material and squeeze the ends down so they stay in place. Leave them alone for now.

4. The Arduino should be glued near the top of your circle. Use fabric glue!

Step 2: Stitch the + Ends of the White LED's

Your white LEDs will be the ones that turn on at night. They should all be connected together.

1. Stitch them with copper wire, making sure to use fine sandpaper to scrape off the insulation at points of connection. Loop the insulation around the plus ends many times to ensure a solid connection. Once you have stitched all the white LED's with the same, continuous line of copper, attach one end to the digital output 3 of the Arduino.

Step 3: Stitch the + Ends of the 4 Right Blue LEDs Together

Just as you stripped, wound, and stitched the + ends of the white LEDs, strip, wind, and stitch the + ends of the 4 right blue LEDs with the same, continuous copper thread and attach it to the digital output 5

Step 4: Stitch the + Ends of the 4 Left Blue LEDs Together

Just as you stripped, wound, and stitched the + ends of the white LEDs, strip, wind, and stitch the + ends of the 4 left blue LEDs with the same, continuous copper thread and attach it to the digital output 6.

Step 5: Stitch All the - Ends of Your LEDs Together and Attach to Ground

Strip, wind, and stitch all the - ends of your LEDs together, and attach them to the Arduino ground.

Step 6: Set Up Your Photo Detector

1. Poke your photo detector through the middle-back of your vest. Attach one end of it to the 3.3V of the Arduino with solder.

2. The other end must go through a 220 ohm resistor before going to ground and analog output, A0. Solder all these connections

3. Fold the metal pieces over and snip them off.

Step 7: Attach Your Switches

1. Strip the end of a copper wire and attach one end of it to the lower right corner of your switch, and the other stripped end to the 7 digital output on the Arduino

2. Strip the end of another copper wire and attach the end of it to the upper left corder of your switch, and the other stripped end to the ground output on the Arduino.

3. Strip the end of another copper wire and attach the end to the same side as your ground. Attach the other end to the 5V Arduino input.

Step 8: Seal Your Stitching With Puffy Fabric Paint

Once you have done all your stitching, cover all your wires with puffy fabric paint to ensure they don't short. Even though you used an insulated wire, the stripping can go a little too far sometime, so this is a clever way to make sure none of your wires mess anything up.

Step 9: Load Program Onto Arduino

Now upload the following program to your Arduino:

#include
#include #include

#define address 0x48

Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

const int leftSwitch = 8;//pushbutton left const int rightSwitch = 2;//pushbutton right

int leftLED = 5; int rightLED = 3; int nightLED=6; int ledvalue=0;

int buttonStateLeft=0; int buttonStateRight=0;

int lightSensor = A0; int sensorValue = 0;

int auxDio = 11;//auxilary input output int auxValue = 0; int auxAo = A0;///analoug output

void setup() { //initialize LEDs; pinMode(nightLED, OUTPUT); pinMode( leftLED, OUTPUT); pinMode(rightLED, OUTPUT); //initialize buttons; pinMode(leftSwitch, INPUT); pinMode(rightSwitch, INPUT);

}

void loop(){

//setup Night LED program; //TEST LEDs WORK WITH analogWrite(rightLED, 100); analogWrite(leftLED, 100);analogWrite(nightLED,100);

sensorValue = analogRead(lightSensor); if(sensorValue < 12) { analogWrite(nightLED,100); } if (sensorValue>8) { analogWrite(nightLED,0);

} //setup turn signals

buttonStateLeft=digitalRead(leftSwitch); //check if the pushbutton is pressed. if it is, buttonState is HIGH; if(buttonStateLeft==HIGH){ //turn LED on; digitalWrite(leftLED, HIGH); digitalWrite(rightLED, LOW); } else{ digitalWrite(leftLED, LOW); digitalWrite(rightLED, LOW);

}

buttonStateRight=digitalRead(rightSwitch); if(buttonStateRight==HIGH){ digitalWrite(rightLED,HIGH); digitalWrite(leftLED, LOW); } else{ digitalWrite(rightLED, LOW); digitalWrite(leftLED, LOW); }

}