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

Arduino UNO-Based Automatic Plant Watering System with LCD Display and RGB LED Indicators

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Automatic Plant Watering System with LCD Display and RGB LED Indicators

Automatic Water Dispenser for Plant Pot

Summary

This project is an automatic water dispenser system designed for plant pots. It uses a soil moisture sensor and a water level sensor to monitor the conditions of the plant. The system displays the water level on an LCD and activates a water pump when the soil moisture is low. Additionally, an RGB LED provides visual feedback on the system's status.

Component List

  1. RGB LED (Wokwi compatible)

    • Pins: R, COM, G, B
    • Description: RGB LED for visual feedback.
    • Properties: None
  2. Water Sensor

    • Pins: Signal, VCC, GND
    • Description: Sensor to detect water level.
    • Properties: None
  3. Resistor (220 Ohms)

    • Pins: pin1, pin2
    • Description: Resistor for current limiting.
    • Properties:
      • Resistance: 220 Ohms
  4. Resistor (1000 Ohms)

    • Pins: pin1, pin2
    • Description: Resistor for current limiting.
    • Properties:
      • Resistance: 1000 Ohms
  5. 16X2 LCD

    • Pins: VSS, VDD, V0, RS, RW, E, D1, D0, D2, D3, D4, D6, D5, D7, A, K
    • Description: LCD display for showing water level.
    • Properties: None
  6. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: Microcontroller for controlling the system.
    • Properties: None
  7. Soil Moisture Sensor

    • Pins: VCC, GND, SIG
    • Description: Sensor to detect soil moisture level.
    • Properties: None
  8. 5V Mini Water Pump

    • Pins: positive pin, negative pin
    • Description: Water pump for watering the plant.
    • Properties: None
  9. Rotary Potentiometer (1000 Ohms)

    • Pins: leg1, wiper, leg2
    • Description: Potentiometer for adjusting LCD contrast.
    • Properties:
      • Resistance: 1000 Ohms
  10. NPN-Transistor

    • Pins: E, C, B
    • Description: Transistor for switching the water pump.
    • Properties: None
  11. FR607

    • Pins: Cathode, Anode
    • Description: Diode for protection.
    • Properties: None

Wiring Details

RGB LED (Wokwi compatible)

Water Sensor

Resistor (220 Ohms)

Resistor (220 Ohms)

Resistor (1000 Ohms)

16X2 LCD

Arduino UNO

Soil Moisture Sensor

5V Mini Water Pump

Rotary Potentiometer (1000 Ohms)

NPN-Transistor

FR607

Code Documentation

/*
 * Automatic Water Dispenser for Plant Pot
 * This code controls an automatic water dispenser system. It reads soil moisture
 * and water level sensors, displays the water level on an LCD, and activates a
 * water pump when the soil moisture is low.
 */

#include <LiquidCrystal.h>

// Pin definitions
const int soilMoisturePin = A5;
const int waterSensorPin = A4;
const int pumpPin = 10;
const int redLEDPin = 9;
const int greenLEDPin = 8;
const int blueLEDPin = 6;

// LCD pin definitions
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // Initialize the LCD
  lcd.begin(16, 2);
  lcd.print("Water Level:");

  // Initialize pins
  pinMode(soilMoisturePin, INPUT);
  pinMode(waterSensorPin, INPUT);
  pinMode(pumpPin, OUTPUT);
  pinMode(redLEDPin, OUTPUT);
  pinMode(greenLEDPin, OUTPUT);
  pinMode(blueLEDPin, OUTPUT);
}

void loop() {
  // Read sensor values
  int soilMoisture = analogRead(soilMoisturePin);
  int waterLevel = analogRead(waterSensorPin);

  // Convert water level to percentage
  int waterLevelPercent = map(waterLevel, 0, 1023, 0, 100);

  // Display water level on LCD
  lcd.setCursor(0, 1);
  lcd.print(waterLevelPercent);
  lcd.print("%");
  lcd.print("   "); // Clear any remaining characters

  // Check soil moisture and control pump
  if (soilMoisture < 300) { // Threshold for dry soil
    digitalWrite(pumpPin, HIGH); // Turn on pump
    digitalWrite(redLEDPin, HIGH); // Turn on red LED