WATER LEVEL CONTROLLED BY IP67 SENSOR

water level controling

The code can be downloaded at:

https://github.com/triantara/ARDUINO-TRIANTARA/blob/main/WATER%20LEVEL%20BY%20IP67%20SENSOR.zip

#define led 3 //this pin for drive relay/ MOSFET

void setup() {

Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(18, INPUT);
pinMode(19, INPUT);
digitalWrite(18, HIGH);
digitalWrite(19, HIGH);
}
void loop() {
if (digitalRead(18) == HIGH) { // down level
digitalWrite(led, HIGH);// go to gate pin mosfet

}
if (digitalRead(19) == LOW) { // upper level
digitalWrite(led, LOW);
}

}

One thought on “WATER LEVEL CONTROLLED BY IP67 SENSOR

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s