Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Create an Automated Plant Watering System Using Arduino

Creating an automated plant watering system with Arduino is a practical and educational project that combines electronics, programming, and gardening. This system ensures your plants receive the right amount of water even when you're not around. Here's how you can build one using an Arduino board.

Components Needed:

  1. Arduino Uno or any compatible board
  2. Soil moisture sensor
  3. Water pump
  4. Relay module
  5. Jumper wires
  6. Power supply (battery or adapter)
  7. Water container
  8. Tubing for water delivery

Step-by-Step Guide:

  1. Set Up the Soil Moisture Sensor:

    • Connect the VCC pin of the soil moisture sensor to the 5V pin on the Arduino.
    • Connect the GND pin to the GND on the Arduino.
    • Connect the analog output pin (A0) of the sensor to one of the analog pins on the Arduino, such as A0.
  2. Connect the Relay Module:

    • Connect the IN pin of the relay module to a digital pin on the Arduino, such as pin 7.
    • Connect the VCC pin to the 5V pin on the Arduino.
    • Connect the GND pin to the GND on the Arduino.
  3. Set Up the Water Pump:

    • Connect the water pump to the relay module. The relay will act as a switch to turn the pump on and off.
    • Ensure the pump is connected to an appropriate power source, typically a separate power supply.
  4. Write the Arduino Code:

const int sensorPin = A0; // Soil moisture sensor connected to A0
const int relayPin = 7;   // Relay module connected to pin 7
int sensorValue = 0;      // Variable to store the sensor value
int threshold = 300;      // Threshold value for soil moisture

void setup() {
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, HIGH); // Turn off the pump initially
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(sensorPin); // Read the sensor value
  Serial.print("Soil Moisture Level: ");
  Serial.println(sensorValue);

  if (sensorValue < threshold) {
    digitalWrite(relayPin, LOW); // Turn on the pump
    Serial.println("Pump ON");
  } else {
    digitalWrite(relayPin, HIGH); // Turn off the pump
    Serial.println("Pump OFF");
  }

  delay(2000); // Wait for 2 seconds before the next reading
}
  1. Upload the Code:

    • Connect your Arduino to your computer using a USB cable.
    • Open the Arduino IDE, paste the code, and upload it to the Arduino board.
  2. Test the System:

    • Place the soil moisture sensor into the soil of the plant you want to water.
    • Ensure the water pump is submerged in the water container and connected to the tubing leading to the plant.
    • Power the Arduino and observe the system. The pump should activate when the soil moisture level is below the threshold.

Adjustments:

  • You may need to adjust the threshold value based on the specific moisture needs of your plant and the characteristics of your soil.

Safety Note:

  • Ensure all electrical connections are secure and insulated to prevent short circuits.
  • Use a separate power supply for the water pump if it requires more power than the Arduino can provide.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.