

The moisture module hygrometer is a sensor designed to measure the moisture level in soil or air. It provides real-time data on humidity and moisture content, making it an essential tool for applications such as precision agriculture, automated irrigation systems, and environmental monitoring. This module is widely used in projects requiring soil moisture detection or humidity sensing, particularly in smart gardening and IoT-based systems.








Below are the key technical details and pin configuration for the moisture module hygrometer:
| Pin Name | Description |
|---|---|
| VCC | Power supply pin. Connect to 3.3V or 5V DC. |
| GND | Ground pin. Connect to the ground of the power supply. |
| A0 | Analog output pin. Provides a continuous voltage proportional to moisture level. |
| D0 | Digital output pin. Outputs HIGH or LOW based on the moisture threshold set. |
Wiring the Module:
Adjusting Sensitivity:
Placement:
Below is an example code to read both analog and digital outputs from the moisture module hygrometer:
// Define pin connections
const int analogPin = A0; // Analog output pin connected to A0
const int digitalPin = 2; // Digital output pin connected to D2
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
// Read analog value from the sensor
int moistureLevel = analogRead(analogPin);
// Read digital value from the sensor
int digitalState = digitalRead(digitalPin);
// Print analog moisture level to the Serial Monitor
Serial.print("Analog Moisture Level: ");
Serial.println(moistureLevel);
// Print digital state to the Serial Monitor
Serial.print("Digital Output State: ");
if (digitalState == HIGH) {
Serial.println("Dry");
} else {
Serial.println("Wet");
}
delay(1000); // Wait for 1 second before the next reading
}
No Output or Incorrect Readings:
Unstable Digital Output:
Corrosion on the Sensor Probe:
Q: Can this module measure air humidity?
A: While primarily designed for soil moisture, the module can detect moisture in the air to some extent. However, for precise air humidity measurements, a dedicated humidity sensor like the DHT11 or DHT22 is recommended.
Q: How do I interpret the analog output?
A: The analog output provides a voltage proportional to the moisture level. Higher voltage typically indicates lower moisture, while lower voltage indicates higher moisture.
Q: Can I use this module with a Raspberry Pi?
A: Yes, the module can be used with a Raspberry Pi. Connect the analog output to an ADC (Analog-to-Digital Converter) module, as the Raspberry Pi lacks built-in analog input pins.
Q: Is the module waterproof?
A: Only the sensor probe is designed to be water-resistant. The main module should be kept dry and protected from moisture.