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

Comments

author
DanielS240 made it!(author)2017-06-19

How may amps does the power supply have?

Best regards,

Daniel

author
GrahamK23 made it!(author)2017-06-13

You can replace the relay with a simple npn transistor, cheaper and no loud 'click' upon switching either. Or if you're really into relays, check out solid state relays. They are just as good with no click either. But, if you measure the current draw of the pump, you could write a bit more code, pulling 4pins on the arduino high, and running them in parallel to the pump. I had a similar pump once that only pulled 60mA and 4 arduino pins can easily handle that. All you need are some capacitors and diodes to eliminate voltage spikes back into the ardiuno. Also to make it safer and cheaper, you might consider using a 12 v 1A wall adapter with a 9mm power jack.

author
Professzore made it!(author)2017-06-18

Not exactly. SSR are commonly using TRIAC to switch, which all have some "drop" current even when off. Furthermore, this kind of switching units is mostly designed to switch AC current, not DC (meanwhile some of them are capable of handling DC, where the switching part is a MOS-FET).
For the "parallel" drive of the motor from pins: also a bad idea.

author
MikeD11 made it!(author)2017-06-13

The Arduino is rated right at 12V. Your supply looks like overkill and is likely right on 12V. Those wall wart supplies say 12v on them but are more likely 15V, danger Will Robinson! The relays switch the pump using 12 volts. If you read about inductive kickback you'd see that when the pump is switched off your 12V could easily go to 20+. Pop goes the Arduino. Add a diode at a minimum, Anode on ground and Cathode on +12V.

author
Palms made it!(author)2017-06-17

I agree. Using 12V for Arduino power will unnecessarily heat up its internal regulator. I'd use either a double power supply (5+12) or two power units.

author
rene-vile made it!(author)2017-06-14

please correct me if im wrong. but these small relay boards usulay have a flyback diode on the board right next to the small transistor used to switch the relay, and i think i can spot the coner of it just behind the dupont connector in the picture at step 9, it is probably a very small glass tube that is orange in one end. but it you are in doubt then it can't hurt to add an extra, if you just want to be safe

author
benrbill made it!(author)2017-06-13

thanks for the advice, its been running pretty happily for about 7 months, but very happy for advice to modify

author
SzymonK4 made it!(author)2017-06-14

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!

author
Bert+Vuylsteke made it!(author)2017-06-12

Really nice Project ! keep up the good work and please keep it as simple as you explained it here. I like that ;)
Btw, do you have a video of your project, in wich we can see it working?

author
benrbill made it!(author)2017-06-13

Thank you! I do, I will get on uploading it this weekend

author
kyleyt made it!(author)2017-06-13

can u send it to me??

author
kyleyt made it!(author)2017-06-13

btw i built it but it just didnt work

author
kyleyt made it!(author)2017-06-13

after that i was so salty that i almost ripped it

author
kyleyt made it!(author)2017-06-13

sort of

author
kyleyt made it!(author)2017-06-13

i think i did something wrong

author
billbillt made it!(author)2017-06-13

PERFECT!!..

author
sirron1957 made it!(author)2017-06-13

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

author
sirron1957 made it!(author)2017-06-13

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

s-l1600.jpg
author
demolishedman made it!(author)2017-06-13

I'm gonna build me one of these. I have some chilli plants (indoor on window sill) which are very fussy about soil moisture so this would take the strain off me and my random waterings. My chilli's thank you. Nice project.

author
benrbill made it!(author)2017-06-13

That's great! This one was made as a prototype for a lager system that could be connected to more plans and a mains water supply via a solenoid, be sure to have a look at lots of other systems and decide what works best for you :)

author
vishalgarg652 made it!(author)2017-06-12

Good one!!

I also made a automatic irrigation system and using it on daily basis to water my lawn.

But i used Raspberry Pi instead of Uno. And also used moisture sensor, relay and a solenoid valve connected with a flow sensor to measure the volume of water used.

Also in addition to this, i integrated the whole setup over Internet using MQTT and now i am able to control it via my mobile phone over internet from anywhere :).

Unlike your design, i am consuming a regular water supply from one of the tap points and connected a Solenoid valve which is controlled by Pi.

But i really like the way you illustrated the whole stuff.

- Vishal

author
benrbill made it!(author)2017-06-13

Nice Vishal! Sounds really cool, do you have any images of the project? This one was made to show a client how a similar system could be implemented at a much larger scale

author
vderm made it!(author)2017-06-12

I hope the plank of wood with the "vessel for water" doesn't go on top of the circuit enclosure. Water + mains wires = danger!

Replace the UNO for an ESP8266, then you get the Internet of Plants! (IoP)

author
benrbill made it!(author)2017-06-13

Thanks for the concern, should have clarified that! The water sits a safe distance from the contents. I made this project as an example for a client on a much larger project of how the system would work :)

author
Maurilio-gm+C.C made it!(author)2017-06-12

Good design. But ... complicated for a single plant, and a whole UNO.

I am building a system based on the lm555 IC, a transistor and a relay, for each sensor / vessel.

I have already done the 12 circuits with 12 relays (11 simple relays for the valves that carry water for each vessel, and I have already done the 12 circuits with 12 relays. An inverter relay that stays on for as long as there is water in the tank The other part of this relay I used for an alarm so that I know the water is gone The alarm is a 12V motor triggering a rotating carnival toy that makes Noise, in plastic.

The 11 pots are self-irrigating type and each plant absorbs according to your needs, depending on the weather (cold, warm or hot - season of the year).

Tomorrow or later I must finish and take the first test.

Ah, the sensors are 3 copper wires, sheldados in the inside of the vessel, in 3 different levels (lower, middle and superior).

Ah, there is a pump that will draw the water from the reservoir and send it to the row of valves, which in turn will open as needed.

The pump relay will be interconnected to the 11 sensors, after the switching transistor, via a 1n4148 diode. Only the first sensor will have 2 switching transistors, with the same signal of pin 3 of the lm555, through 2 resistors (one for the valve and one for the pump).

Circuits were made on standard boards and not on PCI / PCB.

I relied on a single-sense circuit and a single water pump pump relay.

Now all this in English, by Google Translate:

Good design. But ... complicated for a single plant and an entire UN.

I'm building a system based on no lm555 IC, one transistor and one relay, for each sensor / flower pot.

I have already done the 12 circuits with 12 relays (11 simple relays for the valves that carry water for each boat, and I already did the 12 circuits with 12 relays.) An inverter relay that stays on while there is water The tank The other part of this relay I I used it for an alarm so I know the water is gone. The alarm is a 12V motor that triggers a rotary carnival toy that makes noise, made of plastic.

The 11 pots are self-irrigating and each plant absorbs according to your needs, depending on the weather (cold, hot or hot of the year).

Tomorrow or later I must finish and take the first test.

Ah, the sensors are 3 copper wires, sheldados inside the ship, in 3 different levels (inferior, average and superior).

Oh, there is a pump that will draw water from the reservoir and send it to the valve line, which in turn will open as needed.

The pump relay will be connected to the 11 sensors, after the switching transistor, via a 1n4148 diode. Only the first sensor will have 2 switching transistors, with the same signal of pin 3 of the lm555, through 2 resistors (one for the valve and one for the pump).

Circuits were made on standard boards and not on PCI / PCB.

I relied on a one-way circuit and a single water pump pump relay.

Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sites

About This Instructable

17,911views

298favorites

License:

More by benrbill:Fire Cooking ToolsArduino Plant Watering System
Add instructable to: