Auto Plant Watering System





Introduction: Auto Plant Watering System

I had this idea and I realised after that other people had too but thought I'd knock something up from parts I had. I was initially planning this as a how to build it for £5 but in all reality i think this probably comes under that quite easily without any major concessions. I took a photo of the parts I was planning to use but then I decided I would go the prototype route with no soldering so used a breadboard and the appropriate connectors. I don't do this enough really and it saves faf later on by not having to resolder things. I got this up and running really quickly which i was happy with.

I've put a small video showing the design in a little more detail which is included.

Oh and you shall notice I'm actually missing some tubing as I've not had a chance to purchase a tube to run from the water reservoir to the plant pot yet, going to get it this week.

Step 1: Wiring It All Up

I used the following components

  • Arduino Uno (clone)
  • 2 x 220 resistor
  • Red LED
  • Green LED
  • Relay module (link)
  • Soil Moisture sensor (link)
  • 5-6v pump (link)
  • Breadboard
  • Powerbank

The soil moisture sensor was connected to pin 2

The relay module was connected to pin 3

The LED's were connected to pin's 4 and 5

Step 2: Code

The code is quite basic but I've put it on github as i plan to work on this so it's nice to have a common place to hold the code.


Flower Soil Mosture Sensor

D2 - Soil Mosture Sensor

D3 - Relay module

D4:D5 - LEDS 1,2

LED1 - Green

LED2 - Red

Connect the Soil Moisture Sensor to Digital input pin 2 and your 2 led's to digital out 4-5


int moistureSensor = 2;

int relay = 3;

int led1 = 4;

int led2 = 5;

void setup()


// setting the led pins to outputs

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

// setting the Relay pin to output

pinMode(relay, OUTPUT);

// Serial Begin so we can see the data from the moisture sensor in our serial input window.

Serial.begin(9600); }

// the loop routine runs over and over again forever:

void loop()


// read the input on digital pin 2:

int sensorValue = digitalRead(moistureSensor);

// print out the value you read:


digitalWrite(relay, HIGH);

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

if (sensorValue == 1) {

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

digitalWrite(relay, LOW);



// run pump for 10 seconds

Serial.println("Finished watering"); }


// delay 1 second between reads


Step 3: Conclusion

This is an extremely simple design and I plan to expand on it more, possibly looking into using either WiFi via ESP8266 or via radio with a NRF24L01+. The WiFi option has the advantage that I may be able to do away with the arduino then, just need to learn a bit of lua.

I should add my plants don't normally look like that lol, I grabbed a nearly dead plant from outside just to test the sensor with.



  • Epilog Challenge 9

    Epilog Challenge 9
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Science of Cooking

    Science of Cooking

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




how to made this without BreadBoard?


Yes of course that's what i have done in the example.

Thank you for share it . I just done the project it is cool . but I have a question about the finish watering but the run pump about 7or 8 min stop .how can I change finishing watering pump can stop right the way . please email me the info to email : . thanks

Hi !! Thank you for sharing us...I have done this project successfully. I want to improve this project by using a servo.I have components but I haven't enough knowledge. How can I do that? I really appreciate If you can sharing code and wired diagram.( Or any other idea.I'm waiting for your reply ASAP.
Thank you.

Hi the code is in the project and on github, the link for that is above. If you look in the comments you can see the wiring diagram i created, good luck with your project.

Hi Thank you for sharing this project. As astoichkov a circuit diagram would have been useful especially as I would to know whether an arduino uno could control a number of plants with a number of relays and pumps?

Thanks for the feedback guys, i really appreciate it. I've pulled together a quick diagram in fritzing which i've just discovered and have to say it's fantastic!!

I've just done it quickly over lunch so excuse any mistakes, i'll double check when i get home.


Awesome! I have all parts to do this project. I wanted exact the same project for me. Well done! Very happy!

Cool :-) I'm going to modify the code as running for 10 seconds is too long, it can pump a pint of water in that time frame easily so your always going to be running out of water. I think running for a few seconds and then waiting an hour or so before testing as was suggested would be best.

Hi !!! I try to change that but when i modify the 10000 delay the pump doesnt stop before a new soil check :s.