Project tutorial
Water Waste Monitor

Water Waste Monitor © Apache-2.0

Millions of gallons of water are wasted every year. Learn to conserve water with this project!

  • 845 views
  • 1 comment
  • 4 respects

Components and supplies

Apps and online services

About this project

Background

Water waste is a big problem, a 1 trillion gallon problem. One way we can combat this is to monitor leaky facuets and also conserve on the daily water use. To accomplish this task, we can use some Seeed sensors and a Arduino that will obnoxiously alarm us when we are wasting water.

Demo

Connections

Connect the Seeed Sound, Buzzer, and LCD RGB Backlight as shown:

Your final result should look like the following.

Sketch

The Arduino Sketch is provided below. Note that

int thresholdValue = 450; 

determines what loudness to activate the sensor and

const unsigned long waterUseAllowedDuration = 3000; 

determines how many ms to wait before starting the alarm. Flash the Arduino sketch and setup your monitor near your sink. Be careful not to actually get the components wet since that will damage them. The demo shows the project in action.

Code

Arduino Seeed Sensor CodeArduino
#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

const int wasteColorR = 255;
const int wasteColorG = 0;
const int wasteColorB = 0;
const int restColorR = 255;
const int restColorG = 255;
const int restColorB = 255;


const int pinSound = A0;
const int pinLed   = 7;
const int speakerPin = 3;

int thresholdValue = 450;  // determines loudness for sound sensor
const unsigned long waterUseAllowedDuration = 3000;  // how long you want to use water for before warning

bool monitoring = false;

void playTone(int tone, int duration) {
    for (long i = 0; i < duration * 1000L; i += tone * 2) {
        digitalWrite(speakerPin, HIGH);
        delayMicroseconds(tone);
        digitalWrite(speakerPin, LOW);
        delayMicroseconds(tone);
    }
}

void setup() 
{
    pinMode(pinLed, OUTPUT);
    // set up the LCD's number of columns and rows:
    lcd.begin(16, 2);
    
    lcd.setRGB(restColorR, restColorG, restColorB);
    lcd.setCursor(0, 0);
    lcd.print("Water conserved     ");
    delay(1000);
}

void loop() 
{
    int sensorValue = analogRead(pinSound);
    if (sensorValue > thresholdValue) {
      lcd.setCursor(0, 0);
      lcd.setRGB(255, 251, 140);
      lcd.print("Monitoring use  ");
      delay(waterUseAllowedDuration);
      if (analogRead(pinSound) > thresholdValue - 200) {
        lcd.setRGB(wasteColorR, wasteColorG, wasteColorB);
        lcd.setCursor(0, 0);
        lcd.print("Excess water use");
        lcd.setCursor(0, 1);
        lcd.print("Try to conserve water");
        playTone(1700, 1000);
        delay(5000);
        lcd.clear();
      }
    } else {
      lcd.setRGB(restColorR, restColorG, restColorB);
      lcd.setCursor(0, 0);
      lcd.print("Water conserved");
    }
}

Schematics

Fritzing sketch
Open in fritzing, use mic sensor instead of what's shown
water-waste_YVqFyze5C7.fzz

Comments

Similar projects you might like

Portable Environment Monitor

Project tutorial by Chathuranga Liyanage

  • 2,216 views
  • 2 comments
  • 6 respects

Arduino Control AC Water Heater temperature

Project tutorial by Mohannad Rawashdeh

  • 9,393 views
  • 0 comments
  • 6 respects

Water Plant System for Plants in Vases

Project tutorial by zioalex

  • 5,182 views
  • 4 comments
  • 10 respects

DIY Soil Moisture Monitor With Arduino and a Nokia 5110 D...

Project tutorial by Nick Koumaris

  • 2,845 views
  • 0 comments
  • 12 respects

Water Quality Monitoring and Notification System

Project showcase by emmanuel ani

  • 50,597 views
  • 38 comments
  • 112 respects

One Button Click Artificial Intelligence Based Home Monitor

Project tutorial by Geeve George

  • 7,114 views
  • 1 comment
  • 43 respects
Add projectSign up / Login