water leak sensor
Moderators: grovkillen, Stuntteam, TD-er
water leak sensor
hi there,
has anyone built a water leak sensor with the esp? I would like to put it next to our washing machine on a battery powered Basis which sends a message to my homeautomation system...
From my point of view there are two Options:
1. having esp in deep sleep and waking it up via interupt coming from a leak sensor which is more or less two wires which are "shortcutted" by the leaking water and get a gpio on high.
2. have a Transistor which is driven by a current which Comes form the leak sensor and the Transistor supplys the esp with power and esp sends message to a home Automation System on boot.
Any ideas?
regards
karl
has anyone built a water leak sensor with the esp? I would like to put it next to our washing machine on a battery powered Basis which sends a message to my homeautomation system...
From my point of view there are two Options:
1. having esp in deep sleep and waking it up via interupt coming from a leak sensor which is more or less two wires which are "shortcutted" by the leaking water and get a gpio on high.
2. have a Transistor which is driven by a current which Comes form the leak sensor and the Transistor supplys the esp with power and esp sends message to a home Automation System on boot.
Any ideas?
regards
karl
Re: water leak sensor
Check for LM 393. It basically is an IC that allows you to convert "two short circuit wires" into a reliable 1/0, sensitivity adjusted by poti. You can buy them as ready to use block.
They have 2 outputs, digital and analog, where analog is proportional / inverse proportional to resistance between wires.
Hook up the digital to interupt deep sleep, the analog to analog input. Then logic is: when wake up then send message with analog value. If you put the "wires " upright, the analog value can be an indication of water depths.
http://www.electrodragon.com/analog-and ... omparator/
https://diyhacking.com/arduino-soil-moisture-sensor/
They have 2 outputs, digital and analog, where analog is proportional / inverse proportional to resistance between wires.
Hook up the digital to interupt deep sleep, the analog to analog input. Then logic is: when wake up then send message with analog value. If you put the "wires " upright, the analog value can be an indication of water depths.
http://www.electrodragon.com/analog-and ... omparator/
https://diyhacking.com/arduino-soil-moisture-sensor/
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: water leak sensor
This one should work for you.
https://www.ebay.de/i/322626735255?chn= ... 1575298798
Moisture and rain version of LM393 block have inverse output afaik
https://www.ebay.de/i/322626735255?chn= ... 1575298798
Moisture and rain version of LM393 block have inverse output afaik
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: water leak sensor
You will probably have to remove the leds from block for battery op
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: water leak sensor
I'd try another way.
(Beware - just my ideas, not tested)
I'd use a rule which sends message and then puts the ESP to sleep.
Then I'd try to use a 4011 or 4012 cmos logic gate for sensoring and use the output signal to reset the ESP8266.
The reset will restart the ESP, send message and put it back to sleep.
The MOS 40xx take up typically around 0,25µA quiescent current so this might be a nice way to provide long battery life.
Regards
Shardan
(Beware - just my ideas, not tested)
I'd use a rule which sends message and then puts the ESP to sleep.
Then I'd try to use a 4011 or 4012 cmos logic gate for sensoring and use the output signal to reset the ESP8266.
The reset will restart the ESP, send message and put it back to sleep.
The MOS 40xx take up typically around 0,25µA quiescent current so this might be a nice way to provide long battery life.
Regards
Shardan
Regards
Shardan
Shardan
Re: water leak sensor
Given the battery operation, Shardans way is probably better. Also leaves the option to measure supply voltage once a day with analog, probably a good idea to get a warning notification before the juice runs out.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: water leak sensor
Hi
Thanks for inputs...
Concerning NAND, you mean I should connect both NAND inputs and use it as one electrode and put + on another electrode. In case of water shortcutting electrode NAND goes on high...
Right?
What would i have to set as parameters in espeasy?
Regards
Karl
Thanks for inputs...
Concerning NAND, you mean I should connect both NAND inputs and use it as one electrode and put + on another electrode. In case of water shortcutting electrode NAND goes on high...
Right?
What would i have to set as parameters in espeasy?
Regards
Karl
Re: water leak sensor
I think about water leak sensor too.
I want long battery life and let my controller ( Domoticz ) now, that sensor is alive + send me message, if not.
Circuit, witch switch on power for ESPEasy when water leak is detected, its not big problem. All other time ESPEasy is switched completely off.
But sending periodic messages to controller ( maybe with battery level ) can be done by two ways.
1) Use deep sleep with timer, but max time between messages is cca 71 minutes.
2) Switch on power for ESPeasy through external signal, for example one per day.
This can be done by many different ways.
For example:
1) Program rtc Chip, like DS3231 for alarm one per day
2) Use some CMOS counter chips, maybe cascaded, (with oscilarẗors built in? ) CMOS4060
3) ...
ESPEasy will send signal with battery level for example, witch means " Hi, I am alive "
And if Domoticz detect two day absence of this message, it will send me e-mail: " Your water leak sensor No. xx is dead ! "
I Think, it can work for years with Alcaline batteries.
I want long battery life and let my controller ( Domoticz ) now, that sensor is alive + send me message, if not.
Circuit, witch switch on power for ESPEasy when water leak is detected, its not big problem. All other time ESPEasy is switched completely off.
But sending periodic messages to controller ( maybe with battery level ) can be done by two ways.
1) Use deep sleep with timer, but max time between messages is cca 71 minutes.
2) Switch on power for ESPeasy through external signal, for example one per day.
This can be done by many different ways.
For example:
1) Program rtc Chip, like DS3231 for alarm one per day
2) Use some CMOS counter chips, maybe cascaded, (with oscilarẗors built in? ) CMOS4060
3) ...
ESPEasy will send signal with battery level for example, witch means " Hi, I am alive "
And if Domoticz detect two day absence of this message, it will send me e-mail: " Your water leak sensor No. xx is dead ! "
I Think, it can work for years with Alcaline batteries.
Re: water leak sensor
you say "Circuit, witch switch on power for ESPEasy when water leak is detected, its not big problem. "
how are you going to solve it?
regards
karl
how are you going to solve it?
regards
karl
Re: water leak sensor
Something like this:
https://e2e.ti.com/blogs_/b/powerhouse/ ... te-mosfets
datasheet:
http://www.ti.com/product/TPS22910A
Quiescent Current (Iq) (Typ) (uA):
But it is possible with discrete parts too.
https://e2e.ti.com/blogs_/b/powerhouse/ ... te-mosfets
datasheet:
http://www.ti.com/product/TPS22910A
Quiescent Current (Iq) (Typ) (uA):
But it is possible with discrete parts too.
Re: water leak sensor
Hi Guys,
I have the same Problem...
I want a simple Solution to Connect 2 wires to nodemcu8266 with easyesp in deepsleep and wakes up from deepsleep when the two wires are in contact with water.
next step should be a message to my telegram bot.
Is there a simple Solution?
I have the same Problem...
I want a simple Solution to Connect 2 wires to nodemcu8266 with easyesp in deepsleep and wakes up from deepsleep when the two wires are in contact with water.
next step should be a message to my telegram bot.
Is there a simple Solution?
Re: water leak sensor
Hi,
I have just tried a solution where I start the ESP out of deep sleep by giving a GND Signal to RST via a BS170 MOSFET Transistor. the current on the gate of the BS270 which is led through water is sufficient to errect the BS170...
regards
karl
I have just tried a solution where I start the ESP out of deep sleep by giving a GND Signal to RST via a BS170 MOSFET Transistor. the current on the gate of the BS270 which is led through water is sufficient to errect the BS170...
regards
karl
Last edited by karl222 on 26 Nov 2017, 18:01, edited 3 times in total.
Re: water leak sensor
Great, woudl you mind to share the schematic or at least some pictures of your test sensor?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: water leak sensor
Hi,
I just did a fritzing for you.
As a casing I ordered a few of these and will take out electronics in order to replace it with esp: https://www.ebay.de/itm/Wireless-Buzz-W ... 2749.l2649
regards
karl
edit: I am using the BS170 NOT the BS270
I just did a fritzing for you.
As a casing I ordered a few of these and will take out electronics in order to replace it with esp: https://www.ebay.de/itm/Wireless-Buzz-W ... 2749.l2649
regards
karl
edit: I am using the BS170 NOT the BS270
- Attachments
-
- Water Leak Sensor_Steckplatine.jpg (552.27 KiB) Viewed 29208 times
Last edited by karl222 on 26 Nov 2017, 18:01, edited 1 time in total.
Re: water leak sensor
thanks, any specific reason you used a mosfet instead of a simple NPN transistor?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: water leak sensor
It was a hint from an other user. I think a standard transistor needs a higher current but maybe it works with a BC237 as well...
with the BS270 it works, I can confirm
with the BS270 it works, I can confirm

Re: water leak sensor
I'd like to challenge another approach.
why not use the bs170 to power up the esp. this saves standby power at all. bs170 doesn't consume any power at all, when there is no water detected, only in case of high water gain of bs170 is errected and esp is powered up and sends a message on boot.
I have tried this already but the esp doesn't come up properly. instead of consuming 70mA it consumes 180mA and the blue led blinks slowly...
any ideas on my idea...
regards
Karl
why not use the bs170 to power up the esp. this saves standby power at all. bs170 doesn't consume any power at all, when there is no water detected, only in case of high water gain of bs170 is errected and esp is powered up and sends a message on boot.
I have tried this already but the esp doesn't come up properly. instead of consuming 70mA it consumes 180mA and the blue led blinks slowly...
any ideas on my idea...

regards
Karl
Last edited by karl222 on 26 Nov 2017, 18:01, edited 2 times in total.
Re: water leak sensor
Nearly any small N-FET should work (BS270, BSS138, 2N7000, 2N7002.....)
Just one point:
These FETs are somewhat sensitive to electrostatic discharge.
So a serial resistor between gate and sensor and a small ceramic capacitor 10nF .. 47nF between gate and ground
gives at least some protection against static voltage.
Remember, this makes the sensor a bit slow (3..5 Seconds).
Standard NPN transistors won't work reliable with such simple circuit, it needs
more electronics around to make that work.
The reason: Standard Transistors are driven by current, FET's are driven by (nearly pure) voltage.
For a standard transistor it needs a low resistance of water on the sensor, about 10..100KOhm.
It needs a big sensor and a lot of water, some drops of pure water won't do.
Just one point:
These FETs are somewhat sensitive to electrostatic discharge.
So a serial resistor between gate and sensor and a small ceramic capacitor 10nF .. 47nF between gate and ground
gives at least some protection against static voltage.
Remember, this makes the sensor a bit slow (3..5 Seconds).
Standard NPN transistors won't work reliable with such simple circuit, it needs
more electronics around to make that work.
The reason: Standard Transistors are driven by current, FET's are driven by (nearly pure) voltage.
For a standard transistor it needs a low resistance of water on the sensor, about 10..100KOhm.
It needs a big sensor and a lot of water, some drops of pure water won't do.
Regards
Shardan
Shardan
Re: water leak sensor
Thanks Shardan for the clear explanationShardan wrote: ↑19 Nov 2017, 16:04 Nearly any small N-FET should work (BS270, BSS138, 2N7000, 2N7002.....)
Just one point:
These FETs are somewhat sensitive to electrostatic discharge.
So a serial resistor between gate and sensor and a small ceramic capacitor 10nF .. 47nF between gate and ground
gives at least some protection against static voltage.
Remember, this makes the sensor a bit slow (3..5 Seconds).
Standard NPN transistors won't work reliable with such simple circuit, it needs
more electronics around to make that work.
The reason: Standard Transistors are driven by current, FET's are driven by (nearly pure) voltage.
For a standard transistor it needs a low resistance of water on the sensor, about 10..100KOhm.
It needs a big sensor and a lot of water, some drops of pure water won't do.

My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: water leak sensor
Hi guys,
nice
I will Test it.
I tested before a Flip Flop with 3 transistors, this Works Perfect but you need many things...
https://github.com/esp8266/Arduino/issues/1488
( Fritzing - Monostable Flip Flop )
nice

I will Test it.
I tested before a Flip Flop with 3 transistors, this Works Perfect but you need many things...
https://github.com/esp8266/Arduino/issues/1488
( Fritzing - Monostable Flip Flop )
Re: water leak sensor
Hi,Shardan wrote: ↑19 Nov 2017, 16:04 Nearly any small N-FET should work (BS270, BSS138, 2N7000, 2N7002.....)
Just one point:
These FETs are somewhat sensitive to electrostatic discharge.
So a serial resistor between gate and sensor and a small ceramic capacitor 10nF .. 47nF between gate and ground
gives at least some protection against static voltage.
Remember, this makes the sensor a bit slow (3..5 Seconds).
Standard NPN transistors won't work reliable with such simple circuit, it needs
more electronics around to make that work.
The reason: Standard Transistors are driven by current, FET's are driven by (nearly pure) voltage.
For a standard transistor it needs a low resistance of water on the sensor, about 10..100KOhm.
It needs a big sensor and a lot of water, some drops of pure water won't do.
I don't understand what you mean exactly
it is clear that there should be a small capacitor between gate and ground
you mean gate --- resistor 10k --- water --- +
but it doesn't work. esp vdd goes to 3,0V only and consumes 120mA instead of 70mA.
any ideas how to get the MOSFET powering up the ESP properly. via the VDD pin..
thanks
karl
Re: water leak sensor
But do not forgot, that if you wake up your sensor only when water leak, you will never know, if your sensor is still alive after some time.
Better way is wake up sensor periodically and send some data to controller ( with battery voltage for example ).
And if controller do not receive any data for some period, it will send alert to you.
Then you have assurance, that your sensor is ready detect water leakage all the time.
You can use simply internal timer and wake up cca every hour with 20 mikroAmp. consumption in this time.
Or build something sophisticated and wake up every 2 hours with consumption 1 mikroAmps between wake ups.
Look here for inspiration:
http://www.kevindarrah.com/wiki/index.php?title=Pusher
Better way is wake up sensor periodically and send some data to controller ( with battery voltage for example ).
And if controller do not receive any data for some period, it will send alert to you.
Then you have assurance, that your sensor is ready detect water leakage all the time.
You can use simply internal timer and wake up cca every hour with 20 mikroAmp. consumption in this time.
Or build something sophisticated and wake up every 2 hours with consumption 1 mikroAmps between wake ups.
Look here for inspiration:
http://www.kevindarrah.com/wiki/index.php?title=Pusher
Re: water leak sensor
You are right, probably the better way...
Thx
Thx
Re: water leak sensor
I agree this page bring a lot of inspiration but still... I don't see this guy using deepsleep for waking up on a regular interval! Am I missing somethign so obvious that I can't see in his schematic?kimot wrote: ↑03 Dec 2017, 23:37 But do not forgot, that if you wake up your sensor only when water leak, you will never know, if your sensor is still alive after some time.
Better way is wake up sensor periodically and send some data to controller ( with battery voltage for example ).
And if controller do not receive any data for some period, it will send alert to you.
Then you have assurance, that your sensor is ready detect water leakage all the time.
You can use simply internal timer and wake up cca every hour with 20 mikroAmp. consumption in this time.
Or build something sophisticated and wake up every 2 hours with consumption 1 mikroAmps between wake ups.
Look here for inspiration:
http://www.kevindarrah.com/wiki/index.php?title=Pusher
I will brainstorm with myself (the best way to come up with bright or sh***y ideas

My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: water leak sensor
He do not use deep sleep because high consumption 20 mikroAmp and wake up interval max 74 minutes.
His solution uses timer to wake up possibility every max 7 200 seconds ( not wake up really - switch on ESP and through sw action switch off then ) or through external event.
Consumption 1 mikroAmp.
Will bi nicer "wake up" one time per day - maybe with some RTC chips with alarm pulse possibility or another long interval timer.
His solution uses timer to wake up possibility every max 7 200 seconds ( not wake up really - switch on ESP and through sw action switch off then ) or through external event.
Consumption 1 mikroAmp.
Will bi nicer "wake up" one time per day - maybe with some RTC chips with alarm pulse possibility or another long interval timer.
Re: water leak sensor
Yes got it, I was before looking the only IC I didn't know (TLP5111) and it looks perfect for such a job.kimot wrote: ↑05 Dec 2017, 16:26 He do not use deep sleep because high consumption 20 mikroAmp and wake up interval max 74 minutes.
His solution uses timer to wake up possibility every max 7 200 seconds ( not wake up really - switch on ESP and through sw action switch off then ) or through external event.
Consumption 1 mikroAmp.
Will bi nicer "wake up" one time per day - maybe with some RTC chips with alarm pulse possibility or another long interval timer.
I've already a latch circuit I designed to allow micro to turn off completely itself, but it was for a project where the turn on was to be manually activated then the micro performs itw own cycle of actions and turn itself off completely once done using a GPIO as a trigger.
I think I will try to add this IC to my latching switch circuit so to have the timely wake up and as well the sensor wake up, thanks a lot for the link!!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
-
- New user
- Posts: 3
- Joined: 19 Jun 2017, 19:48
Re: water leak sensor
hi! is it possible to create water flow sensor by using sound detection?
How this works?
streamlabswater.com
How this works?
streamlabswater.com
-
- New user
- Posts: 1
- Joined: 08 Mar 2018, 07:47
Re: water leak sensor
Finnarduino, I think you should go to the youtube, and watch videos for understanding the process or work of water flow sensor.
Who is online
Users browsing this forum: No registered users and 10 guests