Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Wi-Fi Enabled Soil Moisture Monitoring System with NodeMCU and Soil Moisture Sensor

View and Edit Project In Cirkit DesignerImage of Wi-Fi Enabled Soil Moisture Monitoring System with NodeMCU and Soil Moisture Sensor

Circuit Documentation

Summary

This circuit is designed to measure soil moisture levels using a soil moisture sensor and a Soil Moisture Module. The data is processed by a NodeMCU V3 ESP8266 microcontroller, which reads the analog values from the sensor and outputs the soil moisture percentage to the serial monitor. The circuit is powered by a 12V power supply, which is regulated to the required voltage levels using a buck converter.

Component List

Soil Moisture Sensor

Soil Moisture Module

NodeMCU V3 ESP8266

Buck Converter

12V Power Supply

Wiring Details

Soil Moisture Sensor

Soil Moisture Module

NodeMCU V3 ESP8266

Buck Converter

12V Power Supply

Code Documentation

NodeMCU V3 ESP8266 Code

#define SOIL_PIN A0 // Analog pin connected to soil sensor

void setup() {
  Serial.begin(115200);
}

void loop() {
  int sensorValue = analogRead(SOIL_PIN); // Read analog value (0-1023)
  
  // Map the value to percentage (adjust range based on your sensor calibration)
  int moisturePercent = map(sensorValue, 1023, 0, 0, 100); 

  Serial.print("Soil Moisture: ");
  Serial.print(moisturePercent);
  Serial.println(" %");

  delay(1000); // Wait 1 second before the next reading
}

This code initializes the serial communication at a baud rate of 115200. In the loop function, it reads the analog value from the soil moisture sensor, maps it to a percentage, and prints the soil moisture percentage to the serial monitor every second.