Introduction: Water Leak Detector

If you've ever worried about coming home to a flooded basement, this project is for you.

We will show you how to create a water leak detection system that will send you a text message when a leak has been detected.

Step 1: Skills Required

For this project, all you will need is some basic programming knowledge! We wrote the program that measures the water sensor and sends a text in C.

Step 2: Components/Hardware List

Picture of Components/Hardware List

Step 3: Project Overview

Picture of Project Overview

This project will have the following layout:

  • PhidgetSBC4 will run our program code (written in C). It will be connected to the water sensor through the built in VINT Hub.
  • If the water sensor indicates that water is present, the SBC will use the email to text feature that most wireless carriers support to send a text message.

Step 4: Prepping Hardware

Picture of Prepping Hardware

Our sensor will likely be coming into contact with water (especially during testing), so it is important that we protect the PCB components. To do this, we used a conformal coating on the PCB.

Step 5: Writing Code

Picture of Writing Code

All the code for this project is already written and is included in the file waterLeakDetector.c, so if you want to implement it, all you will have to do is modify a few things (serial numbers,email address, etc.) and compile it.

Important: before installing, you will have to set up libcurl on your SBC. Open the terminal and enter the following command:

sudo apt-get install libcurl4-gnutls-dev


For more information on how to compile C programs on the SBC, check out these links:

Here is a quick overview of the code:

  • Create a VoltageInput object
  • Map the VoltageInput object to the water sensor. See this video for more information.
  • In while loop, read water sensor value, if water level is dangerous, send a text message. If not continue.
  • Sleep for one second and repeat

Step 6: Questions?

If you have any questions about the project, let us know in the comments section!

Thanks for reading

Comments

PraetorianCZ (author)2017-10-19

Great idea! I'm not familiar with the Phidget but I think it is quite a waste of $120 computer when you can have the same functionality for $5 using an ESP8266.

phidgetsinc (author)PraetorianCZ2017-10-19

Yes you could definitely use the ESP8266!

abhinnkp (author)PraetorianCZ2017-10-19

I agree.... Using 120$ Computer is overkill. ESP8266 is best option.

bjrocket141 (author)2017-10-18

does this work with a raspberry pi zero?

phidgetsinc (author)bjrocket1412017-10-18

Yes.

If you want to use the code above, you will have to use something like the VINT Hub Phidget and slightly modify waterLeakDetector.c You will also need to reference our Linux page for information on how to install the Phidget libraries.

Let me know if you have any more questions!

About This Instructable

1,250views

31favorites

License:

Bio: Phidgets make your ideas real. Reliable sensors, motor controllers, relays and more connect computers and technology to the real world. Applications include robotics, data acquisition ... More »
Add instructable to: