Project showcase
I Keep my Cucumber Growing Conditions Moist

I Keep my Cucumber Growing Conditions Moist © GPL3+

This project creates a relay and a water pump for monitoring moisture.

  • 2,758 views
  • 0 comments
  • 20 respects

Components and supplies

a cucumber breading ;-)
or another dry gardening
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1
soil measurement sensor
×1
Relay (generic)
SONGLE Power Relay 5V SRD-5VDC-SL-C with 3 pins
×1
water pump 12V DC
×1
silikon pipe 8mm outside x 6mm inside
×1
11026 02
Jumper wires (generic)
×1
DC connector male / female
×1

Apps and online services

About this project

Overview

Following the basic principles of dealing with a moisture sensor, the practical application is now in the foreground: it offers itself to the cucumber bed and the problem of monitoring young vegetables in your absence (due to vacation, illness, so on). Nevertheless, it always keeps it moist enough. Neighbors use a once moistened towel; we use a moisture sensor and a threshold to communicate the signal from the Arduino to the relay to the water pump.

Tips

For the replicator, a look at the basic project is recommended. For quick success, the enclosed code can be flashed staying with the basics.

On the 20th of May, 2017 part 2 with premium extensions came out.

Update on the 07.07.2017 part 3 with device changes came out. Cucumbers are now online!

Like my description? You will find more under my account. Follow me to be notified when I publish new projects!

Do not let the Arduino flop into the water bucket: the water pump is inside ;-)

Schematic

Schematic for relay and water pump on top:

This approach can be used universally. An interaction with a relay is triggered by means of the trigger (here, the exceeding of a threshold value of the moisture sensor). This can be a water pump, which switches on and off again as soon as the threshold value is fallen below.

Order your cucumber now!

Final Product

Code

a relay starts a water pumpC/C++
// read the value from a soil moisture sensor
    
    // PIN in Option "easy"
    // GND to GND 
    // VCC to 5 Volt
    
    // PIN in Option "anti_oxidation"
    int soilMoisturePin1 = 4;    // VCC not to 5 Volts - in this Option to Digital Output 4
    int soilMoisturePin2 = 3;    // GNG not to GND - in this Option to Digital Output 3
    int soilMoisturePin3 = A0;   // SIGNAL an einen Analog Pin vom Arduino Board
    int baudrate = 9600;
    
    // 1023 = 100% RAW-Wert is between 0 wet and 1023 dry on 5 Volt
    //  901 = 100% RAW-Wert is between 0 wet and  903 dry on VIN Volt
    //  672 = 100% RAW-Wert is between 0 wet and  672 dry on 3,3 Volt
    // The sensor returned 18% with RAW 188 when fully sunk into the water and light wave movements.
    const int dry = 1023;
    
    const int relayPin = 6;  // SIGNAL from Relay
    int pump_threshold = 60; // it soil DRY >=60% then activate a pump
    
    void setup() 
    {
      Serial.begin(baudrate);
      while(!Serial); //Waiting for Serial connection
      pinMode(soilMoisturePin1, OUTPUT);
      pinMode(soilMoisturePin2, OUTPUT);
      pinMode(relayPin, OUTPUT); //Set pin 6 as an OUTPUT
      digitalWrite(relayPin, LOW); // Relay off - no pump at start
    }
    
    int readSoilMoisture()
    // Das größte Problem eines Feuchtigkeitssensors ist Oxidation. Der Korrosion wird durch Elektrolyse entgegengewirkt mit dieser Funktion.
    // Diese Funktion aktiviert unseren Soil Moisture Sensor für 500ms, liest den aktuellen Wert aus, dreht die Polarität um und deaktiviert den Sensor wieder.
    // The biggest problem of a moisture sensor is oxidation. Corrosion is counteracted by electrolysis with this function.
    // This function activates our Soil Moisture Sensor for 500ms, reads the current value, rotates the polarity, and deactivates the sensor.
    
    {
    int value; 
    digitalWrite(soilMoisturePin1, HIGH);
    digitalWrite(soilMoisturePin2, LOW);
    delay(500); // es wird jede 0,5 sec gemessen - dies könnte auch deutlich seltener eingestellt werden
    value = analogRead(soilMoisturePin3);
    digitalWrite(soilMoisturePin1, LOW);
    digitalWrite(soilMoisturePin2, HIGH);
    delay(500);
    digitalWrite(soilMoisturePin2, LOW);
    return value;
    }
    
    void loop() 
    {
      // Option "easy": int value_water = analogRead(soilMoisturePin3); 
      int value_water = readSoilMoisture(); 
      String water = String((int)((((double)value_water/dry)*100.0)));//Convert Raw value to percentage. This is a generic calculation, depending on raw values from 0 to 1023. 
      Serial.print("Soil moisture: ");
      Serial.print(water);
      Serial.print("% Raw value: ");
      Serial.println(value_water);
      
      //Change String2Integer and check if threshold is reached
      if (water.toInt() >= pump_threshold) // 
      {
      Serial.println("Too dry, we should water it.");
      digitalWrite(relayPin, HIGH);
      }
      else 
      {
      Serial.println("It is wet enough, no need to water it.");
      digitalWrite(relayPin, LOW);
      }

    }

Comments

Similar projects you might like

I Keep my Cucumber Growing Conditions Moist - Part 2

Project tutorial by Ingo Lohs

  • 2,198 views
  • 0 comments
  • 8 respects

Automated Mung Bean Sprouts Growing Machine

Project showcase by solkit

  • 1,667 views
  • 1 comment
  • 7 respects

Light Meter To Measure Plant Growth Conditions

Project tutorial by Jennifer Deegan

  • 1,103 views
  • 2 comments
  • 5 respects

PIR-Sensor Activated RGB Strip Controlled by Uno R3

Project showcase by Ingo Lohs

  • 1,548 views
  • 0 comments
  • 5 respects

Safe City: A Device to Keep You Safe

Project tutorial by Patel Darshil

  • 7,559 views
  • 0 comments
  • 24 respects
Add projectSign up / Login