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

Arduino UNO Controlled Soil Moisture Monitoring and Water Pump System

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

Circuit Documentation

Summary

The circuit in question is designed to monitor soil moisture using a Humidity YL-69 sensor and control a 5V mini water pump based on the moisture level. An Arduino UNO serves as the central microcontroller, interfacing with the sensor and an LCD I2C display to provide real-time feedback on the system status and soil moisture level. A relay module is used to control the power to the water pump, and a 12V battery provides the power supply for the system.

Component List

Arduino UNO

Humidity YL-69

LCD I2C Display

Battery 12V

Relay Module 5V-30V

5V Mini Water Pump

Wiring Details

Arduino UNO

Humidity YL-69

LCD I2C Display

Battery 12V

Relay Module 5V-30V

5V Mini Water Pump

Documented Code

Arduino UNO Code

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
  lcd.clear();
  pinMode(2, OUTPUT);
  digitalWrite(2, HIGH);
  delay(1000);
  lcd.setCursor(0, 0);
  lcd.print("Rithunand's");
  lcd.setCursor(0, 1);
  lcd.print("SYSTEM IS ON ");
  lcd.print("");
  delay(3000);
  lcd.clear();
}

void loop() {
  int value = analogRead(A0);
  Serial.println(value);
  if (value > 950) {
    digitalWrite(2, LOW);
    lcd.setCursor(0, 0);
    lcd.print("Water Pump is ON ");
  } else {
    digitalWrite(2, HIGH);
    lcd.setCursor(0, 0);
    lcd.print("Water Pump is OFF");
  }

  if (value < 300) {
    lcd.setCursor(0, 1);
    lcd.print("Moisture : HIGH");
  } else if (value > 300 && value < 950) {
    lcd.setCursor(0, 1);
    lcd.print("Moisture : MID ");
  } else if (value > 950) {
    lcd.setCursor(0, 1);
    lcd.print("Moisture : LOW ");
  }
}

This code initializes the LCD display and sets up the Arduino to read the moisture level from the Humidity YL-69 sensor. Depending on the moisture level, it controls the relay to turn the water pump on or off and updates the display with the system status and moisture level.