Soluții

Reparare eroare:”Trust Relationship Failed” fără scoatere din domeniu și fără restart (PowerShell)

Un utilizator nu se poate loga pe stația de lucru și primește mesajul de eroare: “The trust relationship between this workstation and the primary domain failed”. Acest lucru se întâmplă de obicei dacă PC-ul a stat stins mult timp, a fost restaurat dintr-un snapshot vechi sau parola contului de computer din AD s-a desincronizat.

[mai mult...]

Arduino Soil Moisture Sensor

 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

  1. Upload the code to Arduino
  2. Open the Serial Monitor
  3. Set baud rate to 9600
  4. Insert the sensor into soil
  5. Add water and observe changes

Wet soil produces lower values, while dry soil produces higher values.

Troubleshooting

  • Always reads 1023: Sensor not properly inserted
  • No value change: Loose wiring or faulty sensor
  • Unstable readings: Electrical noise or dry air
  • Corrosion: Use capacitive sensor instead of resistive

Optional Upgrades

  • Add relay and water pump for automatic irrigation
  • Add LCD or OLED display
  • Use ESP8266/ESP32 for IoT monitoring
  • Log data to SD card for analysis.
[mai mult...]