Akshay Joseph
Published © GPL3+

COVID - 19 Automatic Water Tap

Automatically turn on the water tap when our hand move near the tap

BeginnerFull instructions provided4,470
COVID - 19 Automatic Water Tap

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Solinoid Valve
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Resistor 2.21k ohm
Resistor 2.21k ohm
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
Water tap
×1
12V DC Adapter
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

solinoid_valve_87Aq3uF0CO.png

Code

Untitled file

Arduino
//sketch created by Akshay Joseph Follow me on Instagram : five_volt_player
#define echoPin 4
#define trigPin 5
int long duration;
int distance;
void setup(){
pinMode(echoPin,INPUT);
pinMode(trigPin,OUTPUT);
pinMode(3,OUTPUT);
digitalWrite(3,LOW);
delay(2000);
}
void loop(){
digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin,LOW);
duration=pulseIn(echoPin,HIGH);
distance=(duration*0.034/2);

if(distance<=20){
digitalWrite(3,HIGH);
}
else{
digitalWrite(3,LOW);
}
}

Credits

Akshay Joseph

Akshay Joseph

22 projects • 58 followers
B.Sc. Electronics Student at Govt. College Tanur

Comments