Skip to main content

Electronic water sensor tap

SELF-POWERED AUTOMATIC WATER TAP

39,440
447
41
About: I like to learn, like to make, like to share. 

Intro: Self-Powered Automatic Water Tap

Recently, I made an automatic water tap which does not require any external power. It can power itself from a micro generator. I used a rechargeable Li-ion battery to store energy when water flows out from the tap. It can be manually controlled from a button. The treasure behind it is very simple. I used an IR receiver & transmitter pair to sense the presence of hand below the tap. IR transmitter transmit infrared light and when something obstruct the light it reflect back to the receiver. The resistance of the receiver decrease with increased infrared light. The output of IR receiver is taken by a microcontroller and compared it to a preset value. If it receive more light compare to preset vale of threshold then it sent a signal to a servo motor and servomotor rotate the knob of the water tap.
Features of the project:
1. Self-Powered
2. Automatic & Manual Control
3. Simple design
4. Low cost

Step 1: Bill of Materials

Picture of Bill of Materials
Picture of Bill of Materials
Picture of Bill of Materials
3 More Images
1. 3.6V Micro Hydro Generator (you can use SeedStudio 3.6V Micro Hydro Generator Prowith Built-in Lithium Battery & built-in Lipo Charging Circuit).
2. Screw thread (G 1/2", female) (you can get it from local hardware store)
3. Thread seal tape (you can get it from local hardware store)
4. Arduino Uno (Sparkfun)
5. IR Transmitter (Sparkfun)
6. IR Receiver
7. 56k Resistor
8. 220 ohm resistor
9. PCB board
10. Micro servo motor (Sparkfun)
11. Polymer Lithium Ion Battery (Sparkfun)
12. 1.25" diameter plastic pipe
13. Some wires
Required Tools
1. Hot glue gun
2. Soldering Iron (Sparkfun)
3. Solder (Sparkfun)
4. Wire cutter (Sparkfun)

Step 2: Prepare the Tap

Picture of Prepare the Tap
Picture of Prepare the Tap
Picture of Prepare the Tap
First, remove the handle from the water tap by opening the screw. Fix the servo horn to the stem of the water tap using any strong glue. I used hot glue and is working perfectly. Be careful when connecting, the axis of the servo horn and the axis of the stem should be perfectly aligned. Take 2 inch plastic pipe with the diameter of 1.25 inch. Truly speaking, the size of the pipe is dependable on the tap. A 3D printed part will be a great replacement of the pipe. Cut the pipe in one side according to your servo size to put the servo on it.

Step 3: Adjust Servo to Pipe

Picture of Adjust Servo to Pipe
Picture of Adjust Servo to Pipe
Picture of Adjust Servo to Pipe
Picture of Adjust Servo to Pipe
Rotate the fixed servo horn by your hand and place it in a position where it close the valve of the water tap. Now put the servo motor to the pipe and connect the pipe to the tap. Be sure it perfectly match to the servo horn you fixed previously with the stem of the water tap otherwise it will not work.

Step 4: Fix the Pipe to Water Tap

Picture of Fix the Pipe to Water Tap
Picture of Fix the Pipe to Water Tap
Picture of Fix the Pipe to Water Tap
2 More Images
Fix the pipe to the water tap using hot glue. Use glue around all the side to strongly connect and prevent from entering water into it.

Step 5: Join the Servo Using Hot Glue

Picture of Join the Servo Using Hot Glue
Picture of Join the Servo Using Hot Glue
Picture of Join the Servo Using Hot Glue
2 More Images
Join the servo motor to the pipe using hot glue. Make sure no gap is present to prevent entering of water. Are you sure it perfectly matched to the servo horn fixed on stem of water tap previously? If yes, then you completed the hardest part of the entire task. Now you can check it either it will work perfectly or not.
Give air from your mouth blowing into one side of the water tap and observe from the other side. As you set the valve of the tap in close position before, air should not pass.
Now, connect the servo motor to the Arduino and upload the servo program given below.
#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
myservo.write(90); // tell servo to go to position in variable 'pos'
} void loop() { }
Now, test it again by flowing air. This time air should pass from one side to the other. If so then it is working well.

Step 6: Connect Screw Thread to the Hydro Generator

Picture of Connect Screw Thread to the Hydro Generator
Picture of Connect Screw Thread to the Hydro Generator
Picture of Connect Screw Thread to the Hydro Generator
Picture of Connect Screw Thread to the Hydro Generator
Now, we will work with another vital thing of our system, the hydro power. For that we will use 3.6V micro hydro generator which will be enough for our system. Hydro generator produce power when water flows within it. Connect a BSP female screw thread to the hydro generator. Use seal tape to prevent leak of water. Note the arrow mark on the top of hydro generator when connecting screw thread.

Step 7: Connect Water Tap to Hydro Generator

Picture of Connect Water Tap to Hydro Generator
Picture of Connect Water Tap to Hydro Generator
Picture of Connect Water Tap to Hydro Generator
2 More Images
Now connect the prepared water tap to another side of the screw thread using seal tape. One important thing, always wrap the seal tape in clockwise direction.

Step 8: Make Sensor Module

Picture of Make Sensor Module
Picture of Make Sensor Module
Picture of Make Sensor Module
2 More Images
Make the sensor module according to the circuit diagram. The long lead of the IR receiver and transmitter is anode and short lead is cathode. Transmitter led is connected as forward bias and receiver must be connected as reverse bias. Solder all the components to the PCB according to the circuit diagram and then cut extra lead using a diagonal cutter. According to my experience, an old nail cutter works well even better than a diagonal cutter. Then solder three long wire to VCC, GND and Signal point of the PCB.

Step 9: Fix Sensor Module to the Water Tap

Picture of Fix Sensor Module to the Water Tap
Picture of Fix Sensor Module to the Water Tap
Picture of Fix Sensor Module to the Water Tap
Fix the sensor module you just made to the bottom side of the water tap according to the photo using hot glue.

Step 10: Make Control Circuit & Upload the Program

Picture of Make Control Circuit & Upload the Program
Picture of Make Control Circuit & Upload the Program
Picture of Make Control Circuit & Upload the Program
3 More Images
Make the control circuit according to the circuit diagram. ATmega328P microcontroller was used for the main controlling unit of the project. I used this microcontroller for the project because this is the main microcontroller of Arduino Uno board. Using this controller makes my work easy. It can be program easily using Uno board. External 16MHz crystal was used as clock source. I added 1 button to manually control the tap. If you press the button for the first time the tap will be on and if you again press the button the tap will be off. I used a hydro generator which has no built-in battery and for that I had to used external Li-ion battery & charging circuit.
To connect hydro generator and battery charging module follow the block diagram shown above. I used a 5V regulator between hydro generator and charging module to stabilize the output of hydro generator because charging module can tolerate maximum 5.5V. If you used Seeedstudio micro hydro generator then you need not to connect these external parts. Just connect the button and upload the following Arduino sketch and enjoy it.
#include <Servo.h>
int value = 0;
int avg_value = 0;
int sensorPin = A5;  //connect ir receiver output to this pin
int buttonPin = 18;  // button pin to A4
boolean buttonState = HIGH; 
boolean tapState = LOW;
int ledPin = 13; //this is for testing purpose
int tapForState = 0;
Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(buttonPin, HIGH);
  //servo motor is connected to Arduino digital pin 3
  myservo.attach(3);
}

void loop() {
  buttonState = digitalRead(buttonPin);
  delay(50);
  if(buttonState==LOW && tapState==LOW){
    digitalWrite(ledPin, HIGH);
    myservo.write(0);
    delay(7000);
    tapState = HIGH;
    tapForState = 1;  // check either tap was on for button press or not
    }
  else if(buttonState==LOW && tapState==HIGH && tapForState==1){
    digitalWrite(ledPin, LOW);
    myservo.write(80);
    delay(100);
    tapState = LOW;
    tapForState = 0;
    }
  // put your main code here, to run repeatedly:
  for(int i=0; i<20; i++){
     value += analogRead(sensorPin);
     delay(5);
    }
  avg_value = value / 20;
  Serial.println(avg_value);
  if(avg_value<=500){
    digitalWrite(ledPin, HIGH);
    myservo.write(0);
    delay(7000);
    tapState = HIGH;
    if(tapForState==0)
      tapForState = 2; // check tap was on using sensor data
    }
  if(avg_value>500 && tapForState==2){
    digitalWrite(ledPin, LOW);
    myservo.write(80);
    delay(100);
    tapState = LOW;
    }
    value = 0;   
}

Step 11: Test Your Creation

Picture of Test Your Creation
Picture of Test Your Creation
If you followed all the steps describe above, Congratulation!!! You successfully created your self-powered automatic water tap. Enjoy it and modify it in creative way to make it better.

Comments

Popular posts from this blog

Arduino NANO 3X3X3 LED CUBE

DIY | 3X3X3 LED CUBE FOR ARDUINO NANO+ By   RGBFreak   in   Technology Arduino 17,143 146 22 Featured Download Favorite By   RGBFreak RGBFreak's YouTube Channel Follow More by the author: About: Hi there visitor! First of all thank you for checking out my profile! My name is Youri. I study Technical Computer Science in the Netherlands. I especially love the electronical part of my study. Since I l...   More About RGBFreak » Intro: DIY | 3x3x3 LED Cube for Arduino Nano+ Hi everyone! My name is RGBFreak and I created a YouTube channel quite recently. I love DIY and I especially love LED's, so that's why I decided to make my own 3x3x3 LED Cube! You will need the following items to make this LED Cube: • 27 single colored LED's. • Arduino Nano or one of his bigger brothers. • 3 NPN Transistors. I used the BC547. • 3 pin headers with 3 pins. • 1 pin header with 4 pins. • A piece of perfboard. • A few small cables. Ad

Ultrasonic Distance Sensor in Arduino With Tinkercad

  Ultrasonic Distance Sensor in Arduino With Tinkercad Let's measure distances with an ultrasonic rangefinder (distance sensor) and Arduino's digital input. We'll connect up a circuit using a breadboard and use some simple Arduino code to control a single LED. You may have already learned to   read a pushbutton   and   PIR motion sensor   with Arduino's digital input, and we'll build on those skills in this lesson. Ultrasonic rangefinders use sound waves to bounce off objects in front of them, much like bats using echolocation to sense their environment. The proximity sensor sends out a signal and measures how long it takes to return. The Arduino program receives this information and calculates the distance between the sensor and object. Find this circuit on Tinkercad Explore the sample circuit embedded here by starting the simulation and clicking on the proximity sensor. This will activate a highlighted area in front of the sensor with a circle "

DIGITAL UV-METER, WITH OLED DISPLAY. ARDUINO PROJECT FOR BEGINNERS

DIGITAL UV-METER, WITH OLED DISPLAY. ARDUINO PROJECT FOR BEGINNERS By   techn0man1ac   in   Technology Arduino 4,792 87 13 Featured Download Favorite By   techn0man1ac Techn0man1ac blog Follow About: Techn0man1ac - техноманьяк   More About techn0man1ac » Intro: Digital UV-meter, With OLED Display. Arduino Project for Beginners Video demonstration (English subtitles). Hello,   instructable . Today I will tell you how to make a simple digital VU meter (sound level meter) using Arduino and OLED displays and 2 resistors by yourself (DIY). The device is quite simple, for beginners it will be a rewarding experience. Add Tip Ask Question Comment Download Step 1: Components for This Arduino Project: 3 More Images Arduino Nano V3.0; 0.96 inch IIC I2C 128X64 OLED Display; One 10K, resistor(R1 no scheme); One 10K-100K potentiometer(R2no scheme); Wires. Add Tip Ask Question Comment Download Step 2: Dev