Automated Watering System

Introduction: Automated Watering System

Ever wanted to keep your precious plants watered and know when they need water, when you are on a vacation or so?

This project uses and Arduino with Ethernet shield, to check the soil moisture level and when to water the plant.
The program measures the moisture level every 3 second and check it it is under a chosen threshold. If it is above, it measures 10 more time at find the mean along with the standard deviation to check if the plant needs to be watered. The current moisture level along with last calculated mean and standard deviation will be send to a web server, so it is possible to follow the plant.

Step 1: Parts List

These are the components needed for the project:

  • 1 x Arduino Uno
  • 1 x Ethernet Shield
  • 1 x RJ45 cable
  • 1 x Breadboard
  • 1 x External power source (9-12V)
  • 1 x MOSFET transistor
  • 1 x Diode
  • 1 x 9V battery
  • 1 x Peristaltic pump
  • 1 x Soil moisture kit (something like this)
  • Jump wires

Note that the different components can be of different types and working range. Make sure that yours work safely together (Though in this case, most does).

Step 2: Circuit Overview

Here is the overview of the system.
Please note that the Arduino and the 9V battery is on common ground.

Step 3: Configure the Program

Download the attached .ino file and open it.
Here you should note 2 key variables.

  • mac[ ]

UPPER_TH is the threshold which decides when the plant gets water. The higher the threshold the dryer the soil. the range goes from 0 to 1023 because of the A/D converter build into the Arduino. This sketch where build for a chiliplant, which does not need to much water. Thus, you might want to lower the threshold according to your plants need.

mac[ ] This is what your MAC adresse is for your Ethernet shield. You should change it to what i printed onto your board. If your board does not have one, simply make one up, as long it is not the same as some other device on you LAN.

Feel free to modify other parts of the program, like the MAX_DEVIATION, WATER_SECor other parts if needed.

Step 4: Configure the Router.

This step can be made into a big one and be a lot different depending on the manufacturer for the router, but i will try to keep it as short and simple as possible.
NB: connect you Arduino with your router and power before proceeding.

  1. Go to your browser and type in your routers IP-adresse (Typically or otherwise use google. The normal log in for a router is name: admin password: admin. Otherwise it should be printed on the router or in the manual.
  2. Go to your LAN settings and find something with DHCP Server and reserver a IP-adresse for your Arduino. You know you are dealing with the right device if your Mac adresse there is the same one found on the Arduino.
  3. Go to your WAN settings and the Port Forwarding settings. Here we port forward the port the Arduino is listing to (12345). Give it a name and select the port to be 12345 and the IP-adresse to be the one we reserved just above.
  4. You might want to disable your Firewall on the router for this to work.
  5. Now go to your browser and type http://"Your Reserved IP":"Port" (e.g. Now you should see the webserver from the Arduino. Now find you WAN IP-adresse (can be done here) and paste that in, instead of your local IP-adresse. Note: Test this on a device that is not connected to your LAN.
  6. Note that something, like double NAT, will make it impossible to see the webserver outside of the LAN.

Step 5: Sum Up

You are now done. Hope it was useful to some, if you have any question will free to leave a comment.
I strongly recommend you to test it for a few days before going on a vacation or so, for safety reasons.

Have a good day and happy watering ;)

Blixt Development

Be the First to Share


    • Frozen Treats Speed Challenge

      Frozen Treats Speed Challenge
    • Electronics Contest

      Electronics Contest
    • Chocolate Challenge

      Chocolate Challenge



    5 years ago


    I'm not able to upload the program to the Arduino when the Ethernet shield is connected....but when I tried it without Ethernet shield I was able to upload but the watering system is not functioning. The connections are done as per the circuit diagram. Can you please help me solve this?

    Blixt Development
    Blixt Development

    Reply 5 years ago

    Hi Swathimurali
    Sorry for the late answer.
    About uploading the program while the Ethernet shield is connected, you should be able to do it if disconnect the shield from the router while the program is uploading.

    If i remember correct the watering system will not work unless it is connected to a router (but I may be wrong). Otherwise try to check some of the following:
    1. Make sure your MAC address is configured to yours.
    2. Make sure that the pump is connected correct and the 9V battery is charged
    3. Try to lay the moisture sensor on the ground to see if it is the Standard Deviation function the keeps it from watering.

    Otherwise try running in connected to the PC and write with the serial connection gives as output.

    Best Regards
    Blixt Development


    5 years ago

    This makes going on vacation so much easier!