In this tutorial I will show you how to build a flood or water presence sensor and connect it to your PrivateEyePi alarm system to either trigger the alarm or send you email alerts. This is useful for installing in areas of your house where you are worried about a water leak that could cause expensive damages. You can wire the sensor directly to your Raspberry Pi or to our wireless water sensor. I will describe both both options.
How it works
This sensor has strips of metal plated probes that when in the presence of liquids change the resistance that will activate the internal switch. It can be mounted for example on a skirting board, with the the wireless sensor or Raspberry Pi some height above, via the attached wire. When the liquids drain away from the probe the resistance will drop and the switch contacts will open again. Liquids of very poor viscosity may not drain away from the probes and will cause the switch contacts to remain closed.
What you will need
Option 1 - Water sensor wires to a Raspberry Pi
Option 2 - Wireless water sensor that communicates to a Raspberry Pi over radio
Option 1 - Wired Water Sensor
Figure 1 - Water sensor wired to the Raspberry Pi
Figure 2 - The GPIO header of the Raspberry Pi
Option 2 - Wireless Water Sensor
Figure 3 - Water Sensor
Figure 5 - Cut off and strip the other end of the wire
Figure 6 - Thread the water sensor wires through the sensor case
Figure 7 - Finished wireless water sensor
In this video you can see the water sensor attached to the wireless switch sending BUTTONON messages when submerged in water and BUTTONOFF messages when removed from the water. The application running in the background is rfthermtest.py.
Using Trigger Based Rules
Figure 5 - Define rule based triggers
Figure 6 - Sensor and status on the dashboard (battery indicators given for wireless sensors)