Arduino Plant Watering Drip Feed System – Part 2

///Arduino Plant Watering Drip Feed System – Part 2

Arduino Plant Watering Drip Feed System – Part 2

Arduino Plant Watering Drip Feed System

Arduino Plant Watering Soil Humidity MonitoringIn the second part of this project, we will be looking at driving a water pump with the Arduino. Based on the moisture level in the soil, this will allow us to enable watering. Note that this may also be accomplished by a valve. In other words, if your water container is higher than the plant, you can open/close a valve thus releasing the liquid.

Required materials and hardware

Our Arduino Plant Watering system will require several items in the second part. I’ve pre-selected the following items:

Optional Hardware:

Connecting your Arduino Watering System

The connections for the arduino plant watering project are quite simple. You will need to connect the base of the transistor through the current limiting resistor and into the arduino digital pin. The emitter and collector of the BJT are used to toggle the relay. They need to go through the coil. When the coil is energized, the relay will close on the high voltage side. You will need to create a loop with the pump, relay high side and the 12v battery. View my video for detailed instructions on how to build the full circuit. You will have your Arduino watering system running in no time!

Here is the full wiring diagram for the circuit. Note: the humidity sensor itself connects to the red module you can see on the drawing.
Arduino Plant Watering

Programming the relay driver and the pump to turn on based on water level

In this part of the project, we are ready to water our plant. Most of the code is reapplied from part 1; the only difference being the driver for the relay and the condition to water the plant.
int waterPump = 13;
void setup() {
pinMode(waterPump, OUTPUT);
void loop() {
int humidityRaw = analogRead(A0); // 1023 to 0 ===> 0 to 100%
int humidityReal = map(humidityRaw, 1023, 0, 0, 100);
if (humidityReal < 90) { digitalWrite(waterPump, HIGH); }else{ digitalWrite(waterPump, LOW); } }

As you can see, the code is not extremely different than what we had in the first part of the tutorial for the automatic watering system. The major difference is the initialization of the relay pin and the check for the moisture level to be below 90%.


You should now have a fully implemented arduino plant watering system in your house. You can safely leave this running while you are on vacation or travelling. The biggest watch-out for this setup is the fact that a restive sensor will corrode overtime. It can either be replaced or triggered based on a timer which would prolong its life. Lastly, a respectable automatic watering system would have an integrated light system. I'll let you figure that one out.

Make sure to update me with any projects you've built!

Thank you for reading & watching!
- EEEnthusiast

By | 2016-09-23T22:44:20+00:00 January 19th, 2016|Arduino, Tutorials|3 Comments

About the Author:

Welcome to My name is Vlad, I'm an Electrical Engineer and I love to build and teach. I graduated in 2013 and have tried my best to share my electrical knowledge and experience with viewers and readers from all over the world. You can find me on my personal site or LinkedIn!


  1. Jann October 9, 2016 at 8:56 pm

    Hi, i’m new to Arduino. Your work is awesome. Can you email me the full circuit diagram? I would like to try and surely appreciate it very much 🙂

  2. Gina P. Henoguin October 19, 2016 at 12:08 am

    What is the specification need for the diode?

  3. Bradley May 6, 2018 at 6:27 pm

    Is it possible to include the WiFi shield with this for reporting to an RPI to generate a web page and manage multiple watering setups?

Leave A Comment

CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Show Buttons
Hide Buttons