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

Arduino-Controlled Soil Moisture Monitoring and Water Pump System

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Soil Moisture Monitoring and Water Pump System

Automated Irrigation System Circuit Documentation

Summary

This document describes an automated irrigation system designed to monitor soil moisture levels and activate a water pump when the soil becomes dry. The system is built around an Arduino UNO microcontroller, which interfaces with a soil moisture sensor module and controls a relay to power a 5V mini water pump. A 9V battery provides power to the pump through the relay, and the Arduino is powered via its onboard voltage regulator.

Component List

Arduino UNO

1-Channel Relay (5V 10A)

Soil Moisture Module

5V Mini Water Pump

SparkFun Soil Moisture Sensor

9V Battery

Wiring Details

Arduino UNO

1-Channel Relay (5V 10A)

Soil Moisture Module

5V Mini Water Pump

SparkFun Soil Moisture Sensor

9V Battery

Documented Code

int water; // Variable to store the soil moisture status

void setup() {
  pinMode(3, OUTPUT); // Output pin for relay board, controls the water pump
  pinMode(6, INPUT);  // Input pin for soil moisture sensor
}

void loop() {
  water = digitalRead(6);  // Read the digital signal from the soil sensor's DO pin
  if (water == HIGH) {    // If soil is dry, deactivate the relay (cut power to pump)
    digitalWrite(3, HIGH); // Deactivate the relay, turning off the water pump
  } else {                // If soil is moist, activate the relay (power to pump)
    digitalWrite(3, LOW);  // Activate the relay, turning on the water pump
  }
  delay(400);  // Wait for 400 milliseconds before checking again
}

This code is designed to run on the Arduino UNO microcontroller. It reads the digital output from the soil moisture sensor and controls the relay to power the water pump accordingly. If the sensor indicates dry soil (output HIGH), the relay is deactivated, and the pump is turned off. If the soil is moist (output LOW), the relay is activated, and the pump is turned on to water the plants. The system checks the soil moisture level every 400 milliseconds.