Shortcut find keyword in the current tab MS Edge
Cautarea dupa un cuvant cheie intr-o pagina web functioneaza asemanator cu cea dintr-un editor de text, de exemplu.
[mai mult...]Soluții pentru problemele tale IT
Cautarea dupa un cuvant cheie intr-o pagina web functioneaza asemanator cu cea dintr-un editor de text, de exemplu.
[mai mult...]Desi poate parea ceva nesemnificativ, apasand o singura tasta putem muta focusul pe butonul Settings and more. Acest lucru poate de exemplu sa ajute pe cineva sa gaseasca meniul Settings mai usor.
[mai mult...]How the Soil Moisture Sensor Works
Resistive Sensor
Uses two metal probes to measure electrical resistance. Wet soil has lower resistance, while dry soil has higher resistance.
Capacitive Sensor
Measures changes in soil capacitance and has no exposed metal parts. It provides more stable and long-lasting performance.
Both sensors provide an analog output that Arduino reads.
Wiring the Soil Moisture Sensor
Soil Sensor → Arduino VCC → 5V GND → GND AO → A0
The digital output (DO) pin is optional and can be used with a preset threshold.
Arduino Code (Basic Reading)
int soilPin = A0;
int soilValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
soilValue = analogRead(soilPin);
Serial.print("Soil Moisture Value: ");
Serial.println(soilValue);
delay(1000);
}
Understanding Soil Moisture Values
| Sensor Value | Soil Condition |
|---|---|
| 0 – 300 | Very Wet |
| 300 – 600 | Moist |
| 600 – 900 | Dry |
| 900 – 1023 | Very Dry |
Values may vary depending on soil type. Always calibrate with dry and wet soil.
Improved Code with Moisture Status
int soilPin = A0;
int soilValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
soilValue = analogRead(soilPin);
Serial.print("Soil Moisture: ");
Serial.print(soilValue);
if (soilValue < 300) {
Serial.println(" - WET");
}
else if (soilValue < 600) {
Serial.println(" - MOIST");
}
else {
Serial.println(" - DRY");
}
delay(1000);
}
Testing the Sensor
Wet soil produces lower values, while dry soil produces higher values.
Troubleshooting
Optional Upgrades