Automatic Plant Watering and Soil Moisture Sensing





Introduction: Automatic Plant Watering and Soil Moisture Sensing

There are many such instructable created. But the problem is with getting the materials. I am creating this so that people get to know what equipment to buy in India and how to connect them and make them work.

Problem Statement -

1. Can we automatically water the plants when i am going on vacation or do i have to bother my neighbors? Sometimes the neighbors do too much of watering and the plants end up dying anyway. There are timer based devices available in India which water the soil on set interval. They do not sense the soil moisture and the ambient temperature to know if the soil actually needs watering or not.

2. Can we know if the soil actually needs to be watered? Irregular watering leads to mineral loss in the soil and might end up rotting the plants.

3. Can we manually water the soil from remote location?

Solution -

The answer is "Yes, we can" to all the above problem. The solution provided is simple and economical. It requires you to know little bit of electrical and electronics but i feel it is similar to having so much of electrical knowledge so that you can change a bulb. Let me know if you feel any step is complicated. I will try to add more information so that it becomes easy.

Step 1: Materials Needed

1. Soil moisture sensor - (You can search for similar item on ebay)

2. Small pump - Toy pump working on 5-6V is enough. Few options available in India are - this should not be submerged in water) should be submerged in water)

3. Arduino -

4. Pump Controller - (You can make your own circuit with little knowledge of soldering or you can go to shops who sell these electronic equipment and they can point you to people who can help you to solder)

a) Transistor - 2N2222A

b) Resistor - 1K ohm

5. Drip Irrigation Kit - (You can choose depending on how many plants you want to water).

6. Connecting Pipe (i used 0.4" pipe) to connect the pump and the drip irrigation main line.

Step 2: Connect the Soil Sensor to the Arduino

I have color coded the wires for easy understanding of how to connect the soil sensor with the arduino.

a. Red wire - Connect the Vcc pin on soil sensor to the +5V pin on arduino

b. Green wire - Connect the Gnd pin on soil sensor to the Gnd pin on arduino

c. Orange wire - Connect the A0 (Analog) pin on soil sensor to the A0 (Analog) pin on arduino

Step 3: Connect the Pump Controller Board to the Arduino

The Pump Controller Board comprises of -

1. 1k ohm resistor

2. 2N2222A transistor

3. 5V Pump Motor

Step 4: The Code to Be Uploaded to Arduino

Copy the code from Code.txt to the .ino file on arduino and upload the code to the arduino.

Step 5: Setup the Drip Irrigation Kit

There is enough information on the web on how to setup the drip irrigation kit. I am not getting into details of this.

The point to note here is that there are 6 analog pins on arduino that can be used to sense soil moisture. At the very minimum, one can use the same setup to sense 6 plants. But if designed in a better way, one can use the same setup to sense as many plants in multiple of 6.

I am not going into details of this as this is not the objective of this instructable. I will try to publish another instructable for a better design of the drip irrigation kit so that maximum number of the plant soil moisture can be sensed.

Step 6: Connect the Pump to the Drip Main Line

Step 7: Demonstration of the Full Setup

Step 8: Next Steps

  1. Create an Internet of Plants - Create a IOT framework which will help connect plants of similar variety across the world to get connected.
  2. Connect the arduino wirelessly with the raspberry pi home server so that the plants can be monitored remotely.
  3. Remote Monitoring and Watering of plants - Use GSM based add on board for remote operation
  4. Power Supply - Use solar power as the power need is low. Currently i am using a power bank to power the arduino and the pump motor.
  5. Weatherproof case - Since the device will be used outside, we need to have a weatherproof case to house the electronics.
  6. Add more sensors - Temperature sensor, Humidity sensor.

Do let me know if you think anything else needs to be done as part of this project.

2 People Made This Project!


  • Make it Move Contest

    Make it Move Contest
  • Casting Contest

    Casting Contest
  • Woodworking Contest

    Woodworking Contest

We have a be nice policy.
Please be positive and constructive.



How to check the problem of HIH 4030 soil moisture Sensor.


We are modifying this system to include an Individual pump for each plant with sensors, this way each plant can be sent the water it needs.

I'm also adding a Solar panel to charge a Battery that will operate the pumps.

My current system will include 5 pumps, 2 sensors for each plant, Solar Panel and a Rechargeable battery.

3 replies

how to program solarpannel charge to battery

And we added a Distance Measuring Transducer Sensor to monitor the Water level from our source, this way the pumps don't run if we don't have water.

This is amazing. Will you be updating the instructable with these changes?

The idea is to add the solenoid valve where you have connected the pump to the Arduino in your circuit diagram. Instead of the pump being triggered by the moisture sensors, the input from the sensor would control the solenoid valve. The valve will be connected to the tap. You can leave the tap on since the valve would regulate the flow of water from the pipe
I still need to implement it. Not very good with electronics. Am just learning :)

Instead of using a pump to pump the water, I want to connect the irrigation system directly to the pipe in my kitchen. Is there a stopper that can be used to stop the water flow from the pipe once the soil moisture is in the optimum level? These kind of stoppers are being used in a lot of washing machines. I wanted to know what is the terminology for these stoppers

1 reply

You can use a solenoid valve. I would like to know how your project goes since i have never used this device.

My friends have changed MOISTURE LEVEL from 255 to 550 work with me Try this suggestion and tell me the result

Hi! Can You please explain how the Motor will be used to Pull the Water. The Photo of Motor with Irrigation kit will be more helpful. How the Motor output to connect to pipe for pulling the water.

How to create the Internet of Plants??

Hii sir i want to do this project so what i have to do can u help me sir.

1 reply

Isn't the point of instructables to provide instructions on how to do the project? What part are you stuck on? Do you already have all the hardware?

This is one of the most interesting project. It is very similar to an arduino project "Un Arrosage Automatique". in a french translation , Dunod, Paris, 2011,2013, 2015, "Démarrez avec Arduino" by M Banzi and M Shiloh pp 77-142. I will try to combine the best of the 2 projects and let you know.

We want to make a system able to optimise the individual plant potential in a permaculture environment. Any comment is welcome here or at

Jean Pierre

hii sir i´ḿ doing project in automation of drip irrigation using soil moisture, 12 V relay, 12V solenoid valve, and an LCD. Can u send me the program required to get the output @

will you please send me the complete code at :

it would be nice if u could immediately response


sir i am using a 12 v water pump. so how can i program the arduino or modify your program

@AmitabhS Sir can you share the complete code using Arduino Uno board......

1 reply

Is the code complete? Sir could you mail me the full code . I am a new one to electronics ..... if anyone else has received the code from the author please mail me as soon as possible .

mail me at ... -