Arduino Humidity Sensor Tutorial

The soil moisture sensor, also known as the soil humidity sensor, consists of stainless steel probes and waterproof tips, allowing it to be buried in soil and embankments for long-term use. It can perform point monitoring and online measurement of both surface and deep soil moisture conditions. When used in conjunction with a data collector, it can serve as a tool for point moisture monitoring or mobile measurement (i.e., farmland moisture detection instrument). Note: The sensor typically uses a PVC shell with epoxy resin encapsulation.

It is suitable for scientific experiments, water-saving irrigation, greenhouses, flower and vegetable cultivation, grassland pastures, rapid soil testing, plant cultivation, sewage treatment, and measuring the moisture content of various particulate materials.

Arduino Humidity Sensor Tutorial

Arduino Humidity Sensor Tutorial

This example demonstrates the simplest application: reading the sensor’s return value.

int moisture = 0;// Define an integer variable to display moisture level
void setup()
{
  pinMode(A1, INPUT);// Set A1 pin as input to read sensor data
  Serial.begin(9600);// Start serial communication
}

void loop()
{
  moisture = analogRead(A1);// Read data from A1
  Serial.println(moisture);// Output moisture value to serial monitor
  delay(1000); // Wait for 1 second
}

The serial return value ranges from 0 to 876.

Arduino Humidity Sensor Tutorial

Leave a Comment