Arduino Plant Watering System

63,774

388

59

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.

Step 1: SHOPPING LIST

Arduino Uno - http://www.ebay.co.uk/itm/UNO-R3-Arduino-Rev3-ATME...

Soil Moisture sensor - http://www.ebay.co.uk/itm/Soil-Sensor-Moisture-Hyg...

Bread board + cables [170 points clear option]- http://www.ebay.co.uk/itm/Solderless-Prototype-Bre...

Cables - [40x male to male 20cm option] - http://www.ebay.co.uk/itm/Dupont-Jumper-Cable-Wire...

More cables - [40x female to female 20cm option] - http://www.ebay.co.uk/itm/Dupont-Jumper-Cable-Wire...

12v pump - https://www.google.com/url?hl=en&q=http://www.ebay...

12v power supply - http://www.ebay.co.uk/itm/DC-12V-LED-Driver-Power-...

Hose for irrigation - http://www.ebay.co.uk/itm/4mm-Car-Van-Vehicle-Wind...

Chocolate block connector (5a) - http://www.ebay.co.uk/itm/Chocolate-Block-Connecto...

Vessel for water - http://www.ebay.co.uk/itm/1L-1000ML-BOROSILICATE-G...

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;

HOW IT WORKS

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.

BACK TO THE PROJECT

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

WARNING - DO NOT RUN THE PUMP DRY, IT WILL DESTROY THE PLASTIC COGS

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.

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Optics Contest

      Optics Contest
    • Plastics Contest

      Plastics Contest

    59 Discussions

    0
    None
    2pax.cruz

    Question 9 hours ago on Step 9

    Hi! What kind of relay do I need to use? Thank you.

    0
    None
    MartinH276

    8 months 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.

    4 replies
    0
    None
    MartinJ125MartinH276

    Reply 6 months ago

    Any solution to this? Anyone else having this issue?

    0
    None
    MartinJ125Jonathanrjpereira

    Reply 4 months ago

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

    0
    None
    AhmedH354

    Question 7 months ago on Step 9

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

    3 more answers
    0
    None
    JonathanrjpereiraAhmedH354

    Answer 4 months 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.

    1
    None
    benrbillAhmedH354

    Answer 6 months ago

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

    0
    None
    sirron1957

    1 year ago

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

    http://www.ebay.com/itm/New-AC-110-240V-To-DC-12V-1-5A-Power-Supply-Adapter-Transformer-For-LED-Strip-US/152337854739?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D555018%26algo%3DPL.SIM%26ao%3D2%26asc%3D41376%26meid%3D544ca6f69355418aac15633b449e0cd3%26pid%3D100005%26rk%3D1%26rkt%3D6%26mehot%3Dpp%26sd%3D172136046487

    2 replies
    0
    None
    Jonathanrjpereirasirron1957

    Reply 4 months 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.

    0
    None
    sirron1957sirron1957

    Reply 1 year ago

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

    s-l1600.jpg
    0
    None
    Jonathanrjpereirawebjoe

    Reply 4 months ago

    120W/360W is a bit overkill. A 9V,1A power supply should be more than enough.

    0
    None
    BodkeyV

    9 months ago

    how to connect it to THINGSPEAK and store and retrieve the data and how to operate it from anywhere

    1 reply
    0
    None
    JonathanrjpereiraBodkeyV

    Reply 4 months ago

    You will need a microcontroller with a WiFi/Ethernet connection.

    0
    None
    SzymonK4

    1 year ago

    Good job! I have some comments:

    1) Is it really nesesery to drive the pump through relay? What about transistor with diode?

    2) Making the measurement every 10sec is surely an overkill. Also, try to keep it silent during night (I suggest using photo resistor)

    3) Maybe you'll use it for different plants.. so try to make moisture threshold adjustable

    Cheers!

    1 reply
    0
    None
    JonathanrjpereiraSzymonK4

    Reply 4 months ago

    1. Always add a Flyback Diode across the Relay's output in order to prevent the Arduino from getting damaged when the pump is switched OFF.

    2. Instead of a Relay you can also use a MOSFET as a switch. Relays having moving parts inside of them & hence are more prone to wear and failure in the long run.

    3. MOSFET or transistor will allow for silent switching.

    0
    None
    ArchinB

    6 months ago

    does the power supply have to be that one or can it be a phone charger as well?