Arduino Plant Watering System




This Instructable will explain how to make a plant watering system powered by Arduino. Each of the components is specified with a link to where they can be purchased online. The process of making the system will be detailed step-by-step from the hardware to the code.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.


Arduino Uno -

Soil Moisture sensor -

Bread board + cables [170 points clear option]-

Cables - [40x male to male 20cm option] -

More cables - [40x female to female 20cm option] -

12v pump -

12v power supply -

Hose for irrigation -

Chocolate block connector (5a) -

Vessel for water -

Additionally you will need:

- some wire cutters

- plant pot with hole in bottom for drainage + tray for underneath (if inside)

- plant + 50/50 compost/soil mix

- a stand/base to compile the parts on (possibly piece of 12mm plywood (350 x 200mm - if using a small plant pot this should be okay)

TOTAL COST: £54.31 (note that prices will vary depending on supplier and the country you order within).

Step 2: Wiring the Arduino

This sketch gives an overview of the logic behind the system. The system takes 240v of mains electricity through a step-down converter power supply transforming it to a 12v output. The Arduino is connected to a moisture sensor and relay via a breadboard. The Moisture sensor takes multiple readings from the soil each minute and when the moisture content drops below the pre-set value the relay is triggered sending 12v to the water pump. The power is cut again when the moisture sensor reads a value greater than 70% content.

Step 3: Wiring the Power Supply

This step is specific to the specified power supply. If you have no previous experience of wiring you MUST seek the advice of a qualified professional. 240v is potentially deadly.

POWER IN - Mains Electricity

1. Take the live wire and connect it to the 'L' terminal on the power supply. In the image this is the brown wire.

2. Take the Neutral wire and connect it to the 'N' terminal. Ensure that both are securely connected with none of the copper wire exposed.

POWER OUT - 12v Conversion

1. Connect a brown wire to the V+ terminal.

2. Connect a blue wire to the Com(Neutral) Terminal.

Step 4: Chocolate Block

This component is called a 'Chocolate Block', it is used to take a single wire input and connect it to multiple wire outputs. For this project you need two channels.

1. Wire the brown live wire from the power supply output to one side of the chocolate block.

2. Wire the blue neutral wire from the power supply output to the other channel of the chocolate block.

3. Run two wires of the same colour from the other side of each channel. These steps are best understood when read in conjunction with the image above.

Step 5: Wiring the Arduino

The Arduino is the 'brains' of the system. Follow these steps to wiring it up, it is important that you use the same coloured wire as in my explanation to avoid confusion further down the line.

1. Connect a 'male' red wire to the pin hole marked '5v' leave the the other end disconnected for now.

2. Connect a grey wire to the pin hole marked 'A1' leave the other end disconnected for now.

3. Connect the one of the blue wires running from the chocolate block to the pin hole marked 'GND'.

4. Connect one of the brown wires running from the chocolate block to the pin hole marked 'VIN'.

5. On the other side of the Arduino Board, connect a red wire to the pin hole marked '12v' leave the other side disconnected for now.

Step 6: Wiring the Breadboard

This component is called a breadboard, I elected to use it in this project to save myself and others from having to solder components together. It works like this;


The board is rectangular, place it on the surface you are working on in a portrait orientation. the holes are electrically connected to one another horizontally, but not vertically. This means that you can plug in various pins to the board running horizontally and power will flow through them all in series.


You may find it useful to refer to the sketch at the top of this Instructable in addition to following the written instructions.

In connected series (Horizontally at a portrait orientation) connect the following wires.

1. The '5v' pin that runs from the Arduino board and is currently not connected at the other end. - In this same series connect two more wires of the same colour and leave the other end of the wires disconnected for now.

2. Below take the wire that runs from the 'GND' pin hole on the arduino. Connect another two wires of the same colour to the same line and leave the other end of the wires disconnected for now.

Step 7: Moisture Sensor Module

1. From the breadboard take one of the positive wires (Brown) and connect it to the moisture sensor module

2. From the breadboard take one of the neutral wires (Blue) and connect it to the other second input hole on the moisture sensor module.

Step 8: The Moisture Sensor Itself

From the sensor module in the last step connect two 'female' wires to the other side, run these to the moisture sensor itself. The length of these wires is important for you to decide as it is what will dictate how far the plant can sit from the components on completion.

Step 9: The Relay

This component is called a 'Relay' it is essentially a switch. When the moisture sensor takes a reading that is less that 40% moisture content of the soil the arduino will trigger the relay which sends 12v from the power supply to the water pump.

1. Take the last remaining positive (brown) wire that is connected to the breadboard and connect this to the pin hole on the relay marked 'NC'

2. Take the last remaining neutral (blue) wire that is connected to the breadboard and connect this to the pin hole marked 'NO'

3 On the other side of the Relay connect a red wire to the hole marked 'VCC', a yellow wire to 'GND' and a brown wire to 'INN'

Step 10: The Water Pump


1. Take the positive wire (brown) running from the relay and connect it to one of the pins of the water pump. It doesn't matter which pin you connect it to, however, by changing this around you change the direction that the pump will push the water in.

2. Take the remaining neutral (blue) cable from the chocolate block and connect it to the other pin on the water pump. Ensure that these two cables do not touch as they will spark.

3. Cut the plastic tube in two parts and connect a piece to each end of the water pump, you may also choose to secure the pipe with zip-ties and epoxy. It is extremely important that the pump does not leek given its proximity to live electrical components.

Step 11: Building a Housing for Your Watering System

I built the housing seen in the images from 16mm birch faced ply offcuts from a previous project, you can make the housing however you please. If you choose to stick the components to the housing, ensure that you do not use a conductive adhesive as this will risk short-circuiting the system.

Step 12: Coding the System

The final step is to write the code and upload it to the Arduino. The code seen in the image above works for this system. In essence this code works to take an almost constant moisture content reading. When the reading is below 30% 'humidity real', the relay is triggered, sending 13v to the water pump. The water pump is cut again when the moisture content is read as having risen. You may wish to change this value depending on the plant type, environmental conditions etc.

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    64 Discussions


    Question 4 months ago on Introduction

    Power supplies are sold at a variety of powers and currents. What is the power or current output of the power supply recommended for this project?

    1 answer

    Answer 4 months ago

    Most current-consuming part is pump, so you need to calculate current needed by pump and add a llitle bit for safety and for Arduino. E.g. if you have 6W (so 0,5A) water pump, I think that you don't need power supply with output current bigger than 1A


    1 year ago

    Hi, the problem with the system is that as the arduino is measuring the humidity constantly, i.e. the sensor is "on" all the time, it corrodes within a very short time. By corroding I mean that all the tin from the seor dissolves in the soil in about a week or so.

    5 replies

    Reply 1 year ago

    that doesen't do it for my sensor. i still measure voltage on it, even though no measurements are taken.


    Question 8 months ago on Step 2

    Where do the gray wires connect to in the arduino as the image shows they connect to the same pin.

    Also the code says pin A0 but your instructions say pin A1 what's the deal here?


    Question 9 months ago on Step 2

    Where do the Grey wires connect to in the arduino Uno board?


    Question 1 year ago on Step 9

    Can I change the 40% moisture level to different levels, or is the sensor unalterable?

    3 answers

    Answer 1 year ago

    1. The sensor module does come with a potentiometer. The potentiometer can be adjusted to manually configure the moisture.

    2. You can also change the moisture level threshold in the software by changing the AnalogRead threshold value.


    Answer 1 year ago

    Yes, you can change the moisture value to whatever is best for the plant you are looking for


    2 years ago

    Wouldn't this work for power instead of what you used??

    2 replies

    Reply 1 year ago

    A 9V supply should be enough for both the Arduino(as long as the Arduino's built in voltage regulator is working)& the Pump.


    Reply 2 years ago

    Sorry about that, link didn't display right I'll show it this way instead