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

Arduino UNO-Based Solar-Powered Automatic Irrigation System

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Solar-Powered Automatic Irrigation System

Circuit Documentation

Summary

This circuit is designed to automate the watering of plants based on soil moisture levels. It uses an Arduino UNO to read the soil moisture sensor and control a water pump via a relay module. The system is powered by a 12V 7Ah battery, which is charged by a solar panel through a solar charge controller.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • 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
  2. 1 Channel 5V Relay Module

    • Description: A relay module used to control high voltage devices with a low voltage signal.
    • Pins: VCC+, VCC- (GND), IN, N.O., COM, N.C.
  3. Soil Moisture Sensor

    • Description: A sensor used to measure the moisture level in the soil.
    • Pins: gnd, vcc, aout
  4. 12V 7Ah Battery

    • Description: A rechargeable battery used to power the circuit.
    • Pins: 12v +, 12v -
  5. Solar Charge Controller

    • Description: A device used to manage the power from the solar panel to charge the battery.
    • Pins: Solar Cell +, Solar Cell -, Battery +, Battery -, Load +, Load -
  6. Solar Panel

    • Description: A panel that converts sunlight into electrical energy.
    • Pins: +, -
  7. Water Pump

    • Description: A pump used to water the plants.
    • Pins: VCC, GND

Wiring Details

Arduino UNO

1 Channel 5V Relay Module

Soil Moisture Sensor

12V 7Ah Battery

Solar Charge Controller

Solar Panel

Water Pump

Code Documentation

Arduino UNO Code

// Pin definitions
const int soilMoisturePin = A0; // Analog pin connected to soil moisture sensor
const int relayPin = 9;         // Digital pin connected to relay module

// Threshold for soil moisture level
const int moistureThreshold = 300;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  // Initialize the relay pin as an output
  pinMode(relayPin, OUTPUT);
  // Ensure the relay is off initially
  digitalWrite(relayPin, LOW);
}

void loop() {
  // Read the soil moisture level
  int soilMoistureValue = analogRead(soilMoisturePin);
  // Print the soil moisture level to the serial monitor
  Serial.print("Soil Moisture Level: ");
  Serial.println(soilMoistureValue);
  // Check if the soil moisture level is below the threshold
  if (soilMoistureValue < moistureThreshold) {
    // If the soil is dry, turn on the water pump
    digitalWrite(relayPin, HIGH);
    Serial.println("Water pump activated.");
  } else {
    // If the soil is wet, turn off the water pump
    digitalWrite(relayPin, LOW);
    Serial.println("Water pump deactivated.");
  }
  // Wait for a second before taking another reading
  delay(1000);
}

1 Channel 5V Relay Module Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Soil Moisture Sensor Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontrollers.