Self-Powered Automatic Water Tap

66K46944

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

1. 3.6V Micro Hydro Generator (you can use SeedStudio 3.6V Micro Hydro Generator Pro with 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

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

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

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

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

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

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

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

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

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

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.

39 Comments

can i know the block diagram for this self powered automatic water tap?

with out using servo whether i can able to control hydro generator for on and off

Wonderful project. Motivational one. Combination of both mechanical hard work with electrical hard work.

Neat, and congrats for the close to 25k views in less than 1 month ! The biggest issue is not the charging voltage 3.6 vs. 4.1, but faulty BoM and energy drain. The selected Arduino Uno is not usable at all (you didn't use it either BTW). That one is supposed to use 5V, and the selected servo as well. Maybe they would work at 3V3-3V6. There is also a useless Serial-USB convertor in this board and even ... LEDs ! Those will empty whatever battery you use in a few days at best. The first two steps you need to take is to replace the UNO by some specific low-consumption device (I'd recommend some ATTiny), and add some sleeping logic with a wakeup time of 2 seconds for example. I also have serious doubt that a small servo could be strong enough to operate the tap, but since that one is also not in the BoM ... Nor is the LiPo board. So even trying to "be nice", I wonder. Did you really manage to make a working instance of your idea or is this a fake ?

Neat project! You could add a small DC boost converter to your circuit between the generator and battery charge controller to get the required voltage.
"To yrralguthrie: I by default am hoping that your comments are intending to be constructive hence I will say this . I have dealt with batteries for many years and its not a strick science as you would make it seem . 4.2 volts is of course ideal but a batt is not a cap and hence it will charge at lower than ideal voltage and 3.6 is acceptable for sure. My concern is power in to power out. NiCad batt are usually self charging and perfect for this in my opinion . if the clients use the water a lot for long periods { 4+ ppl in the household} it should be ok with either battery. The battery should start out fully charged though. "

Be nice, ok, you did a good job writing up the instructable, but this quoted post is BS.

And furthermore you didn't use NiCad and that's not what I was commenting on. Nicad aren't self charging. What is that anyway? Nicads are also charged by a set routine.

The science of batteries, alkaline, nicad or lipo is about as strict a science as one can get. What ever type one buys now acts the same way every time, depending on their chemistry.

Sorry, your idea is good, but your information on batteries is bogus. Simply not correct. You're going to get someone in trouble when using lipos if you persist.

To the moderators: you know Lipos need to be treated with care and charged carefully and correctly. The reason a great many "hover boards recently got recalled is because the manufacturers cheated on the charging circuits and as a result the batteries sometimes got hot enough to burn the people riding them.
Being as nice as I can, 3.6 volts will not charge a 18650 or other LiPo battery. If the battery was drained to 3.2 volts it would bring it up to 3.6 sure, but that is only 20% of capacity.

If the battery is routinely discharged to below 3.6 volts it life is shortened. 3.2 volts is the absolute lowest it can be discharged without destroying the battery. Discharging to below 3.6 volts routinely will lead to failure of the battery in 10-30 cycles.

This is straight from manufacturers specs. And no I'm not going to go find a link. I don't care what you do with your batteries, but I'm going to discharge mine to about 3.7 volts and then charge them to 4.2 volts. I have one of the best Lipo chargers on the market and that is exactly what it does.

Anyone who wants to argue go ahead, your arguments don't change the chemistry of the battery. Better you should find some quality web sites on how to take care of Lipo's.

I don't believe this will work long term or even medium term. The Seeed generator specs say it puts out a stable 3.6 volts. 3.6 volts won't charge a lipo battery. The lipo cells like a 18650 are called 3.7 volt cells, but they need to be charged to 4.10 volts. In fact at 3.6 to 3.7 volts they are discharged to 20% or less capacity. Although they will work down to about 3.2 volts doing so on a regular basis will quickly kill the battery. Just a few cycles.

Hello! I'm not sure you are strictly right here, because:

- non Pro generator can produce enough voltage for flow over 3L/minute (not so much, isn't it?). Please, see "Flow and Output voltage Diagram" @ http://www.seeedstudio.com/wiki/3.6V_Micro_hydro_...

(note: but we should take in mind an worst case...)

- Pro version of generator has (accordingly to spec.)
"... Built-in Lithium Battery. Built-in Lipo Charging Circuit.
Stabilized Voltage Ouput. ...". There are no necessary to use 7805 and
separate external battery such way. https://www.seeedstudio.com/item_detail.html?p_id...

You were misled by the absence of TP4056 part in the bill of material probably :( - I asked the author to correct.

It doesn't really make any difference what the specs for the device say, if it only produces 3.6 volts it will not charge a Lipo. All one has to do is measure the charging voltage. Put a good digital volt meter on the charging lines and see what the voltage is. It has to be at least 4.2 volts. I was not mislead by anything.
No need to argue here, just measure the voltage under load. (the battery being charged.)

To yrralguthrie:
I by default am hoping that your comments are intending to be constructive hence I will say this . I have dealt with batteries for many years and its not a strick science as you would make it seem . 4.2 volts is of course ideal but a batt is not a cap and hence it will charge at lower than ideal voltage and 3.6 is acceptable for sure. My concern is power in to power out. NiCad batt are usually self charging and perfect for this in my opinion . if the clients use the water a lot for long periods { 4+ ppl in the household} it should be ok with either battery. The battery should start out fully charged though.

Well. What is it? (see step.10)

I don't understand what you are asking. I don't have such a device, I was commenting on the description of the generator, which states it produces "a steady 3.6 volts. And asking that the builder measure the voltage of the charging circuit. The generator itself is likely 5.0 volts.

What's with the drawing?

Is this perpetual motion? There has to be a catch.

The energy comes from the moving water which in turn comes from water stored in a reservoir that has been filled by pumps operated by the water supply company. Nothing is free, so you pay on your water bill.

Some sums are needed here to see just how much energy can be extracted from ?? litres water moving past a generator (low efficiency), charging and timing circuit (medium efficiency).

Full marks for effort and ingenuity, but an AA cell might be cheaper in the long run.

No it's not perpetual motion. It produces less energy than what is consumed by the generator. But the switch to turn on the water uses less energy than what is produced by the generator. The water out of the faucet is in effect the waste (of energy) of the system. No magic. And yes a rechargeable AA cell would be sufficient.

Hello, Taifur! So cool, so simple!

A small note - Bill of materials has missing TP4056 part, isn't it?

Wouldn't an infrared sensor and a water solenoid be simpler and cheaper?

There are plenty of IR controlled taps available.

Some time ago I asked Seeed about what type of plastic was used in the generator, whether it was food safe. This was for the previous version. I can't find the reply now, but it was not food grade, from memory it was formaldehyde based polymer.

You may want to check the latest model.

Here is something that I had learned the hard way by broken taps fittings and pipe! It comes from using the sealing tape and endless water leaks. I went to a plumbing wholesaler to light my candle and she said that the correct stuff to use to seal between water fittings is plumber's twine or rope . It look like rough hair and then you turn the connections till hand tight and then turn it till the correct angle for the faucet position is obtained.

I would ditch that advice.

Your lady wholesaler sold you plumber's hemp.

I don't know where you hale from, but hemp has been banned for years. The problem with hemp, often used with a paste sealant, is that it harbours bacteria and is not used on drinking water supplies. A better solution is to use a gas grade PTFE tape (thicker grade) or a potable water approved sealant paste. At a pinch, dental floss does the same job as the hemp. Loctite used to do an approved version of hemp (looked like dental floss).

If you have used hemp on drinking water supplies, my advice (water engineer) is to get rid of it ASAP

More Comments