DIY Projects
Published © CC BY

Soil Moisture Sensor with Arduino Uno

Hello Friends, In this video How to make Soil sensor with arduino uno

BeginnerShowcase (no instructions)1 hour32,071
Soil Moisture Sensor with Arduino Uno

Things used in this project

Story

Read more

Code

Arduino code

C/C++
int WET= 3; 
int DRY= 2;  
int Sensor= 0; // Soil Sensor input at Analog PIN A0
int value= 0;

void setup() {
   Serial.begin(9600);
   pinMode(WET, OUTPUT);
   pinMode(DRY, OUTPUT);
   delay(2000);
}

void loop() {
   Serial.print("MOISTURE LEVEL : ");
   value= analogRead(Sensor);
   value= value/10;
   Serial.println(value);
   if(value<50)
   {
      digitalWrite(WET, HIGH);
   }
   else
   {
      digitalWrite(DRY,HIGH);
   }
   delay(1000);
   digitalWrite(WET,LOW);
   digitalWrite(DRY, LOW);
}

Credits

DIY Projects
11 projects • 21 followers
Student

Comments