Introduction: Light and Water Reactive Raincoat

Picture of Light and Water Reactive Raincoat

This semester at college, I am in a class called Computing and Craft which is about incorporating circuitry and micro-controllers and craft to bring our projects to the next level.
For our first big project, I decided to make a raincoat the reacted to light and water.  Being from California and going to school in Massachusetts has been a big transition and the sudden downpours can catch you unaware.  This raincoat has built in light and water sensors so when it gets dark the raincoat lights up so the wearer will be visible in the dark, and when it gets wet, a warning beep sounds so the wearer can head for cover.

Step 1: Raincoat

Picture of Raincoat

For the coat itself, I used a very cheap plastic one that my professor had around.  I reinforced all the seams on the sewing machine because they had all just been melted together and were coming apart.  The coat also had pockets which was convenient for storing the arduino.

Step 2: Circuitry

Picture of Circuitry

For the circuitry, I tried everything on a solderless breadboard even though everything did end up being soft circuits.  8 LEDs (4 on each sleeve) are attached by poking the leads through the plastic, winding the leads around needle-nose pliers, and then stitching them together using conductive thread.  I didn't realize just how resistive the thread was and in the future I would recommend wiring in series, not parallel as I did.
The circuits I used were based on the digram below which I got from this board.  For my water sensor I ended up using a 1M resistor instead of 10k.
For the light sensor, I based my circuit off of this SparkFun inventor's guide for the light sensor on page 24.

Step 3: Code

Picture of Code

I wrote two programs, one to control the light sensor and LEDs and one to control the water sensor and speaker.  I based to code off the tutorials found here for the light sensor and speaker tutorials.

Light Sensor Code:
int LEDPin = 13;

int CDSPin = 0;

void setup(){
  pinMode(LEDPin, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  int lightLevel;
  lightLevel = analogRead(CDSPin);
  Serial.println(lightLevel);
  delay(100);
  if (lightLevel < 300)
  {
    digitalWrite (LEDPin, HIGH);
  }
  else if (lightLevel > 300)
  {digitalWrite (LEDPin, LOW);
  }
}


Water Sensor Code:

int waterSensor = 2;

int ledPin = 13;

int speakerPin = 9;

int length = 15; // the number of notes
char notes[] = "gggefffd"; // a space represents a rest
int beats[] = { 
  1, 1, 1, 3, 1, 1, 1, 3, };
int tempo = 300;

void playTone(int tone, int duration) {
  for (long i = 0; i < duration * 1000L; i += tone * 2) {
    digitalWrite(speakerPin, HIGH);
    delayMicroseconds(tone);
    digitalWrite(speakerPin, LOW);
    delayMicroseconds(tone);
  }
}

void playNote(char note, int duration) {
  char names[] = { 
    'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
  int tones[] = { 
    1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };

  // play the tone corresponding to the note name
  for (int i = 0; i < 8; i++) {
    if (names[i] == note) {
      playTone(tones[i], duration);
    }
  }
}

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  pinMode(speakerPin, OUTPUT);
}

void loop() {
  int sensorData;
  sensorData = analogRead(waterSensor);
  Serial.println(sensorData);
  if (sensorData < 50){
    playTone('b', 100);
  }
  else if (sensorData > 51){
    ;
  }
}



 


Step 4: Finished Product

Picture of Finished Product

I am trying to get better video of it working, but for now, here's me talking about the LEDs and light sensor!  Here is a video of me showing it the class.

Comments

pmounica (author)2011-10-07

can i do the same using PIC microcontroller
If so i need ur help

SHIFT! (author)2011-03-12

WOW, how is it that I haven't seen this until now? This is amazing, so functional and stylish! I've got an old trenchcoat that I should try this out on.

Do you know if this could work with umbrellas?

caitlinsdad (author)2011-03-03

Ooo, another wearable etextile project. Private message Lynne Bruning on your project so that you can show it in one of her Maker Faire etextile shows. She is always looking for cool stuff. I got to show off my light-up hoodie and gloves last year in the NYC Maker Faire.

Oh that would be sweet! It's probably going to a Maker Faire in Massachusetts and possibly the California Maker Faire as well, since I will be at both of them :)

Thanks Catlinsdad! You are the BEST!

Danger - information for the Bay Area Showcase is listed on my website.
Please please - bring your coat! 

amonmillner (author)caitlinsdad2011-03-03

If this project were to make it to the NYC Maker Faire, it might make some people less upset at rain that may fall during the event. "Danger is my Middle Name" could suit up and run out in the rain to put on a good show.

zazenergy (author)2011-03-03

Yes! I'd love to see a video of this. It sounds really cool!

About This Instructable

2,537views

4favorites

License:

Bio: I'm just a lady who likes making stuff. I got my degree in engineering but also enjoy cooking, sewing, knitting, gardening and backpacking, among ... More »
More by Danger is my middle name:Bubble Unicorn Speaker30+ #Vanlife Projects to Get You on the Road15 DIY Science Projects
Add instructable to: