Automated Plant Watering Jar

by crafttech in Circuits > Microcontrollers

394 Views, 1 Favorites, 0 Comments

Automated Plant Watering Jar

IMG_20230529_163032738.jpg
IMG_20230529_162901681.jpg
IMG_20230529_162924143.jpg

It is a microcontroller-based smart-home equipment for watering two plants. It starts automatically the watering of the plants when the moisture sensors indicate the need for it. It was created from a broken-handle water filter jar and it is an upgrade and improvment of a former plant monitoring system. The former gadget is completed with a peristraltic pump, a water tank and watering pipes in a new and compact form. The water tank is the lower/outer part of the jar, the circuit and the pump is placed in the inner part.

Supplies

The used items:

  • reused broken water filter jug
  • mini peristraltric pump 6V
  • Wio Lite W600 - ATSAMD21 Cortex-M0 wireless development board
  • Grove Shield for Wio Lite
  • 2 Grove Soil Moisture Sensors
  • Grove - 16x2 LCD (White on Blue)
  • grove cables
  • USB-C cable
  • silicone cable
  • some bolts and nuts to fix
  • electric power supply

The Circuit

layout.jpg

The above circuit was assembled.

Assembly

IMG_20230529_163007484.jpg
IMG_20230416_180401597.jpg
IMG_20230419_201523621.jpg
IMG_20220110_121525_1k.jpg

1 - Setting the jar - cutting off the rest of the broken handle

2 - Mounting the pump into the bottom of the inner part of the jar

3 - Mounting the circuit (board, relay, lcd panel) into the top of the inner part of the jar

4 - Attaching cables, sensors and pipes and sealing the inner part of the jar

5 - Placement sensors and pipes in the plant's pot


This smart gadget can work with a 5V power bank, or any 5V adapter.

Code Preparation

Before uploading the code in Arduino IDE, Seeed SAMD boards should be installed. Instructions can be found here: https://wiki.seeedstudio.com/Wio-Lite-W600/

For upload the Seeeduino Zero board among the Seeed SAMD Boards have to be selected as board type.

Upload Code

/*Plant irrigation 1.0 VI 2023 */

#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

void pump(){
 digitalWrite(D5, HIGH); // turn relay on
 Serial.println("Relay on");
 delay(8000);
 digitalWrite(D5, LOW); // turn relay off
 Serial.println("Relay off");
}

void setup()
{
  pinMode(D5, OUTPUT);
lcd.begin(16, 2); // set up the LCD's number of columns and rows
  lcd.print("Starting..."); // Print initialization message to the LCD
  delay(2000);
  lcd.clear();
}

void loop(){

  float moist1 = analogRead(A0);
  float moist2 = analogRead(A3);

  Serial.println("Moisture, palmtree: ");
  Serial.println(moist1);

  if (moist1 > 300){
    Serial.println("Palmtree: Alright.");
    lcd.setCursor(0, 0);    //set the cursor to column 0, line
    lcd.println("Palm: Alright.");
  }
  else if (300 >= moist1){
    Serial.println("Palmtree: Irrigation is required!");
    lcd.setCursor(0, 0);
    lcd.println("Palm: Irrigate!");
  }

  Serial.println("Moisture, avokado: ");
  Serial.println(moist2);

  if (moist2 > 300){
    Serial.println("Avokado:Alright.");
    lcd.setCursor(0, 1);
    lcd.println("Avok.:Alright.");
  }
  else if (300 >= moist2){
    Serial.println("Avokado: Irrigation is required!");
    lcd.setCursor(0, 1);
    lcd.println("Avok.:Irrigate!");
  }
  if ((300 >= moist2)||(300 >= moist1)){
    pump();
  }    
  delay(10000);
}