Soil Moisture Detection Circuit using esp8266 Node MCU with code

Soil Moisture Detection Circuit using Node MCU esp8266




Circuit Diagram

The soil wet device consists of 2 probes that live wont to measure the volumetrical content of water. The 2 probes permit this to labor under the soil then it gets the resistance price to live the wet price.

When there's a lot of water, the soil can conduct a lot of electricity which implies that there'll be less    resistance. Therefore, the wet level are higher. Dry soil conducts electricity poorly, thus once there'll be less water, then the soil can conduct less electricity which implies that there'll be a lot of resistance. Therefore, the wet level are lower.


Connect jumper wires as per circuit diagram


Code to Execute on Arduino IDE

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
void setup() {
  
pinMode(A0,INPUT);
Serial.begin(9600);
}

void loop() {
  
int Moisture= analogRead(A0);
Serial.println(Moisture);
delay(100);
}


After uploading code on Node MCU observe your output on serial Monitor of  Arduino IDE


If you still have any questions related to this article, then you can message me on my social media accounts.



!!THANKS FOR VISITING!!
!!HAPPY LEARNING!!
!!HAVE A GREAT DAY!!