Go Down

Topic: water leak sensor (Read 15 times) previous topic - next topic

jucasan

I'm building a little submarine and I was thinking how I can make a simple water leak detector. I'm thinking about 2 striped cables close to each other and when they short cut because the water it send the arduino the information. The problem is I don't have any electronic skills to do this circuit. Can anybody point me how can I make this?
Tx

n00b

Its just the same as a Rain sensor :)

you seem to have it worked out, but here is an example using two strips of copper (a couple of tracks from some strip-board would be perfect, but  as you say you could use stripped wire, or anything conductive.)

n00b

#2
Sep 02, 2009, 01:27 am Last Edit: Sep 02, 2009, 03:22 pm by n00b Reason: 1
Ok sounds like a really fun project so i just went and made one (thought it may help if your not used to reading schematics)

[size=18]DRY[/size]



[size=18]WET[/size]


And just to set you off in the right direction here is the code to light up pin 13 when it detects water
Code: [Select]
/* Flood Sensor

This sketch will light up the LED on Pin 13, when water (anything conductive) bridges the gap in the sensor.
 
  created 02/09/09
  by n00b


*/

const int floodSensors = 2;     // the number of the Flood Sensor pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int floodSensorState = 0;         // variable for reading the floodSensors status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the flood Sensor pin as an input:
  pinMode(floodSensors, INPUT);    
}

void loop(){
  // read the state of the flood Sensor value:
  floodSensorState = digitalRead(floodSensors);

  // check if the flood Sensor is wet.
  // if it is, the floodSensorState is HIGH:
  if (floodSensorState == HIGH) {    
    // turn LED on:    
    digitalWrite(ledPin, LOW);  
  }
  else {
    // turn LED off:
    digitalWrite(ledPin, HIGH);
  }
}

Jake Mc

This doesn't work for me. Using a Duemilanove mega 328.

The only way I can get a positive reading is to short the leads together.

Come to think of it, if the resistance of water is meg ohms, how will this low a resistance be able to pull the input pin to a low when 10K is holding it high? I don't see why this would ever work....?

retrolefty

#4
Oct 22, 2010, 10:57 pm Last Edit: Oct 22, 2010, 11:00 pm by retrolefty Reason: 1
Quote
This doesn't work for me.


You may have to play with the resistor value, say 100k, 1 meg, etc. Also as an experiment you might try shaking some salt into the water plate and see what happens. Also maybe trying to use a analog input pin where there doesn't have to be such a large change of reading Vs a digital input pin. You could then analyze the analog input value between wet and dry values to determine the best threshold value to use in the switching logic.

Lefty

AWOL

It will work much better if your sub operates in salt water.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

kevinsa5

if it isn't in salt water, you could always include a small payload of salt scattered around the bottom   ;D

Go Up