water leak sensor

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?

Its just the same as a Rain sensor :slight_smile:

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.)

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)



And just to set you off in the right direction here is the code to light up pin 13 when it detects water

 /* 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); 

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....?

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.


It will work much better if your sub operates in salt water.

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