Water Leak Detector Two Wires

EDIT: Pondered about it for couple of minutes, haha.

Well first, the EC value of the water will greatly determine what sort of readings you will get on the analog Pin so it would be good to know (if possible) what sort of water you will be monitoring. Off the top of my head, I would probably go with analog read to start, here is my reasoning:

Lets say you are testing for leaks in clean water systems. You will get a much lower reading on your Analog pin due to smaller EC rating in cleaner water. Using Analog read, it is simply a matter of changing code to determine when you want for example the LED to light up signalling conductivity is happening or not i.e

IF AnalogRead > 2000 for >20s then LEDpin HIGH
else If AnalogRead <2000 >20s LEDpin LOW

Also, fewer components :slight_smile:

Of course you will have to do some basic benchmark tests to see what sort of values you get. The alternative, to cater for them all, would be to monitor the reading you get on the Analog pin with no connection (so no water). Lets say you get a reading of 200… It is safe to assume anything greater than 250 for an extended period of time, would mean there is some sort of electrical current being conducted.

I have used similar though process in a solution utilising an ACS722 current sensor. The client wanted to know whether machine is on or not. Simply put, the ACS detected a value of ±500 with no current flowing. It was therefor safe to assume any value above i.e ±700 would indicate the machine is running as even the smallest of currents had a significant increase in the reading on the Analog pin. Been in use for a year… no false positives that we know of :slight_smile:

Neither way is wrong, depends on your preference. Hope it helps!!