Sunday, April 29, 2018

Arduino Automatic Self Powered Water Tap - Use Arduino to control your faucet

In this post, we'll see how to make an Arduino controller self powered automatic water tap.

I've thought of this many times ago. How to make a water tap that opens and closes as you put your hand under it?

This is obvious of course. It needs an infrared transmitter and sensor to track your hands movements and a controller for operation.

What is the problem then?

The only problem is the power that supplies the controller and infrared transmitter and sensor.

Would you make them powered by DC or AC? Would you power them from a battery or from a wall outlet?



In both cases you need to maintain the power source and make sure it is safe and can power the system or otherwise you'll not be able to use the water.

Here in this instructable, the author has made a brilliant idea.

He came up with a simple yet efficient idea to power the system.

He made it self powered. The water tap makes it own power.

Here the faucet system generates its own power by a small hydro-generator.

This small generator can power the system and can also store the power inside a battery to use it in all times.

So you don't need a wall outlet nor you need a battery to keep checking and recharging. The system is self powered.



Picture of Self-Powered Automatic Water Tap

Here is the hydro generator 

Picture of Bill of Materials

Components

1. 3.6V Micro Hydro Generator

2. Screw thread (G 1/2", female)

3. Thread seal tape

4. Arduino Uno

5. IR Transmitter 

6. IR Receiver

7. 56k Resistor

8. 220 ohm resistor

9. PCB board

10. Micro servo motor

11. Polymer Lithium Ion Battery

12. 1.25" diameter plastic pipe


13. Some wires


Code

#include 
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 20="" analogread="" avg_value="" check="" data="" delay="" digitalwrite="" high="" i="" if="" ledpin="" myservo.write="" on="" sensor="" sensorpin="" serial.println="" tap="" tapforstate="2;" tapstate="HIGH;" using="" value="" was="">500 && tapForState==2){
    digitalWrite(ledPin, LOW);
    myservo.write(80);
    delay(100);
    tapState = LOW;
    }
    value = 0;   
}


Source: Instructables









No comments: