# How to detect distilled water?

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?

• Do you need to detect the mere presence of water or measure the level in a container, for example? Commented Mar 28, 2020 at 6:51
• 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. Commented Mar 28, 2020 at 6:59
• A float tends to be a reliable method if it is just the level of liquid. Commented Mar 28, 2020 at 6:59
• 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! Commented Mar 28, 2020 at 8:00
• The change in refraction in a prism or similar when water touches it can be very reliable. Commented Mar 28, 2020 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)

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.

• Or a pellet of Sodium :-) Commented Oct 18, 2021 at 9:21

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.

Let me tell you how I did it. I used an analog input port with a 1 megaohm resistor between +5V and the port. With zero load, it gives a pretty good high signal - over 1000.

Then, I connected the port to a stainless steel probe, in a stainless container (this is for an automatic distiller), container is grounded. When the distilled water hits it, there is a small but reliably detectable voltage drop, in my case I just used below 1000 for the indicator.

Works great, has been running my rebuilt, Arduino-controlled distiller for a few months.

• Can you share your setup please, I tried this method and it didn't work in my case xD Commented May 4, 2023 at 12:11