Introduction: WATERING SYSTEM - INTRODUCTION
INTRODUCTION & OBJECTIVES:
I is a simple system, using Arduino to automate the irrigation and watering of small potted plants or crops.
This system does the control of soil moisture, doing indications via LEDs and in case of dry soil emitting a alarm beep. In case of dry soil it will activate the irrigation system pumping water for watering plants.
The system uses a LCD display to notify all actions that are taking place and a real time clock.
The Theory (from Wikipedia):
Water content or moisture content is the quantity of water contained in a material, such as soil (called soil moisture), rock, ceramics, fruit, or wood. Water content is used in a wide range of scientific and technical areas, and is expressed as a ratio, which can range from 0 (completely dry) to the value of the materials' porosity at saturation. It can be given on a volumetric or mass (gravimetric) basis.
Volumetric water content, θ, is defined mathematically as:
where is the volume of water and is the total volume (that is soil volume + water volume + air space).
Gravimetric water content[1] is expressed by mass (weight) as follows:
where is the mass of water and is the bulk mass. The bulk mass is taken as the total mass, except for geotechnical and soil science applications where oven-dried soil (, see the diagram) is conventionally used as .
To convert gravimetric water content to volumetric water, multiply the gravimetric water content by the bulk specific gravity of the material.
In soil mechanics and petroleum engineering, the term water saturation or degree of saturation, is used, defined as
where is the porosity and is the volume of void or pore space. Values of Sw can range from 0 (dry) to 1 (saturated). In reality, Sw never reaches 0 or 1 - these are idealizations for engineering use.
The normalized water content, , (also called effective saturation or ) is a dimensionless value defined by van Genuchten[2] as:
where is the volumetric water content; is the residual water content, defined as the water content for which the gradient becomes zero; and, is the saturated water content, which is equivalent to porosity, .
Step 1: HARDWARE & MATERIALS
To accomplish this project, you will need:
1 x Arduino UNO MEGA Duemilanove or Teensy 2.0 +
1 x LCD display with I2C communication
1 x RTC module with I2C communication
1 x Relay Module opto-coupled to 250V/10A
2 x Modules "Driver" LM-393 general purpose
1 x Soil Moisture Sensor (Hygrometer) KDQ11
1 x Water Level Sensor (Homemade)
1 x Buzzer piezoelectric
2 x LEDs - 10mm, Green
1 x LED - 10mm, Red
1 x LED - 10mm, Yellow
4 x Resistors 150 Ohm 1/4 W
1 x Water pump for aquarium, with filter system (127 or 220V)
1 x Electric Power Cable, 127/220VAC - 10Amps
1 x Socket 127/220VAC - 10 Amps
Wires and cables for connections and communication
You can purchase the soil moisture sensor and "Driver" on ebay.
http://www.ebay.com/itm/KDQ11-MOISTURE-SENSOR-KIT-URBAN-GARDEN-TOOL-SOIL-MOISTURE-SENSOR-SCA-1703-/221227848188?pt=LH_DefaultDomain_0&hash=item33823511fc
You can purchase the soil moisture sensor and "Driver" on ebay.
http://www.ebay.com/itm/1-Channel-5V-Relay-Module-Shield-for-Arduino-uno-1280-2560-ARM-PIC-AVR-DSP-/271117672120?pt=LH_DefaultDomain_0&hash=item3f1fdf5eb8
Step 2: COMPONENTS
In the Pictures you have an overview of the components used.
Data from the soil moisture sensor set:
When the soil is dry, the impedance will be high and the LM-393 will show a high value on the output.
When the soil is wet, it will show a low value in the output.
The 3 LEDs range can be defined as:
- Soggy soil - moisture between 0 and 500;
- Wet soil - moisture between 500 and 800;
- Dry soil - moisture between 800-1023;
The module has one digital output and an analog output. (in the project, should be used to analog output)
The water level sensor:
This sensor must be made (homemade) on phenolite board, with spacings of 1 mm between trails and trails with 1 mm of thickness.
Step 3: INTERCONNECTION & DIAGRAM:
Below you have:
1 - a block diagram;
2 - an interconnection diagram (in manuscript);
3 - a wiring diagram;
4 – usability principles
These diagrams are describing the main system interconnections.
You can get the original of this file by accessing the "GOOGLE driver" below:
https://docs.google.com/file/d/0B_YlEklLDDS7SllRMzUyQlhHVDg/edit?usp=sharing
https://docs.google.com/file/d/0B_YlEklLDDS7RkNMZko2ckhLcUU/edit?usp=sharing
https://docs.google.com/file/d/0B_YlEklLDDS7Ym52UE1qcGlqQVE/edit?usp=sharing
https://docs.google.com/file/d/0B_YlEklLDDS7Z3hZY3pNZ0NWZG8/edit?usp=sharing
*********************************************************************************************************************************************
*********************************************************************************************************************************************
Please, fix an error in your "interconnection diagram (in manuscript)" diagram:
The level sensor must be connected to pin A0 of Arduino and the soil moisture sensor must be connected to pin A1 of arduino.
*********************************************************************************************************************************************
*********************************************************************************************************************************************
Description of the main connections:
RTC <-> Arduino:
GND <-> GND
+5 V <-> +5 V
SDA <-> A4
SCL <-> A5
Relay <-> Arduino:
GND <-> GND
+5 V <-> +5 V
IN <-> D7
LCD <-> Arduino:
GND <-> GND
+5 V <-> +5 V
SDA <-> A4
SCL <-> A5
BUZZER <-> Arduino:
+ <-> D2
- <-> GND
LM-393 DRIVER (moisture sensor) <-> Arduino
GND <-> GND
+5 V <-> +5 V
OUT <-> A1
LM-393 DRIVER (water sensor level) <-> Arduino
GND <-> GND
+5 V <-> +5 V
OUT <-> A0
Other Components <-> Function <-> Arduino
Red LED <-> Dry soil <-> D5
Yellow LED <-> Soggy soil <-> D3
Green LED <-> Moist soil <-> D4
Green LED <-> Water Pump <-> D6
Step 4: SOFTWARE & PROGRAMMING:
You can download freely the code for this project in the "GOOGLE driver":
https://docs.google.com/file/d/0B_YlEklLDDS7T3JFX...
Or on the GitHub:
Any problems, questions and suggestions, please send an email to:
arduinobymyself@gmail.com
Step 5: TESTS & ADJUSTMENTS
Below is a picture with an example of how the system works and how the tests should be performed.
Logically, as the system has an hour pre set to operate, you can change the time via software for the time you will do the tests, and after you can adjust the operational "time".
Step 6: VIDEOS & PHOTOS:
Part 1:
http://youtu.be/_jcDxYK33ew
Part 3:
http://youtu.be/Czvxi1r21Zc

Participated in the
Microcontroller Contest
276 Comments
8 months ago
Very good projects for those who start in Hydroponics, however I see that all electronic projects lack a case or cabinet for protection, it is ideal to include them for obvious reasons
4 years ago
If anybody is still interested in this topic I have to say that this sort of moisture sensing has some drawbacks which makes it useless in the scale of months, the sensor is sensing resistance of soil by sending voltage and current over sensor and comparing it by means of LM393 comparator, this makes inherent electrolysis of moist soil, if sensors has made of copper then the sensor itself will be corroded upon the time and even in worst scenario it will make unwanted ions in the soil which are hazardous to the plants in concentrated situation, another drawback is sensor drift which is another pain because of electrolysis of soil again.
also using delay() is not handy in the program since it would make the device slow for using in indoor situation, if device's hanged or stop functioning then you will face with a dried plant, there is no control over that. also screen will use many power and because of working 24/7 its lifespan will decrease dramatically and so many things I cannot remember though.
Here I reprogram it to be faster and more reliable to use in serious application. I have to emphasis it that pins may was changed and new function and pins are added so please check them in the code and don't blame me. also DO NOT FORGET to change sensors with pen graphite, graphite is chemically inactive in comparison with copper and never corrode, so never makes unwanted ions.
if you have any question never hesitate to ask.
you can download below
download_code
download_Libraries
Reply 3 years ago
Hy dear , your code sonds great I will try it as well , is it possible to include a DHT sensor on it ? thanks
Question 3 years ago
Hy guys , Bigdog... This project is amazing . Thank you so much , muito obrigado ....Is it possible to include a Dht11 ( humid and Temperatur sensor) on it ?
Question 3 years ago on Step 4
No program will downloaded
Question 3 years ago
3 years ago on Introduction
Can you make me one
4 years ago
hi, can you launched sensor fluxgate flc100 magnetometr with ardunio and conected to pc wiht bleuthos? thack you very much
Question 4 years ago on Step 4
Bonjour,j'ais téléchargé le code du projet du système d'arrosage. Le logiciel m'indique une erreur que voici : RTC_D1307 RTC cloes not name a type. Il y a t-il une personne qui peux me renseigner
merci .
4 years ago
Votre projet vraiment intéressant. Je vais essayer de faire pour moi aussi. j'espère que vous pouvez m'envoyer le code adruino et la simulation pour proteus pour moi .
rami.hamdi2013@gmail.com
4 years ago
Hi sir...Kindly send me the code to rijwanahmed53012@gmail.com........Thank u sir...Great work
7 years ago
hello....in my watering system project...i have a problem regarding to the lcd display come out weird character when i connect ac source water pump into the cct arduino...
what is the problem actually???
hope u can help me....plesaseeeee...
Reply 6 years ago
my screen showed crazy characters and sometimes even Arduino hanged immediately after relay works, according to this post(https://electronics.stackexchange.com/questions/237688/arduino-16x2-lcd-weird-symbols-after-relay-switch/330632#330632) and some other websites I found it is something about the AC device because when the device was disconnected the relay and other parts would work properly but when the AC device which is a simple Aquarium water pump was connected to test the system in real situation, after relay changes (on and off both), the system goes crazy, I put 6 * 1nF capacitor in parallel (5.6nF totally) to entire system close to the relay between VCC and Gnd of Relay and just one n4148 diode to VCC wire, this diode shows around 110 K resistance with Multimeter. therefore, in any case if there is any back current or emf or Idk anything to interrupt the system, it prevents them all.
thanks to you all for sharing information. hope this helps somebody.
Reply 5 years ago
Hi M.farzad i have the same problem that whenever i activate my 24V DC pump with a relay some weird caracters are showen up on my LCD. Can i get you email so i can ask u something please ?
Question 5 years ago on Introduction
Hi! The project it´s amazing! Do you now if I could do it with a Real Clock Time Module with 5 pins (vcd, gnd, clock, data, rset)? that was the only module that I could find easily.
I would like to know the connection to a0, it is for potentiometer or moisture sensor?
Thank you very much!
5 years ago
Hi sir...Kindly send me the code to sharmilathanicka@gmail.com....Please sir i need it like very immediately....Thank u sir...Great work
5 years ago
Can i get your code , pls help me sir..because my final year thesis is similar to you please send me your code.atengidashetenbibel5@gmail.com
5 years ago
Good day sir ,can i please have the code for your awesome project. i love your project and the system looks very good . my email is ahmad.kargar@yahoo.com
5 years ago
Good day sir ,can i please have the code for your awesome project. i love your project and the system looks very good . my email is ahmad.kargar@yahoo.com
5 years ago
Good day sir ,can i please have the code for your awesome project. i love your project and the system looks very good . my email is Ahmad.kargar@yahoo.com