Skip to main content

Arduino Systems: Automatic Plant Watering System

HELLO THERE!!!

  How are you, guys? I hope everyone is fine and in good condition always. Alright, this week, I wanted to share with you guys on a system that I made over the weekend. It is called the Automatic Plant Watering System. Without wasting more time, lets see the hardware and software needed in making this system.


HARDWARE:
1. Arduino UNO
2.DC Water pump.(My water pump is exactly as below)
3.A relay(single channel)

4. A soil moisture sensor


SOFTWARE:
1. Arduino UNO

 Ok now that all the items had been listed lets see the overall assembly of the circuit. I am sorry as my assembly of the circuit is a bit messy:

Don't worry... I will do my best to explain the circuit..


I'll divide the system into two circuits:

1. The soil moisture part

The soil moisture sensor usually comes with 4 pins (VCC,GND,A0(analog pin),D0(digital pin)). In this system I had used the VCC,GND, and A0 pins:

From soil moisture to Arduino:
VCC-->5V
GND-->GND
A0-->A0

The connection of the soil moisture sensor to Arduino



2.Relay + Water pump connection


The relay comes with three pins( as shown in the relay image at the beginning of this post). The connection from relay to Arduino is as shown;

IN(in some relays it is names as S)-->Digital pin 8
VCC-->5V
GND-->GND


From the water pump to relay is shown as image below:

The connection of water pump to relay


Now that the assembly of the circuit has been done. Let's view the code that is used to run the circuit:



int moist = A0;//moisture sensor pin
int relay = 8;//relay pin





void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);  //serial communication begins at 9600bps
pinMode(relay, OUTPUT);//relay as OUTPUT

}

void loop() {
  // put your main code here, to run repeatedly:
if (analogRead(0) >= 800)// if soil moisture reads value more than 800(dry).changeable
{
  Serial.println(analogRead(0));//print the reading
  digitalWrite(relay,LOW);//turn on the water pump
}
if (analogRead(0) < 800)//else
{
  Serial.println(analogRead(0));//print the reading

  digitalWrite(relay,HIGH);//turn off the water pump


Alright, that's the code, folks!! Upload the code and let the system run!! You can tinker around by changing the NC to NO connection from water pump to relay ( I used NC,btw) or change the soil moisture sensor condition value or even add some LED's or LCD display to display reading!! Many things can be done to tinker around this system. Before I end this post, I'll show the demonstration video I made for this system.








That's all from me guys. See you next week, till then HAPPY TINKERING!!!























Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hello, I'm doing this project now (with the same components as your project) may I ask, is the reading supposed to be that high (approx 800)? Because when I coded mine the reading states around 200-360 only (Highest I ever gotten was 369) and when I put it in the water to test it out, the reading is almost similar as when it wasn't in the water... Please help me! :'( (This project is due in 3 more weeks and I have a lot more to do)

    Btw, if it is not too much to ask, can you please make a video of you assembling this project from scratch? It'll be really helpful for me!

    Sorry for troubling you and thank you very much! :)

    ReplyDelete
    Replies
    1. Hi natasha, sorry for the late reply(had some prob with gmail). About the readings for the soil moisture sensor, there should be major difference when you put it in and out of water. You might want to test with a different soil moisture sensor just in case. About making the video, i am not sure if i can make it as i am bit busy with some work.😅😅

      Delete
  3. Thank you for your reply, my readings are now similar to yours, however I now have some problems with my water pump... It pumps water but it cannot be controlled like yours... Do you think there's something wrong with my relay or something else? But my relay's LED are both working fine

    ReplyDelete
    Replies
    1. *which means that my relay is working fine right? So why can't I control my water pump?

      Delete
    2. Ok, there are few things you can try.
      1. Check if your relay is working. Upload a simple relay sketch and connect your led to relay to see if your relay is working as intended.
      2. Check your water pump connection to arduino and relay. You made some mistake in the connection
      3. If you are using more than one water pump in the same arduino board, i advise you not to do so as 2 water pumps will cause the circuit to be over burdened although connected to relay
      4. Maybe the switching mechanism of the relay is a bit slow causing your water pump to respond slow. Try give it some time and see if the pump responds or not

      Delete
    3. Hey! I would just like to thank you for helping me with my problems. My project has been submitted already but I was still unable to solve my water pump problem so I decided to pull it out of my project altogether. Thank you again for your input and have a great day!

      Delete
  4. Water Pump Installation involves the process of fitting and configuring a water pump system to extract water from a source, such as a well, river, or reservoir, and deliver it to its intended destination. This process typically includes selecting an appropriate pump type based on factors like water source depth, required flow rate, and intended usage.

    ReplyDelete

Post a Comment

Popular posts from this blog

Arduino and Multi Function Shield: Pots,LEDs and buzzers

HELLO THERE!!!!!    How are you guys? I hope everyone is fine and in good mood always. This week, I continue my tinkerings with the Multi Function Shield. In this experiment, I used the potentiometer in the shield to control the LEDs in the shield. Without further wasting time, let's jump in straight to the experiment!! HARDWARE 1.ARDUINO UNO  2.MULTI-FUNCTION SHIELD SOFTWARE: 1. ARDUINO IDE CIRCUIT ASSEMBLY    The circuit assembly is fairly simple. Just attach the multi function shield on top of Arduino properly. Please attach the shield properly as failure to do so would cause the shield  not to function as intended. CODING THE ARDUINO: Let's refer to the multi-function shield image below: Referring to the image of the shield, it can be seen that the potentiometer (blue object near buttons) is connected to pin A0 (analog 0)     int pot = A0; //declaring the pot and led pins int l1 = 13; int l2

Arduino Beginner Experiments: Arduino and Light Blocking Sensor

HELLO THERE!!!     How are you guys? I hope everyone is fine and in a good mood always. This week, I would like to share with you guys my experiment on Arduino and Light Blocking Sensor. The objective of this experiment is to receive feedback from the sensor ( Digital and Analog) What is Light Blocking Sensor?      A linear hall sensor is a type of sensor which responds when the sensor is blocked out from light. The sensor is different for LDR's as LDR's responds to the amount of light it received while the light blocking sensor responds if the light is blocked out or not from the sensor.It can be used for both digital and analog measurements. HARDWARE: 1.Arduino UNO 2. Light Blocking Sensor SOFTWARE: 1.Arduino IDE CIRCUIT ASSEMBLY   Let's refer to the image of the blocking sensor below: The Connection of the Sensor to the Arduino is shown below: SENSOR  ----->       ARDUINO Signal      ------>     Any Analog/Digital pin

Arduino Tinkering : Controlling multiple LED with multiple potentiometers

HELLO THERE!!!!            How are you guys? I hope everyone is fine and well always. For this week's post, I would like to share with you guys a simple tinkering on Arduino, LED, and potentiometers. The objective of the experiment is to light up different amount of LED's with different intensity by controlling two potentiometers. Before starting, of course, we need to know what items are needed. The items needed are: 1. Arduino UNO   2. 4 to 5 LEDs 3. 2 Potentiometers The software used in this experiment is: 1. Arduino IDE. Now that all the hardware and software are obtained, let's go to the schematics of the circuit. The circuit is quite simple actually. The long legs of the LED's were connected to PWM pins while the shorter legs were connected to ground. The potentiometers however have three legs. The middle leg is connected to the analog pins (A0, A1) while the other two legs were connected to 5V and GND respectively. Don't w