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

Arduino-Controlled Soil Moisture Sensing Water Pump

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

Circuit Documentation

Summary

This circuit is designed to control a 5V mini water pump based on the moisture level detected by a Humidity YL-69 sensor. The Arduino UNO serves as the central microcontroller, reading the sensor data and controlling a 1-Channel Relay, which in turn powers the water pump. The relay ensures that the pump is activated only when the moisture level is below a certain threshold, indicating that the soil is dry and requires watering.

Component List

Arduino UNO

5V Mini Water Pump

Power Supply

1-Channel Relay (5V 10A)

Humidity YL-69 Sensor

Wiring Details

Arduino UNO

5V Mini Water Pump

Power Supply

1-Channel Relay (5V 10A)

Humidity YL-69 Sensor

Documented Code

int water; // Variable to store the moisture level

void setup() {
  pinMode(3, OUTPUT); // Output pin for relay board, this will send signal to the relay
  pinMode(6, INPUT);  // Input pin coming from soil sensor
}

void loop() {
  water = digitalRead(6);  // Reading the signal from the soil sensor
  if (water == HIGH) {     // If water level is full, then cut the relay
    digitalWrite(3, LOW);  // LOW is to cut the relay
  } else {
    digitalWrite(3, HIGH); // HIGH to continue providing signal and water supply
  }
  delay(400);  // Wait for 400 milliseconds
}

This code is designed to run on the Arduino UNO. It initializes the relay control pin (D3) as an output and the soil moisture sensor pin (D6) as an input. In the main loop, it reads the moisture level from the sensor. If the sensor detects moisture (HIGH), the relay is turned off (LOW), stopping the water pump. If the sensor detects a lack of moisture (LOW), the relay is turned on (HIGH), activating the water pump. The system checks the moisture level every 400 milliseconds.