Creatjet3D-Labsmunazirali4793
Published © GPL3+

Arduino-Based Automatic Water Tap Using IR Sensor

In this project, we have made an automatic water tap using Arduino and IR sensor to solve the problem of wastage of water in our daily life.

IntermediateFull instructions provided27,003
Arduino-Based Automatic Water Tap Using IR Sensor

Things used in this project

Story

Read more

Code

Arduino based automatic water tab using IR sensor.

C/C++
In this project we have made automatic water tab using Arduino and IR sensor to solve the problem of wastage of water in daily life.
#include <Servo.h>


const int SensorPin = 3;  
//int sensorValue = 0;                
int myservo = 9;
int pos = 0; 
Servo servo;

void setup() {
  
servo.attach(myservo);
}

void loop() {
  
  digitalRead(3);
  if(SensorPin==HIGH) 
  servo.attach(9);  
  pos = 90;               // start at midpoint 90 degrees
//  Speed = 3;              // servo moves 3 degrees each time left/right is pushed// attaches the servo on pin 9 to the servo object 
             // start at midpoint 90 degrees             // servo moves 3 degrees each time left/right is pushed    // Set initial position
             
}

Credits

Creatjet3D-Labs

Creatjet3D-Labs

7 projects • 21 followers
munazirali4793

munazirali4793

8 projects • 20 followers

Comments