I am working on a project which I have poured lots of cash into that involves water, pressure and electronics in very close proximity of each other... Lately, I have been considering adding some fail-safe mechanism which will cut all power to the machine if any water is detected by some carefully placed water sensors. I am no electrical genius (really far from it) so I was curious if there was a way to create a toggle circuit which the brain(arduino) could trigger that would manipulate a relay cutting power to the device; ultimately requiring human intervention to reset.

I realize that this is most likely impossible/not ideal, and that some of you may suggest a secondary, battery-powered system to do the job.



2 Answers 2


You can use an Latching relay and a momentary switch. So this would operate as follows, to get the system started you would have to press the momentary switch and hold it until the arduino latched the relay to the position where power is supplied to the machine. Once the system was running and water was detected by the sensor then the arduino would latch the relay into the position where power is no longer being supplied and it would take a human to come and press the momentary switch to start the system again


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Thanks! One question I have; It sounds like if I do this, I should add a shut-off option through the arduino and make it a menu option? Or can i simply add an on/off switch in addition? I guess either way will work... \$\endgroup\$
    – e6r339b
    Aug 31, 2015 at 16:29
  • \$\begingroup\$ Yes, either will work but I would recommend that you go with the physical on/off switch is an extra safety addition in case the arduino code goes rogue for some reason and you find yourself unable to shutdown the system \$\endgroup\$
    – Kvegaoro
    Aug 31, 2015 at 16:34
  • \$\begingroup\$ A possibly simpler system is to use a regular NO relay with a pushbutton across the contacts. Push the button to start, then the Arduino holds the relay closed. When it detects water, it opens the relay and everything shuts off. Operator presses pushbutton again to start back up. \$\endgroup\$
    – lyndon
    Aug 31, 2015 at 17:29
  • \$\begingroup\$ I agree, But using a NO relay if there is a power glitch the system will not be able to start again without human intervation, so it can make you think water was detected when there is only a power glitch. In the other hand the latching relay will allow the system to restart after a power glitch at the cost of higher complexity for the driver \$\endgroup\$
    – Kvegaoro
    Aug 31, 2015 at 17:33
  • \$\begingroup\$ I may ultimately go with the NO relay. My machine (actually an espresso machine) has a 120vac/1460w boiler. I am having a difficult time finding latching relays that can handle the load, let alone the combined load of the other parts+boiler. \$\endgroup\$
    – e6r339b
    Aug 31, 2015 at 17:39

Do not implement safety systems in software. If you are relying on this circuit to prevent a dangerous situation, i.e. electrocution or fire, then you had best use something more reliable than a bit of Arduino code to assure your safety.

Here is a (modified) example of something I once designed to protect a submersible pump. These pumps live under-water so it is important to detect if water is leaking into the electrical parts, which would be bad.

enter image description here


  • Relays rated for large currents (i.e. anything over a few amps) are not called "relays", they are called "contactors". Contactors are rated for full line voltage (230 VAC) and large currents (the Schneider CT series covers 16-100 A.)

  • this system is self-resetting, i.e. the power will be cut off automatically in case of water being detected, and power restored automatically once the water leak is no longer detected. You can arrange a latching relay of some sort, in series with the contactor coil, if you desire a hand-reset latch.

  • The Flygt MiniCAS II is the first example of a leakage alarm that came to mind. It is an industrial product and probably overkill for your needs. However, "water leakage alarm" is a good thing to search for.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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