I'm trying to create a circuit that detects water, however, I'm looking for a very accurate circuit that can even detect distilled water.

My current circuit uses an Arduino that has a pin constantly set to HIGH, it triggers an event when water touches two wires that shorts the circuit to ground, creating a LOW signal. Unfortunately, this only works for non-distilled water. I tested this circuit with water from my kitchen tap and it failed, which is surprising because my city uses well water and I didn't think it could be pure enough to not conduct electricity.

Is there a technique or design I can use to detect water, regardless of its purity?

  • 1
    \$\begingroup\$ Do you need to detect the mere presence of water or measure the level in a container, for example? \$\endgroup\$ – JYelton Mar 28 '20 at 6:51
  • 2
    \$\begingroup\$ Some ideas that come to mind, based on projects I've seen for this: An ultrasonic sensor to detect the water level, or a capacitive sensor. On the latter, there's an interesting video on the topic by Accidental Science, but I can't vouch for how well it would work in your application. \$\endgroup\$ – JYelton Mar 28 '20 at 6:59
  • 4
    \$\begingroup\$ A float tends to be a reliable method if it is just the level of liquid. \$\endgroup\$ – Solar Mike Mar 28 '20 at 6:59
  • 6
    \$\begingroup\$ Using two wires in this way is not a reliable method of level measurement. You'll also have issues with corrosion on the wires. Buy a cheap float switch - much more reliable solution which will detect all liquids regardless of conductivity! \$\endgroup\$ – Rohan Mar 28 '20 at 8:00
  • 4
    \$\begingroup\$ The change in refraction in a prism or similar when water touches it can be very reliable. \$\endgroup\$ – Russell McMahon Mar 28 '20 at 11:42

I like Russell's suggestion of optical methods.

Another approach is a capacitance meter : water has relative permittivity of about 80, therefore measuring the capacitance between two insulated plates a fixed distance apart will show if there is some high permittivity liquid between them. It's fairly independent of water purity.

Couple of drawbacks :

  • permittivity is temperature dependent (88 at 0C, 80 at 20C, 55 at 100C) so precision (e.g. using it to estimate depth, or the proportion of the plates submerged in water) would need some knowledge of temperature to compensate the error.
  • Cannot easily distinguish water from other high permittivity liquids, although alcohols and hydrocarbons appear to have about half the permittivity of water
  • A bit more complex than a simple resistive measurement.

Here is the type of sensor that @RussellMcMahon mentions (photo from here)

enter image description here

Other methods include capacitance, heat loss, and a simple mechanical float switch (usually a floating magnet operates a sealed reed capsule).

There is also the ancient one-shot flood detection method of putting an aspirin tablet in a clothespin. When the tablet dissolves, the contacts close.


Your statement

when water touches two wires that shorts the circuit to ground

suggests that you have a misunderstanding of how that works. A "short" would absolutely pull the pin to ground, but what you have there is a low resistance, not a short. In addition, the Arduino, with HIGH and LOW signals suggests you are reading a digital input, so you only see that pin going low when presented with low enough resistances. Your tap water isn't presenting a low enough resistance to trigger the circuit. You need to do an analog measurement so you can get a "number" rather than a yes/no result.

Now, when you go down that path, you will discover a number of other challenges, starting with the electrolysis and corrosion effects of running a current through your sensor. Other answers can address this and other methods.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.