Alfa
Published © MIT

Soil Moisture Sensor With Arduino Leonardo!!

Hello Friends, in this video I will show you How to Interface Arduino Leonardo with  Moisture Sensor. im using the Arduino Leonardo

BeginnerProtip1 hour2,215
Soil Moisture Sensor With Arduino Leonardo!!

Things used in this project

Story

Read more

Schematics

Circuit

Code

Circuit

Arduino
//Smart Tronics  www.youtube.com/SmartTronics
//Moisture Sensor
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

Alfa

Alfa

32 projects • 68 followers

Comments