Leak safety shutdown is a software and recommended circuitry to use with a micro-controller to switch off connected devices when liquid is detected and alert users with a flashing light. Leak-detector.ino works with a contact or non-contact liquid sensor (such as XKC-Y25-T12V) and a standard relay which can be closed or open when a leak is detected.
Simply download the .ino file onto your computer and upload it on your Arduino using the Arduino IDE.
Once the software is loaded, you can connect the micro-controller to your liquid sensor, a relay and your devices using the Arduino digital pins.
This example circuit contains a peristaltic pump that can sometimes leak due friction on the silicone tubing after several hours of non stop usage.
If liquid is detected by the sensor located underneath the pump the LED strip flashes rapidly to alert users and the pump supply is immediately stopped to prevent any further leakage.
Make sure to declare your connected device(s) as well as defining their allocated pin at the top of the script:
int liquidsensor_pin= 4;
int pump1_pin= 5;
int ledPin= 6;
You can also modulate the flashing speed by changing interval
(in millisec)
long interval = 100; // will flash very quickly
// or
long interval = 300; // will flash much slower