In locations suffering from acute water shortages, every drop of water counts. It really annoys me to see people not closing taps tightly enough after use, or neglecting repairs of leaking taps. After talking to many such people, I realized that most of them are conscious about water wastage, however, they just do not realize sometimes that they tap has not been closed tightly enough. If someone (or something) asks them to close the taps properly, they readily do so. This gave me an idea for my project- A DIY tap leak detector.
The premise of this project is simple. Taps are rarely left completely open for no reason. It is only problematic when water is wasted, despite being the tap closed. This could be due to two reasons:
My DIY project detects whether there is any water flow from a CLOSED tap due to any of the above-mentioned reason, and rings an alarm to alert nearby people to look into the matter- whether it is simply a matter of closing the tap tightly or checking if any repairs are required.
Possible solutions:
I brainstormed 5 possible solutions to solve this problem
As a prototype, my project is applicable only for the taps with valves moving up and down.
Cost of Project: Rs. 800 (approx.)
References:
For creating my prototype, I have referred to the following tutorials of components:
First, I need to detect whether the tap is open or shut. This is important because I don't want to sense the obvious water flow when the tap is open. I used an ultrasonic sensor for this purpose.
Note that the ultrasonic sensor should be placed right in front of the tap valve's CLOSE position. I'm also using a red LED as an output. Thus, when the tap valve is in CLOSE position, the LED should be ON, whereas when the tap valve is in the OPEN position, the LED should be OFF.
How to set up-
The HC-SR04 Ultrasonic Module has 4 pins, Ground, VCC, Trig and Echo.
Since I did not want to detect water flow when the tap is open, I decided to use a servo motor to move the water sensor out of the way, when the tap is open, and back in place when the tap is closed.
Following are the steps to connect a servo motor to the Arduino:
The servo motor has three pins.
The Water Sensor is attached to the servo motor. Do a little adjustment to make sure that the rotation of the servo motor actually moves the water sensor in and out of the way of the water flow.
How to set up the water sensor:
The water sensor has 3 pins:
If a leak is detected by the water sensor, there needs to be an alarm to alert people nearby to look into the matter. For this purpose, I have simply used an LED. It may be substituted with a buzzer
<p>//Arduino based tap Leak Detector</p><p>//Initializing Ultrasonic Sensor
const int trigPin = 3; // Trigger Pin of Ultrasonic Sensor
const int echoPin = 2; // Echo Pin of Ultrasonic Sensor
int redled = 5;</p><p>//Initializing Servo Motor
#include <servo.h>
int servoPin = 4;
Servo servo;
int servoAngle = 0; // servo position in degrees
boolean flag=false;</servo.h></p><p>//Initializing Water Sensor
int water_sensor = 8;
int whiteled = 6;</p><p>void setup()
{
//Ultrasonic Sensor Setup
pinMode(redled, OUTPUT);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);</p><p> //Servo Motor Setup
Serial.begin(9600);
servo.attach(servoPin);</p><p> //Water Sensor
pinMode(water_sensor, INPUT); //
pinMode(whiteled, OUTPUT); //
}</p><p>void loop()
{ </p><p>long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;</p><p>if (distance < 10)</p><p>{
digitalWrite(redled,HIGH);
servo.write(135);
}</p><p>else
{
digitalWrite(redled,LOW);
servo.write(-135);
}</p><p>if(digitalRead(water_sensor) == LOW)
{digitalWrite(whiteled,HIGH);}
else
{digitalWrite(whiteled,LOW);}</p><p>}</p>All you need to ensure is that you-
1. Place the Ultrasonic Sensor in front of the CLOSED tap valve, such that the sensor detects the change between OPEN and CLOSE position.
2. Place the servo motor(and the attached water sensor), such that the rotation of the motor moves the water sensor in and out of the way of the water flow.
The project is READY! :)