Very simple water leakage detection idea

I am thinking of the cheapest water leakage sensor (0 $). I would like to share my idea and get feedback on its feasibility.

Here's a brief explanation:
I will be using an esp8266.
Configure one GPIO pin as INPUT and another as OUTPUT .
Connect cables to the GPIO pins.
Place the end of the cables into an empty glass.
Create a loop in your code that alternates between setting the OUTPUT pin to HIGH and LOW using digitalWrite.
Continuously read the voltage on the INPUT pin using digitalRead within the loop.
When water is poured into the glass, it will (would) create a conductive path between the cables, allowing current to flow. This will result in a change in voltage at the INPUT pin, indicating the presence of water.
I am waiting for your comments and advice. Thank you.

This is basically how moisture detectors work.
There is a basic problem with it in that as the polarity is always the same corrosion builds up on the wires. The way round that is to alternate the excitation voltage using a H-bridge or an AC voltage.

Note pure water is an insulator. Water with salts in them will conduct. Salts not just salt. So dissolved minerals.

1 Like

Use an old smoke alarm...plenty of how to on the web.

I don't see what you mean by " old smoke alarm" . I am detecting water leak.

This is obviously a copy of your assignment.

Why do you think, we should do your homework?

1 Like

To be fair OP asked for feasibility of the idea, not the code to do so… so I’m not convinced it’s a copy of an assignment.

Who would write his specifications as imperative sentences?

But never mind, you can do the OP's homework (my point of view only) if you like, I won't.

May be - may be not - I don’t know but was willing to give the benefit of doubt to OP as his ask was not do any coding. Also if that was the teacher’s instruction, why would OP ask if that can work?

Anyway it’s calling just for a yes or no it would work. So I don’t see answering « it will work if you get non pure water in the glass » as doing a homework for him.

OP will hopefully clarify

Seems like a workable approach since you're only detecting "presence" of water touching the wires. Some difficulties you may find is:

  • setting the initial depth of the wires so they "just" touch the water.
  • waters tendancy to stick to objects and get pulled up (meniscus).

If you need high resolutiion, have you considered measuring weight?
Of course, could get better resolution if using a tall, narrow glass ... image

1 Like

Most of us have worked or seen this problem many times, this is probably the OPs first and without experience he did the correct thing and asked the question. If it is homework he should have mentioned it but that is not a requirement on this forum as I understand it. In my opinion the only bad question is the one that does not get asked. To get past the corrosion he could alternate between input and output pins as well. That would constantly reverse the current flow. That would be a lot less work then an H-Bridge or equal.

1 Like

Well as has been said since the current is always one way you would get corrosion. To avoid this you follow our idea but reverse the current.

Like this

I think that the idea is not viable, because in fresh water the value read by digitalRead() will never reach a high level - that is, the sensor will not work.

In such a detector, the electrode potential will be no more than fraction of volt, a signal amplifier is needed to detect it, arduino will not show anything.

The correct thing for the OP would have been to use a search engine and/or read a book first (oh! Heresy! Dead trees!)

Something like this would be easy to setup and test and adapt to use an Arduino analog input.
Could use a super-bright LED and higher resistance and/or higher gain transistor for more sensitivity.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.