The use of the ESP8266 in the world of IoT

User avatar
By lethe
#18275 20mA for a water leak sensor seems quite excessive to me. Basically all you need is a general purpose bipolar transistor (BC547 or similar), some resistors and 2 electrodes (some blank wire will do).
The circuit is not much more than a basic transistor switch. This one should work: http://www.instructables.com/id/Simple-Water-Sensor/ (you can remove the LED and change the resistor to a 10k one. Connect the ESP pin between the resistor and transistor).

If you use the transistor in place of the switch in this circuit http://j0h.nl/-1QB (courtesy of Sprite_tm, posted here), the ESP would only be powered if a leak is detected.