IoT Automatic Plant Watering System




Introduction: IoT Automatic Plant Watering System

About: Beginner maker who loves stargazing.

Greetings, everyone. Now I am back with new project!!!

This project inspiration came from my guinea pigs. Since I am too lazy to water their beloved wheat grass every day, I decided to make IoT automatic plant watering system which can be controlled through smartphone.

For those who are tired of watering their plants by themselves, congratulations!!!

I recommend this project for people who have just started learning about Internet of Things.

Step 1: Materials and Tools


  1. 8x 3-Way Corner Elbow PVC Fitting Connector (for 1/2")
  2. 4x 245 mm long of 1/2" PVC pipes
  3. 4x 163 mm long of 1/2" PVC pipes
  4. 4x 320 mm long of 1/2" PVC pipes
  5. 1x 200 mm long of 3/8" PVC pipes
  6. 3D Printing parts
  7. GT2 6mm wide belt approximate 1 meter
  8. 1x GT2 20T pulley
  9. 1x GT2 Idler pulley bore 5 mm
  10. 1x M5 x 30mm screw with nut and 2 washers
  11. M3 x 10mm screws
  12. Nylon cable tie
  13. 1x 28BYJ - 48 12V stepper motor
  14. 1x ULN2003 stepper motor driver board
  15. 1x Priming Diaphragm Pump Spray Motor 12V
  16. 1x L298N Dual H Bridge motor driver board
  17. 1x LM2596 step down power module
  18. 1x NodeMCU
  19. 1x 10K ohm resistor
  20. 1x MX1382-02 micro switch
  21. 2x Breadboard 170 holes
  22. Electrical wire
  23. Dupont wire
  24. Heat shrink tubing
  25. 1x DC Jack 5.5x2.1mm DC power female jack connector (I didn't use this part. I use my DIY jack connector)
  26. 12V power adapter
  27. 5/16" Silicone rubber tube approximate 2 meter
  28. 2x 60mm x 60mm 3mm thick acrylic sheets
  29. 1x 80mm x 140mm Coroplast sheet


Basic tools such as screwdrivers, pliers, utility knife, etc. Soldering tools

This project use 3 kind of glues, hot glue, epoxy glue, and epoxy putty.

Step 2: Prepare Your Smartphone and Computer

This is the basic setting up before you can use NodeMCU and Blynk App.

  1. Install Arduino IDE. You can download it from Arduino website
  2. Install Arduino core for ESP8266 WiFi chip. For more information and download, see this GitHub
  3. Install Blynk library for Arduino IDE and download Blynk App for your smartphone. You can find all information on Blynk website

Now, you can enjoy NodeMUC and Blynk!!!

Step 3: Create IoT Automatic Plant Watering System App

  1. Open Blynk App and create a Blynk account if you haven't got one.
  2. Create new project and give it a name ("IoT Plant Watering" for me) then select the hardware to NodeMCU.
  3. Press the "Create" button then you will get Auth Token send to your E-mail. This Auth Token will be use in NodeMCU code.
  4. Add widgets to your project and set up them all (See more details in pictures.)

Now you have an App for controlling your Automatic Plant Watering System!!!

Notes: For more details and information you can check it on Blynk Docs Page. There are really good instructions.

Step 4: Make Watering Tube

  1. Drill 1 mm holes, 20 mm apart from others in 3/8" 200 mm long pipe leaving 40 mm at each end; these holes are water vent.
  2. Drill a 5/16" hole in the middle on the other side of the pipe; the water from the rubber band will pass this hole.
  3. Seal two ends of the pipe with epoxy putty.

Step 5: Prepare Linear Slide Part

Attach the tube to the 3D printed linear slide part with epoxy glue. (see how to attach them together in the pictures)

Other side will be attached in next step.


Step 6: Assembly Frame

  1. Make the base: Attach two 163 mm long tubes and two 320 mm long tubes to four 3-way corner elbows, putting 10 mm of the end of each tube into the 3-way corner elbow. (more details in the pictures)
  2. Make the top part: Attach one 163 mm long and two 320 long tubes to two 3-way corner elbows. (more details in the pictures)
  3. Insert the linear slide part:
    1. Attach the other end of the watering tube to the 3D printed linear slide part WITHOUT GLUE!!!
    2. Insert it into the top part
  4. Finish the top part:
    1. Attach two 3-way corner elbows to one 163 mm long tube.
    2. Attach it to the top part.
  5. Adjust the linear slide part:
    1. Move the linear slide part.
    2. Adjust the frame until the linear slide part moves smoothly.
  6. Secure every joint with hot glue.
  7. Attach the acrylic plates: Attach the acrylic plates to two corners of the top part - the side with the glued linear slide part - with hot glue then secure them with epoxy glue.

Step 7: Assembly 3D Printed Parts

  1. Assembly the GT2 Idler pulley bore holder part: Assembly the GT2 Idler pulley bore holder with GT2 Idler pulley bore 5 mm, GT2 20T pulley, 1x M5 screw, nut, and 2 washers.
  2. Assembly the stepper motor holder part: Attach the stepper motor with GT2 20T pulley, then insert it into the stepper motor holder and secure it with M3 screws.
  3. Attach the belt holder part onto the 3D linear slide part: Attach the belt holder part onto the 3D linear slide part (the glued one) and secure it with epoxy glue.
  4. Attach the GT2 idler pulley bore 5 mm holder to the right platform: Use the belt to make the GT2 idler pulley bore 5 mm holder be in the same line as the belt holder on the right platform, then secure it with hot glue.
  5. Attach the stepper motor holder to the left platform: Use the belt to make the motor holder be in the same line as the belt holder on the left platform, then secure it with hot glue.

See pictures for more details.

Step 8: Add the Belt

Add the belt: Put one side of the belt through the motor and the other side through the pulley. Secure each end on the belt holder with nylon cable ties.

Step 9: Insert Rubber Tube

Insert rubber tube into watering tube, then secure it with epoxy putty.

Step 10: Limit Switch

  1. Cut Dupont wire M-M in the middle.
  2. Solder each wire end with one wire.
  3. Solder one wire end with COM pin and the other with NO pin.

Step 11: Extend Motor Wires

Since the original motor every wire is not long enough, I decide to add more 60cm extra wire to each wire. In order to do that, you need to cut the original wires in the middle and add extra wires, then solder them together and finish the job with heat string tubings.

Step 12: Solder Wires to Pump Motor

Solder two 45 cm long wires to the pump motor.

I used the red wire for the positive anode and the black one for the negative anode.

Step 13: Group Electronic Modules

  1. Cut 80mm x 140mm Coroplast sheet.
  2. My NodeCMU is too big to attach to one breadboard. So, I attach it to two small breadboard instead.
  3. Attach all modules (breadboards with NodeCMU, ULN2003 module, L298N module, and LM2596 module) to coroplast sheet.

Step 14: Wiring

Details in pictures

Notes: Don't forget 10K ohm resister.

Step 15: Install Limit Switch

Attach the limit switch under the motor platform with hot glue. Before sticking it, make sure that the moving part hits the limit switch before the motor platform

Step 16: Neaten

  1. Use nylon cable ties to tie wires with the frame. (See how to arrange each wire in pictures)
  2. Make sure that the rubber tube is long enough to move to further end, then use nylon cable ties to tie it with the frame.

TIPS: You can use the nylon cable ties to neaten wires.

Step 17: Make Circuit Enclosure

I used my lunch (yakisoba) container for the enclosure lol

You can choose your enclosure as you want.

Make holes for I/O ports and put the circuit board in the enclosure.

Step 18: Set Up Water Pump

  1. Make holes on the cover of the enclosure to attach the motor on it by nylon cable ties.
  2. Insert 2 rubber tubes to the motor. One for the water to get in, and the other for the water to go to the watering tube.

Step 19: Done ... But Not Finished

Close the enclosure and arrange and neaten wires.

Step 20: Set and Upload Your Sketch

Before you can upload your sketch to a NodeMCU, you have to set your own parameters.

  1. Open "IoT_Watering_System.ino" using Arduino IDE or another Text Editor. I suggest ATOM. It is a nice text editor for programming and it's Free!!! If you want to write your own sketch, you will love this program.
  2. Enter your Auth Token that you get when you create your IoT Plant Watering project in Blynk App.
  3. Enter a network name that you want to connect and its password.
  4. Save it.
  5. Connect your NodeMCU using the USB cable.
  6. Open your sketch that you have already edited using Arduino IDE.
  7. Select board and port in Tools menu (more setting details in picture)
  8. Click the Upload button.

Now your IoT Automatic Plant Watering Sysem is ready to work!!!

Step 21: Prepare Your Machine

  1. Place your machine where you want.
  2. Place your plant.
  3. Fill the water tank.
  4. Plug in the machine.

Step 22: Prepare Your App

  1. Press the play button to run program.
  2. Press the on timer button. Move the pump power and distance button in order to activate them.
  3. Adjust the pump power and distance until you are satisfied.
  4. Enjoy your more free time you have from not having to water your plant by yourself anymore.


  • You need to redo the second process every time that you restart the program.
  • The first time you set up the machine, you need to press "Test" button with 0 cm distance to move the watering tube to the starting point.

Step 23: One More Thing ...

  • Thank you to my sister who helped me writing these instructions in English.
  • Thank you in advance, to everyone who shares important information about this project to help improve it.
  • Thank you for visitting.

If you like this project, please vote me : ) and follow my Youtube channel.

Invention Challenge 2017

Runner Up in the
Invention Challenge 2017

Internet of Things Contest 2017

Grand Prize in the
Internet of Things Contest 2017

Gardening Contest 2017

Participated in the
Gardening Contest 2017

Be the First to Share


    • Recycled Speed Challenge

      Recycled Speed Challenge
    • Make it Move Contest 2020

      Make it Move Contest 2020
    • Build a Tool Contest

      Build a Tool Contest

    44 Discussions

    Samuel Castañeda
    Samuel Castañeda

    Question 6 months ago on Introduction

    Hey, I start making this amazing project I'm almost done but every time I upload the code I receive this error:
    Arduino: 1.8.11 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:1MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
    Executable segment sizes:
    IROM : 247864 - code in flash (default or ICACHE_FLASH_ATTR)
    IRAM : 27940 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
    DATA : 1304 ) - initialized variables (global, static) in RAM/HEAP
    RODATA : 2212 ) / 81920 - constants (global, static) in RAM/HEAP
    BSS : 25592 ) - zeroed variables (global, static) in RAM/HEAP
    Sketch uses 279320 bytes (26%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 29108 bytes (35%) of dynamic memory, leaving 52812 bytes for local variables. Maximum is 81920 bytes. v2.8
    Serial port /dev/cu.Bluetooth-Incoming-Port
    Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
    File "/Users/samuelabacucastanedasesma/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/", line 65, in <module>
    File "/Users/samuelabacucastanedasesma/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/", line 2890, in main
    File "/Users/samuelabacucastanedasesma/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/", line 483, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

    hope you reply
    Plese help me!!


    Question 1 year ago on Step 20

    hello excuse me , how to make setting to be like yours ? i cannot choose NodeMCU as a board. Hope you reply ASAP. Thank you :)


    Question 1 year ago on Step 21

    Sir, could i get the code to perform the above project. It would be so helpful if you provide me the code!! Please sir!!


    1 year ago

    hello which board did you user for your project

    Orion Maker
    Orion Maker

    Reply 1 year ago

    LoLin ESP8266 Node MCU v0.1 But I think you can pick another newer board or another ESP8266 board.

    Pranav Darshan
    Pranav Darshan

    1 year ago

    Can you send me the circuit diagram to do it without a stepper motor?
    And also let me know the changes in the code.
    Please reply fast.

    Orion Maker
    Orion Maker

    Reply 1 year ago

    Do you mean you want the circuit diagram and the program, for the still automatic plant watering system? For the circuit diagram, you only have to ignore everything that is connected to D2 D5 D6 D7 D8 in the picture in step 14(as image I added) And for program, to be honest, I'm not sure I can edit it correctly in a short time since I wrote this code long time ago so it will take time to recall everything. I will try to edit and comment about the code that you should remove .

    IOT Logo--4nostepper.jpg

    Question 2 years ago on Step 14

    I would like to know the adapter socket connections (3 pins underneath) of where are they connected to... thx

    Orion Maker
    Orion Maker

    Answer 1 year ago

    They connect to L298N(step down power module), ULN2003(stepper motor driver board), and LM2596(Dual H Bridge motor driver board) There are more information in the step 14 pictures

    Feel free to contact me

    Aryam M.R
    Aryam M.R

    2 years ago

    Do you have this some proyect instructions in spanish? please reply me


    2 years ago

    hi i want to construct your project as a graduation project but i want to include moisture (soil ) and temperature sensor and make the watering according to these sensors can you help me and also i saw that there is know arduino in your model so to add the soil sensor and to make the system watering using it do i have to use arduino or not is the nodemcu work as arduino thanks

    Orion Maker
    Orion Maker

    Reply 2 years ago

    Yes! you can add sensor as you wish but you need to modify my program.

    If you want to connect your project to internet, I suggest you use nodemcu, but if not, you can use Arduino instead.

    If you have any questions, feel free to contact me : )


    Reply 2 years ago

    well thanks , i want to add a moisture sensor and show the moisture level on the blynk app m so should i design your same app or it should be a whole different thing , and about the coding should i modify , i am new to coding so any usefull thinks that you can help me modify the codes , thanks

    if its possible write me your email or your facebook account so i can ask you thanks alot

    Orion Maker
    Orion Maker

    Reply 2 years ago

    You can add moisture level on Blynk App by adding Value Display or

    Labeled Value. But I suggest Value Display because it consumes only 200

    energy that limit how many buttons and displays you can

    have. For my program, there are just 400 energy left. You can find more

    imformation about how to use it in Blynk website

    ( I think it is quite a nice manual. Since you said

    you are new to coding, I suggest you see another simple moisture level for learing projects to learn how to write code for moisture sensor, then try to create Blynk app just to show moisture level, and

    combine your program and mine togather.

    PS. Sorry for very delay reply.

    If you have any questions, feel free to contact me : )


    Reply 2 years ago

    hey mr orion our project is almost done i will share it with you in a week the last problem that is facing us is that we added a moisture sensor (TE 215) so we water acoording to it EVERY THING IS GOOD BUT WE WANT TO SHOW THE SENSOR READING on the blynk app how will that be posiible i have searched alot but couldt find the code to do that i already biult the sensor code so its know showing the result on the arduino screen on the pc but i couldnt build the code for the blynk so it show the reading on the phone , any advice , thanks for helping

    Orion Maker
    Orion Maker

    Reply 2 years ago

    I haven't done this before but

    I think you can use virtual pin to send value to Blynk.

    sensorReading = analogRead() ;// Read Value from sensor

    Blynk.virtualWrite(v, sensorReading) ;// v is set to virtual pin as you want.

    Then create Value Display or Labeled Value on Blynk App and set virtual pin as same as in your program.

    For more imformation

    Your project is almost done! Congratulations!


    Reply 2 years ago

    we did it we can send the sensor readıngs notıfıcatıon now its 95% done next thursday we have the fınal presentatıon ö ı wıll share the results wıth u

    Orion Maker
    Orion Maker

    Reply 2 years ago

    That's a good news! I hope your presentation goes well. May the force be with you :)


    2 years ago

    how can i add moisture sensor in ur project??? it 's good btw ;)

    Orion Maker
    Orion Maker

    Reply 2 years ago

    Yes, you can. But you have to modify my preogram.

    If you have any questions, feel free to contact me : )