Water Outflow Alarm v1

Water outflow alarms (flood sensor alarms) are arguably the most widely used commercial water leak detectors since they are cheap and easy to install.

A water outflow alarm helps protect your home and belongings from flooding. The standalone device automatically activates when it detects a water leakage or flood and raises an alert thus making it ideal for areas prone to leaks or flooding such as laundry rooms, kitchens, bathrooms and hot water tanks.

Water Outflow Alarm

A simple Googling might fetch you lot of water outflow alarms for you to buy, but making such an alarm appropriate for basements and low lying areas yourself will be something exceptional and that’s the theme of this little post.

A microcontroller based circuit would be a good choice here taking potential expansions hereafter. Otherwise using a mighty microcontroller would be an overkill. Anyway, I’m sticking with the microcontroller idea.

Without further ado, this is the code for an Arduino based water outflow alarm. Needless to say, the provided code is also compatible with other Arduino boards like Nano, Pro Mini, Lilypad etc. You can also port the code to Attiny85 microcontroller powered minuscule development boards similar to the quite popular Digispark.

#define statusLED 13
#define sounderPin 9
#define sensorPin 8

int state = 0;

void setup()
{
  pinMode(statusLED, OUTPUT);
  pinMode(sounderPin, OUTPUT);
  pinMode(sensorPin, INPUT);
}
void loop()
{
  state = digitalRead(sensorPin);
  digitalWrite(statusLED, state);
  if (state == 1)
  {
    for (int hz = 440; hz < 1000; hz++) {
      tone(sounderPin, hz, 50);
      delay(5);
    }
    noTone(sounderPin);

    for (int hz = 1000; hz > 440; hz--) {
      tone(sounderPin, hz, 50);
      delay(5);
    }
    noTone(sounderPin);
  }
  else {
    noTone(sounderPin);
  }
}

Below is the hardware setup diagram (Arduino Uno).

Water Outflow Alarm Uno Schematic

Here is a snapshot of how the components will come together for the workbench prototype. I tested my quick build with a 6F22 9V battery.

As you can see, a “passive buzzer” (see below) is used in this setup. Notice you have to send it a square wave signal, and by shifting the frequency of the square wave you can change the pitch of the sound (it does not matter which pin you use for positive or negative). Simply, the passive buzzer is an electromagnetic transducer used to generate sound signals of different frequencies (https://www.addicore.com/Passive-Buzzer-p/ad319.htm).

Passive Buzzer

Nevertheless, the water sensor probe can be made from stainless steel or aluminium. Also, the probes should be placed not too far apart from each other and they never should touch each other.

Does this water leak detector work? The answer is a big yes. When there’s water, the water outflow alarm will set off a siren to trigger an alert. Give it a try!

Water Outflow Alarm Test

Next version of my Water Outflow Alarm (Wi-Fi Ready) can even help to automatically shut off valves and prevent major damage!

Leave a Reply

Your email address will not be published. Required fields are marked *