Automatic Plant Watering System

by Team9Purdue in Circuits > Arduino

879 Views, 8 Favorites, 0 Comments

Automatic Plant Watering System

20230419_141344.jpg

Welcome to our project. Our project is an automated plant watering system. The goal of this is to be an introduce an electromechanical system that is easy, affordable, and has a practical use. As students, we have limited free time and found having trouble remembering to water plants to be a relatable issue to many. Distractions happen, and this is our solution. A plant that waters itself and alerts us when we need to top off the water.

Supplies

Tools:

Phillps screwdriver

Knife or scissors. Used for cutting the tubing to length.

Computer or Laptop with Arduino IDE

Soldering Iron (Optional with Wire Crimp Terminals)

Multimeter for testing (Optional).


Materials:

LAFVIN Basic Starter Kit - Most parts were provided in this kit. The parts may also be purchased individually. [$15.99]

Arduino Uno Rev3 (Provided in Arduino Kit)

LED (Provided in Arduino Kit)

Wiring (Provided in Arduino Kit). Note: Extra wires will need to be purchased if using the kit. 

Bread Board (Provided in Arduino Kit) 

Resistors in 220 ohm, 1k ohm, 10k ohm (Provided in Arduino Kit). Note: linked kit contains more than necessary but includes all values needed. The resistors can also be purchased individually. 

Moisture Sensor (Provided in Arduino Kit)

Optical Sensor [$12.58]

Solenoid actuated water valve [$7.69]

Power Supply - Specifications: 12 Volt. 3 Amp [$9.99]

Tubing [$8.99]

Wire Crimp Terminals (Optional with Soldering Iron)

Cardboard box for housing. (We used the box our parts were shipped in)

Electrical tape.

Assemble Electronics

Screenshot 2023-04-19 203654.png
tinkercadWiring.PNG
20230419_141837.jpg
20230419_141820.jpg
20230419_141753.jpg

Wiring Instructions:


Connect A5 and A4 to separate pins on the breadboard. Place a resistor after both A5 and A4 that is valued at 110 ohms. After that place a green LED connected to the A5 circuit and a red LED connected to the A4 circuit. Finish by connecting both LEDs to the ground.


A3 is the push button. When setting up the pushbutton, place one side of the pushbutton the A3 signal. On the same side place a 110 ohm resistor in parallel to the ground. This will allow for the button to be an active high push button. On the other side of the pushbutton connect to the 5V output of the Arduino.


A2 will connect to the Relay and the solenoid. For the relay, A2 will connect to the signal pin, the ground will be connected to the ground pin and 5V will be connected to the VCC pin. At the other end of the Relay, the solenoid will have one connection to the NC pin and one connection to the COM pin.


A1 connects to the capacitive sensor, to the pin label Aout. Pin GND will connect to the ground and pin VCC will connect to 5V.


A0 connects to the optical sensor. A0 connects with the yellow wire of the optical sensor with a 10k-ohm resistor in parallel connected to ground. The red wire of the sensor will connect to ground and the white wire will connect to 5V. The blue wire connects to a 440-ohm resistor connected to 5V.


Coding

ArduinoCode1.PNG

The code is provided as the Full Program.ino file. If you would like to try it yourself, follow the code.


#define AOUT_PIN A1


int photocellPin = 0;

int photocellReading;


void setup()

{

  Serial.begin(9600);

  pinMode(A2, OUTPUT);  //Solenoid Relay Control

  pinMode(A3, INPUT);  //Solenoid Override Button

  pinMode(A4, OUTPUT);  //Red LED

  pinMode(A5, OUTPUT);  //Green LED

}


void loop()

{

  int value = analogRead(AOUT_PIN); //Read moisture sensor value from A1

  Serial.print("Moisture: ");

  Serial.println(value);

 

  photocellReading = analogRead(photocellPin);  //Read reservoir level sensor from A0

  Serial.print("Reservoir Level = ");

  Serial.println(photocellReading);

 

  delay(1000);

 

  if((value > 300) || (digitalRead(A3) == HIGH)) //If moisture level is too low (dry)or override button is pressed (***adjust this number if you wish to change the average moisture level of the system)

  {

    digitalWrite(A2, HIGH); //Turn on solenoid to add water

    digitalWrite(A4, HIGH); //Turn on red LED

  }

  else

  {

    digitalWrite(A2, LOW); //Turn off solenoid

    digitalWrite(A4, LOW); //Turn off LED

  }

 

  if(photocellReading < 500) //If water level is above the water level sensor (full)

  {

    digitalWrite(A5, HIGH); //Turn on green LED

  }

  else

  {

    digitalWrite(A5, LOW);  //Turn off green LED

  }

}




Open Arduino IDE. If you have not downloaded it, please install it at this time. Software | Arduino

Define your board as an Arduino UNO.

Connect your Arduino to your computer via the provided USB.

Upload the provided code.


Calibrating your sensor:

In the Arduino IDE open your code file. Open the live serial monitor. Note the reading of the moisture sensor in air and submerged up to the line on the sensor in water. Then do the same but in dry soil to get a base reading. The values may need to be adjusted for your individual sensor.

The next step is to place the optical sensor into the water bottle. Please note that the green LED light will not turn on initially as there is no water in the bottle. It should turn on once water is added. If it does not turn on, please check your connections and your code.

Downloads

Making the Reservoir

20230419_141411 (2).jpg

Use a knife to cut out the bottom of the water bottle you chose.

Trace an outline of the tubing on to the bottle cap.

Use the knife again to cut out the shape you traced on the bottle cap.


Constructing Housing

Take a box. Any small sized box would work. The one we used is 8" x 5" x 10".

Use the reservoir and trace the outline of the cap.

Use a knife to cut out the shape you drew.

Connecting the Solenoid

20230419_141804 (1).jpg

Soldering looks better and makes a strong connection.

Alternatives:

Using wire crimp terminals

Securing the wiring using electrical tape is also an option. It will not look pretty but could work temporarily until a better connection can be made.

Putting It All Together

20230419_141344 (2).jpg
20230419_141437.jpg
20230419_141351.jpg

Insert the reservoir into the housing.

Connect your tubing to the reservoir. You will need to use electrical tape to seal the tubing and create a leak-free fit.

Connect the tubing from the reservoir to the solenoid and ensure that it is inserted up to the o-ring.

All of the electronics should be wired at this point.

Install the breadboard on to one of the sides of the box. It comes with an adhesive backing so remove the sticker and apply it to the box.

Repeat the process for the Arduino. This time use electrical tape. If you want to spend more, Velcro would be a better option.

We chose to place the solenoid inside the housing. This component will survive if you have any initial leaks.

Now install another piece of tubing from the solenoid and run it to your plant. Trim if necessary.

The bottle and tubing are gravity fed so no need for a pump.

Test the System

ECET 38001 Final Project

After you have calibrated the sensor, you can try pressing the red push button. The red LED should light up, and the valve should be in the open state. Please note that if your red LED or valve does not function properly after pressing the push button, please check your code and connections to ensure they are correct.


After checking the system and sensor, you should make sure that the tubing is properly connected to the valve and ensure that there are no water leaks.

References

[1]

Inspiration Image from Midjourney


[2]

R. S. Ferrarezi, S. K. Dove, and M. W. van Iersel, “An Automated System for Monitoring Soil Moisture and Controlling Irrigation Using Low-cost Open-source Microcontrollers,” HortTechnology, vol. 25, no. 1, pp. 110–118, Feb. 2015, doi: 10.21273/horttech.25.1.110.


[3]

M. R. Gaiker, R. Krushna Fasale, and J. Krishnadas Varule, “AUTOMATIC INTELLIGENT PLANT WATERING SYSTEM DEPENDING ON THE SOIL MOISTURE,” 2017. Accessed: Jan. 27, 2023. [Online]. Available: http://ijariie.com/AdminUploadPdf/Automatic_Plant_watering_system_depending_upon_soil_moisture_ijariie4100.pdf


[4]

C. M. Devika, K. Bose and S. Vijayalekshmy, "Automatic plant irrigation system using Arduino," 2017 IEEE International Conference on Circuits and Systems (ICCS), Thiruvananthapuram, India, 2017, pp. 384-387, doi: 10.1109/ICCS1.2017.8326027.


[5]

S. Akwu et al, "Automatic plant Irrigation Control System Using Arduino and GSM Module," International Journal of Engineering and Manufacturing, vol. 10, (3), pp. 12, 2020. Available: https://www.proquest.com/scholarly-journals/automatic-plant-irrigation-control-system-using/docview/2420855205/se-2. DOI: https://doi.org/10.5815/ijem.2020.03.02.


[6] “Project Description,” Brightspace. https://purdue.brightspace.com/d2l/le/content/704478/viewContent/11560738/View (accessed Feb. 17, 2023).


[7] M. R. Gaiker, R. Krushna Fasale, and J. Krishnadas Varule, “AUTOMATIC INTELLIGENT PLANT WATERING SYSTEM DEPENDING ON THE SOIL MOISTURE,” 2017. Accessed: Jan. 27, 2023. [Online]. Available: http://ijariie.com/AdminUploadPdf/Automatic_Plant_watering_system_depending_upon_ soil_moisture_ijariie4100.pdf


[8] A. Stesel, A. Osanlou, and M. Nestiurkina, “A sustainable indoor plant production management system with wireless internet access,” IEEE Xplore, Jan. 01, 2018. https://ieeexplore.ieee.org/abstract/document/8317452 (accessed Feb. 17, 2023).


[9] Hana Mujlid , Haneen Daifallah Alghamdi , Hind Abdulaziz Alkharashi , Marah Awadh Alkhaldi. IOT Intelligent Watering Sensor For Indoor Plant. Dec. 2022, http://paper.ijcsns.org/07_book/202212/20221222.pdf.


[10] Superadmin. “Dangers of Exposed Wiring!” The Local Electrician, 26 Sept. 2021, https://www.thelocalelectrician.com.au/dangers-of-exposed-wiring/


[11] Microdrips, “How much water for my plants?,” MicroDrips Blog, May 22, 2019. https://www.microdrips.com/en/blog/drip-irrigation/how-much-water-plants/


[12] “Ultrasonic Sensor Accuracy | What Impacts Sensor Accuracy?,” Senix Distance and Level Sensors. https://senix.com/ultrasonic-sensor-accuracy/


[13] “Arduino Uno Rev3,” Arduino Online Shop. https://store-usa.arduino.cc/products/arduino-uno-rev3?selectedStore=us


[14] Water Science School, “Water Density | U.S. Geological Survey,” USGS, Jun. 05, 2018. https://www.usgs.gov/special-topics/water-science-school/science/water-density


[15] “Capacitive soil moisture sensor module,” ProtoSupplies, 11-Jan-2023. Accessed:01-Mar-2023. [Online]. Available:  https://protosupplies.com/product/capacitive-soil-moisture-sensor-module/.

 

[17] “SW-PB1-1DZ-A-P1-A.” Accessed: Mar. 04, 2023. [Online]. Available: 

https://www.digikey.com/en/products/detail/adam-tech/SW-PB1-1DZ-A-P1-A/15284415 


[18] “Digiten DC 12V 1/4’ Inlet Feed Water Solenoid Valve Quick Connect N/C.” DIGITEN, https://www.digiten.shop/products/digiten-dc-12v-1-4-inlet-feed-water-solenoid-valve-quick-connect-n-c-normally-closed-no-water-pressure


[19] Optical Liquid-Level Sensor - Assets.omega.com. https://assets.omega.com/pdf/process-switches/level-switches/float-switches/LV170.pdf


[20] A. Liu, “PAGE: 1 OF 6 APPROVED: WYNEC CHECKED: T-1 3/4 (5mm) SOLID STATE LAMP,” 2007. Available: https://cdn-shop.adafruit.com/datasheets/WP7113SRD-D.pdf