Introduction: 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.
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 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.