How To Build A Water Leak Detection System (2024)

by Vytas Sinkevicius

Damage from appliance water leaks (such as water heaters, dishwashers, fridges and washing machines) cause millions of dollars in insurance claims every year.

How To Build A Water Leak Detection System (1)

There are many different types of water leak detection systems – the most efficient ones react at the first sign of presence of moisture, trigger an audible alarm, and provide an email alert. Audible only alarm type units do not perform well if nobody is there to hear the alarm.

We have created a water leak detection system kit using the PI-SPI Series of products, all that needs to be added is a Raspberry Pi and a 5VDC power supply for the Raspberry Pi.

You will need the following items to build a basic water leak detection system:

Qty. 1 x PI-SPI-8AI-4TEMP-4VDC Analog Input I/O Module
Qty. 1 x PI-SPI-8KO Relay I/O Module
Qty. 1 x PI-SPI-CABLE-40x26-2 Ribbon Cable (Required to connect to the Raspberry Pi)
Qty. 1 x PI-SPI-CABLE-26x26-2 Ribbon Cable (Required to connect the two PI-SPI modules)
Qty. 1 x Raspberry Pi Series 3, 4 or 5
Qty. 1 x 5 VDC Power Supply for the Raspberry Pi
Qty. 1 x 24 VDC Power Supply for the PI-SPI Series Modules
Qty. 1 x Water Sense Cable

Optional items can include temperature sensors for the Hot and Cold water lines of a Hot Water Tank, Alarm Buzzers, and DIN Rail Mount Enclosures.

Kits are available here.

Theory of Operation:

For this demo application, the system will have the following:

- Four zones of water leak detection
- Each zone works with a water leak sense cable (1 x 6’ cable as part of the kit)
- Up to four temperature sensors (2 x 10K NTC thermistor with 36” leads as part of the kit)

The PI-SPI-8KO module has 6 channels of voltage output. For Zone 1 operation, we connect one lead of the water sense cable to the K3 terminal, and connect the other lead of the water sense cable to the PI-SPI-8AI analog input module channel 4 which has been configured as a voltage input (0 to 6.6 VDC).

Sequence of Operation:

1. The K3 output is turned ON providing a 3.3 VDC output for 50 mSeconds.
2. At the end of the pulse, the Analog Input Channel 4 is read.
3. The K3 output is turned off.
4. If the reading is less than 20 AD counts, there is no moisture present on the water sens cable
5. If the reading is greater than 600 AD counts, the water sense cable is conducting and moisture is present on the cable
6. The alarm state is set or reset depending on the AD reading.

Wiring Diagram:

(Zone 1 Example complete with Audible Alarm and Temperature Sensors):

How To Build A Water Leak Detection System (2)

Python Sample Code

The following code sample has been fully tested for all zones and sensor inputs. When a water leak is detected, an alert email is sent to the users email. The program runs once per second.

# pi-spi-h2o-demo.py
# Import libraries

import smtplib
import time

from time import sleep
from widgetlords.pi_spi import *
from widgetlords import *

# initialize modules

init()
inputs = Mod8AI()
relays = Mod8KO()

# Set up the email server and configure

user = 'your_email@gmail.com' # Typically your email account
password = 'Your password is here' # Your password for your email account
sent_from = user
send_to = ['to@gmail.com'] # Send the email to
subject = 'WATER LEAK ALARM'
smtp_server = 'smtp.gmail.com' # Your email provider server
smtp_port = 465 # Typically the port is 465

# Initialize email sent flag to prevent multiple emails

emails_sent = 0

# Define Relay Outputs

K1 = 0
K2 = 1
K3 = 2
K4 = 3
K5 = 4
K6 = 5
K7 = 6
K8 = 7

ON = 1
OFF = 0

# Water leak zones

Zone_Reading = [0,0,0,0]
Zone_Alarms = [0,0,0,0]
Zone_Status = ['OK','OK','OK','OK']

# Alarm threshold AD counts

Alarm_Threshold = 600

# Temperature Sensors

Temp_AD = [0,0,0,0]
Temp_Deg = [0,0,0,0]
Temp_Read = ['-','-','-','-']

# Email send function

def send_email(server,port,_user,_password,_from,_to,text):
try:
smtp_server = smtplib.SMTP_SSL(server, port)
smtp_server.ehlo()
smtp_server.login(_user, _password)
smtp_server.sendmail(_from, _to, text)
smtp_server.close()
#print ("Email sent successfully!")
except Exception as ex:
print ("Something went wrong….",ex)

# Read zone AD counts function
# Each zone relay is turned on for 50 mSec to apply voltage
# to one wire of the water sense cable
# The analog input channel reads the voltage and stores the AD Counts
# Dry condition will read less than 5 AD Counts
# Wet condition will read > 1000 AD counts

def zone_read(zone,relay):
relays.write_single(relay,ON)
sleep(.05)
Zone_Reading[zone] = inputs.read_single(zone+4)
relays.write_single(relay,OFF)

# Get the individual zone alarm conditions function
def get_zone_alarms(zone):
if Zone_Reading[zone] > Alarm_Threshold:
Zone_Alarms[zone] = 1
else:
Zone_Alarms[zone] = 0

while True:
# read all Zones
zone_read(0,K3)
zone_read(1,K4)
zone_read(2,K5)
zone_read(3,K6)

# Get zone alarms
alarms = 0

for i in range(4):
get_zone_alarms(i)
alarms = alarms + Zone_Alarms[i]

# Configure email body for Zone Alarms

for i in range(4):
if Zone_Alarms[i] != 0:
Zone_Status[i] = 'ALARM'
else:
Zone_Status[i] = 'OK'

# Read and Configure Temperature Sensor inputs of email body

for i in range(4):
Temp_AD[i] = inputs.read_single(i)
Temp_Deg[i] = steinhart_hart(10000, 3380, 4095, Temp_AD[i])

if Temp_AD[i] > 4050:
Temp_Read[i] = '-'
else:
Temp_Read[i] = ("%0.1f Deg C" % Temp_Deg[i])

# Temperature Sensor input 4 is used as a push button input
# to send e test email and test the audible
if Temp_AD[3] < 20:
Temp_Read[3] = 'Sending Test Email'

# Read time for the email body for a time stamp
seconds = time.time()
local_time = time.ctime(seconds)

# Prepare the body of the email
body = """\
Status: %s
Zone 1: %s
Zone 2: %s
Zone 3: %s
Zone 4: %s
Temp 1: %s
Temp 2: %s
Temp 3: %s
Temp 4: %s

""" % (local_time, Zone_Status[0], Zone_Status[1], Zone_Status[2], Zone_Status[3], Temp_Read[0], Temp_Read[1], Temp_Read[2], Temp_Read[3])

# Configure the complete email to be sent

email_text = """\
From: %s
To: %s
Subject: %s
%s
""" % (sent_from, ", ".join(send_to), subject, body)

# Check for alarms and send email if required
# Temperature Sensor input 4 is used as a push button input
# to send e test email and test the audible

if alarms > 0 or Temp_AD[3] < 20:
# Turn on Audible relay K1
relays.write_single(K1,ON)
# send email only if flag has not been snet
if emails_sent != 1:
send_email(smtp_server, smtp_port, user,password, sent_from, send_to, email_text)

# Used for debug purposes
#print(body)

# set email flag to prevent multiple emails from one alarm
emails_sent = 1
else:
# if no alarm clear audible relay K1
relays.write_single(K1,OFF)
emails_sent = 0

sleep(1)

How To Build A Water Leak Detection System (2024)

FAQs

How do you make homemade leak detection solution? ›

It's as simple as it sounds — just mix water and dishwashing liquid and put that into a spray bottle. You can use laundry liquid if you don't have any dishwashing liquid but it won't bubble as easily. Dishwashing liquid is made to produce more bubbles which make this test easier.

How to install a water leak detection system? ›

How to Install a Water Leak Detection System
  1. Spec Check. Your pipes should be a half-inch to 1 inch wide, with a quarter-turn ball shutoff valve and 4½ inches of space around it. ...
  2. Secure the Shutoff. Clamp the shutoff unit onto the pipe so that the center fork fits on the valve. ...
  3. Place the Sensors.
Oct 24, 2021

What is the most reliable leak detection method and why? ›

Ultrasound testing is the most accurate method, utilizing high-frequency sound waves to identify cracks and other flaws in pipes. Infrared thermography uses infrared sensors to detect temperature differences that may indicate a leak.

What is the technique used in leak detection system? ›

Methods of detection include hydrostatic testing, tracer-gas leak testing, infrared, laser technology, and acoustic or sonar technologies. Some technologies are used only during initial pipeline installation and commissioning, while other technologies can be used for continuous monitoring during service.

What is the most basic but effective method of detecting leaks? ›

The most basic type of leak testing is the submersion or dunk test (also referred to as bubble testing), in which you pressurize the part, submerge it in water, then look for gas bubbles.

What kind of liquid can be used to detect leaks? ›

Leak Detection Methods. In general, most leak testing is performed on a pressurized system – either with actual process fluid or with a surrogate fluid like water, air, nitrogen, or helium.

What are the three types of leak detection? ›

In HVAC systems and commercial refrigeration, it plays a key role in preventing losses and maintaining quality. Common types of leak detection systems (LDS) include chemical, pressure, and acoustic methods.

What are the basics of leak detection? ›

As with almost every facet of vacuum systems, there is no single method which fulfils every situation and every criterion. This is certainly the case with leak detection, with four main methods being employed: the bubble test; pressure decay test; pressure rise test; and helium sniffer mode/helium vacuum mode tests.

What are the two most common leak detection tests? ›

Spray test and sniffing leak detection are the two most common leak detection tests that use the tracer gas helium or hydrogen. The spray test is the ideal test method for components under vacuum. This measurement principle has the highest sensitivity of all available methods.

Is there a tool to detect a water leak? ›

Listening discs and ground microphones are some of the most basic tools that can be used by a plumber to detect and pinpoint water leaks. Listening discs are pieces of equipment that help plumbers to locate leaks through drywall, cabinets and other furnishings.

How to trace a water leak? ›

7 Ways To Find Hidden Water Leaks In Your Home
  1. Water Meter Test. One way to find hidden water leaks is to conduct a water meter test. ...
  2. Water Pressure Test. ...
  3. Listen for Running Water. ...
  4. Check your Appliances for Leaks. ...
  5. Check Your Toilet for Leaks. ...
  6. Check Your Utility Bills. ...
  7. Water Drips and Wet Walls.
Feb 23, 2022

How to detect a small water leak? ›

To locate a leak, try:
  1. Looking for wet spots that could indicate a leak in the pipe between the meter and the home or the sprinkler system.
  2. Dropping a dye tablet in the toilet tank. Don't flush. ...
  3. Listening for the sound of running water coming from your toilet. If you hear running water, your toilet has a leak.

How to make soapy water to test for gas leaks? ›

You can prepare soapy water by mixing dish soap with water.

The solution can then be stored in a spray bottle or manually spread using a sponge.

What is the best thing to use to stop a leak? ›

For pinhole leaks or slightly larger, or if you have a leak at a fitting joint, plumbers putty is the simplest way to plug it and is widely available both online and in-store at DIY and home improvement stores. Generally speaking, it consists of two components that when mixed together form a strong waterproof seal.

What is the solution for leak detection? ›

Advanced Leak Detection Solution is a ready to use liquid designed to be applied to the surface of joints to detect leaks in oxygen and compressed gas systems. Advanced Leak Detection Solution is the only known concentrate developed specifically for leak testing lines, cylinders and tanks carrying pure oxygen.

Top Articles
¿Acepta Trader Joe's EBT o vales de comida?
Transportation / What is the Aspen X2 Portal
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Things to do in Wichita Falls on weekends 12-15 September
Craigslist Pets Huntsville Alabama
Paulette Goddard | American Actress, Modern Times, Charlie Chaplin
What's the Difference Between Halal and Haram Meat & Food?
R/Skinwalker
Rugged Gentleman Barber Shop Martinsburg Wv
Jennifer Lenzini Leaving Ktiv
Justified - Streams, Episodenguide und News zur Serie
Epay. Medstarhealth.org
Olde Kegg Bar & Grill Portage Menu
Cubilabras
Half Inning In Which The Home Team Bats Crossword
Amazing Lash Bay Colony
Juego Friv Poki
Dirt Devil Ud70181 Parts Diagram
Truist Bank Open Saturday
Water Leaks in Your Car When It Rains? Common Causes & Fixes
What’s Closing at Disney World? A Complete Guide
New from Simply So Good - Cherry Apricot Slab Pie
Drys Pharmacy
Ohio State Football Wiki
FirstLight Power to Acquire Leading Canadian Renewable Operator and Developer Hydromega Services Inc. - FirstLight
Webmail.unt.edu
2024-25 ITH Season Preview: USC Trojans
Metro By T Mobile Sign In
Restored Republic December 1 2022
12 30 Pacific Time
Jami Lafay Gofundme
Litter-Robot 3 Pinch Contact & Dfi Kit
Greenbrier Bunker Tour Coupon
No Compromise in Maneuverability and Effectiveness
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Hooda Math—Games, Features, and Benefits — Mashup Math
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 5704

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.