Techatronic
Published

Touchless Water Tap Using Arduino

This is a touchless water tap project made by us using Arduino UNO and IR sensor.

IntermediateProtip2 hours65
Touchless Water Tap Using Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
water pump
×1
IR Proximity Sensor
Digilent IR Proximity Sensor
×1
USB-A to B Cable
USB-A to B Cable
×1
Relay (generic)
×1
LED (generic)
LED (generic)
×1
5 mm LED: Green
5 mm LED: Green
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code snippet #1

Plain text
 // Techatronic.com  
 int val = 0 ;  
 void setup()  
 {  
  Serial.begin(9600);  
  pinMode(4,INPUT);  // IR sensor output pin connected  
  pinMode(8,OUTPUT); // Green led pin  
  pinMode(9,OUTPUT); // Red led pin  
  pinMode(10,OUTPUT); // Relay  
  pinMode(10,HIGH);  // Relay  
 }  
 void loop()   
 {  
  val = digitalRead(4); // pir sensor output pin connected  
  Serial.println(val); // see the value in serial monitor in Arduino IDE  
  delay(100);  
 if(val == 1 )  
 {  
  digitalWrite(8,HIGH);  // Green led on  
  digitalWrite(9,LOW);  // Red led off  
  digitalWrite(10,HIGH); // Relay Module  
 }  
 else  
 {  
  digitalWrite(8,LOW);  // Green led off  
  digitalWrite(9,HIGH); // Red led on  
  digitalWrite(10,LOW); // Relay Module  
 }  
 }  

Code snippet #2

Plain text
 // Techatronic.com  
 int val = 0 ;  
 void setup()  
 {  
  Serial.begin(9600);  
  pinMode(4,INPUT);  // IR sensor output pin connected  
  pinMode(8,OUTPUT); // Green led pin  
  pinMode(9,OUTPUT); // Red led pin  
  pinMode(10,OUTPUT); // Relay  
  pinMode(10,HIGH);  // Relay  
 }  
 void loop()   
 {  
  val = digitalRead(4); // pir sensor output pin connected  
  Serial.println(val); // see the value in serial monitor in Arduino IDE  
  delay(100);  
 if(val == 1 )  
 {  
  digitalWrite(8,HIGH);  // Green led on  
  digitalWrite(9,LOW);  // Red led off  
  digitalWrite(10,HIGH); // Relay Module  
 }  
 else  
 {  
  digitalWrite(8,LOW);  // Green led off  
  digitalWrite(9,HIGH); // Red led on  
  digitalWrite(10,LOW); // Relay Module  
 }  
 }  

Credits

Techatronic

Techatronic

54 projects • 44 followers
Electronic engineer

Comments

Add projectSign up / Login