This document describes the design of a microcontroller-based automatic home garden watering system. The system uses a soil moisture sensor to detect soil moisture levels and sends signals to an Arduino microcontroller. The microcontroller then controls a water pump to water the plants as needed based on the soil moisture readings. The goal is to develop an affordable and efficient automatic watering system that can help save water, time, and increase plant yields compared to manual watering methods.
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
Â
Microcontroller-Based Automatic Home Garden Watering
1. DESIGN OFA MICRO CONTROLLER BASED AUTOMATICHOME GARDEN WATERING SYSTEM
ABSTRACT
Due to increase incommitments,goingtothe backyard to checkon and water the plantin a garden can
be a tiresome processwhichalsoconsumesalotof time that can be usedforotherpurposes. Insmall
scale home gardening a healthy water balance is essential for high quality yields. Under-watered
plantssufferfromnutrientdeficiencieswhileover-wateredplantsare more susceptible to diseases,
pressure andcan insome cases leadtoroot deaththroughsuffocation.Alsoover-wateredplantsare not
able to withstanddryspellsduringdryseason.
The aim of this project is to use engineering principles and concepts to provide a microcontroller
basedwateringsystem.The systemwill helpinsavingmoneyandwaterand time andalsoat the same
time increasingthe yield.The automatedwateringsystemiscontrolledusing ATmega328
microcontrollerbasedonarduinoplatform.The system isprogrammed via the microcontroller to give
interrupt signal to the watering system (drip, sprinkler,etc) dependingonthe soil moisture levels.
The soil moisture/humidity levelsare checkedusingsoil moisture sensor.Wheneverthere isachange in
moisture/humidityinthe soil thissensorsenses the change andgivesaninterruptsignal tothe micro-
controllerandthusthe wateringsystemis activatedordeactivated.
INTRODUCTION
Water is required for the basic growth and maintenance of plants. When a sufficient amount of
water is not present for plant needs, then stress can occur and the quality of plants will decrease
or die. An automatic watering system is responsible for providing a system that can reduce the
amount of man power needed for watering plant, besides providing a system that makes a plant
grow healthier, as we are able to ensure the plant grows according to the surrounding that favors
their growth. Watering systems can be manual or automatic.
As we know,mostof the gardenersusesmanual systemto watertheirplantinthe gardenand alsoin
the greenhouse. Thissystemisinefficient. Whenwe watermanually,the possibilitytooverwateringis
high.Some plantcan drownwhenwe supplytoomuchwaterto them.
PROBLEMSTATEMENT
There are alreadyautomaticwateringsystemsinthe marketrightnow. Some of these systemsuse PLCs.
The systemdoesnotoperate effectivelysince itirrigatesthe plantaccordingtothe time that has been
setby the user.So sometimesthe plantsreceiveanextraamountof the waterthan it needsand
sometimesis notenough.Sothisautomatedwateringsystemwill water the exact amount of water
that the particular plant needs to grow healthily. Atthe same time,the amountof waterusage can
be reduced.
OBJECTIVES
To develop alowcost,automatedwatering system
Micro-controllerbasedwateringsystem.
2. Highwater efficiencywateringsystem.
Wateringsystemthatsuitable toall typesof plant.
MAIN OBJECTIVES
The system is expected to monitor moisture/humidity levels in the soil and switch on/off the
wateringsystemaccordingtosetmoisture levels.
AIM AND SCOPE
This Project aims to reduce the amount of water used for watering while saving cost. As afore
mentioned in the problem statement about inconsistency of water supply for the irrigation
system, thus there is need for irrigation system that helps to save water. Besides, it also helps to
reduce the man power needed, as the process of watering the plant is now automated.
This Project consists of Arduino Uno as the micro-controller for the auto irrigation system,
moisture sensor, timer, and a LCD screen to display the level of moisture. Suitable controller will
be used to display the moisture level of soil on the LCD screen. The moisture sensor is used to
detect the level of moisture at soil, timer is used to set how frequent the system will water the
plant, and once it start the water the plant as compared to the normal irrigation system that come
without any microprocessor, it will close the valve for watering when optimum level of moisture
is detected in the soil. Hence in that sense, this features help to save water consumption while
watering the plant as compared to system that use timer. Besides that, the LCD enables the
farmer to track the moisture level of soil and can water the plant manually by pressing the
watering button on the interface of the project.
This prototype can be tested for its performance in water the plant in the time desired, and stop
watering when it reach the level of moisture that user desired, and another testing can be made
by determine how much water can it save as compared to the normal version of irrigation system
that using timer.
The limitation of this project itself is that this irrigation project is only suitable for countries like
Zimbabwe but not suitable for country that has 4 seasons. Besides, this system is suitable to most
vegetable plants but not fruit plants as they do not need so much watering, in this case we focus
mainly on vegetable plant hence this make plant farm seldom use irrigation system only
vegetable farm. Lastly this system is only designed for small and middle size of farm.
PROJECT JUSTIFICATION
PROJECT SCOPE
The scope of this project entails the design and implementation of a micro controlled irrigation
system, depending on the soil moisture content. Humidly/moisture sensor will be the input of the
system and an electric water pump will be the output of the microcontroller.
3. PROJECT SUMMARY
In this system, the sensors will be interfaced with ATMEGA 328 microcontroller on Arduino
board. When the humidity sensor senses the input, then it will be sent to the micro
controller. The controller will convert the input into digital and displayed it on the LCD. At the
same time, the controller will send signal to the water pump and give command so that
the pump will open the valve to start the watering process.
In the water pump section, the water source is required to continuously supply the tank,
and the water level in the tank is always full. The source can be the water that is collected from
the rain water and also can be taken from the tab (household water supply). The water in
this system is used to water the plants under the control of the microcontroller which is
programmed to do the watering task. The overall view of the project is show in Figure below;
LITREATURE REVIEW
This chapter will be discussing in depth about the type of irrigationandwateringsystemavailable
across the globe. Thisalsoincludesdifferenttype of microcontrollersthathave beenusedandalso
differenttypesof moisture sensors.
There are alternativeswaystoprovide irrigationsystem.Suchasusingwatersprinkler that will
sprinkle water to the plant according to the timer that have beenset.Thisalternative is not water
efficient.Anothermethodis byimplementingthe technologycalledsupervisorycontrol anddata
acquisition(SCADA) system. Itisa centralizedsystemwhichmeansitisbeingcontrolledbyone central
computer.Thissystemrequiredaunitof computer,programmable logiccontroller(PLC) thatwill be
connected to different equipment, and a communication system between the computer and the
PLC. This system is suitable for a large scale context but verycostlyandbulkyto be put inhouse
area.
Typesof watering
4. Ditch Irrigation
Thisis one of the earliestirrigationmethodstobe used.Ditches/trenchesare dugoutand crops are
plantedalongthe ditchesinrows.
Terrace Irrigation
The land isshapedintosteps.Cropsare plantedonthe flatareas. Waterflowsdownthe steps watering
each of the flat areas. This method is both time and labor intensive in building the terraces.
Drip Irrigation
This isone of the mosteffective andefficientmethodof irrigationaswaterisdrippedatthe crop root
zone.The methodsaveswaterfromrunoff andevaporation.
Sensors
A sensorisa device thatdetectsandmeasuresaphysical quantityfromthe environmentandconverts it
into an electronic signal.The physical quantitycouldbe moisture,temperature,motion,lightorany
otherphysical phenomenon.Examplesof sensorsinclude:oxygensensors,temperature sensors,
infrared sensors, humidly sensors, soil moisture sensors and motiondetectionsensors.The output
of the sensorsisusuallycharge,currentor voltage.
Of interestinthisprojectisthe soil moisture sensor.
Soil moisture sensors
A soil moisture sensor is a device that measures the volumetric water content (VWC) of soil.
MathematicallyVWC,θ,isgivenasfollows;
Equation 2.1 mathematical expressionforVWC
Where:Vwisthe watervolume andVT isthe total volume (soilvolume+watervolume).Soilmoisture
sensorsare classifiedaccordingtohowtheymeasure the soil moisture content.
Soil Moisture calculation
Two methodsare usedindeterminingthe volumetricwatercontent(VWC);directandindirect.The
direct method entails drying a known volume of soil in an oven and weighing it.The direct
methodof measuringVWCisdone usingthe followingmathematical notation:
Equation2.2 soil moisture calculation.
5. Where:
Mwet issoil sample before dryinginthe oven
Mdry is soil sample afterdryinginthe oven
Īw iswaterdensity
Vbis the volume of soil sample before drying
Indirectmethodisbasedoncorrelatingsoil physicalandchemical propertieswithwatercontent.Three
techniques are used in this method namely: chemical titrations, geophysical sensing andsatellite
remote sensing.
Chemical titration determines the moisture loss in sample soil after freeze drying or heating.
Satellite remote sensing uses microwave radiation to check on the difference in dielectric
propertiesof dryandwetsoils.Geophysical sensingusesphysicaldeviceswhichare insertedinthe soil
to determine the soil moisturecontent.Techniquesusedinthismethodinclude:electrical resistance,
electrical conductivity, soil dielectric, soil tension, TDR, FDR, soil capacitance among others.
Typesof soil moisture sensors
Electrical resistance blocksSensorsThese sensors are made up of two electrodes made from a
porous substance like sand ceramic mixture orgypsum.The twoelectrodesare imbeddedinthe soil
duringinstallation.Moisture isallowedtomove freelyinandoutof the sensorselectrodesasthe soil
becomesmoistordriesup. The resistance of the electrodes to the flow current is correlated with
moisture content. Tomeasure this resistance the electrodes are biased (energized) with a dc
voltage and the current flowingthroughthemmeasured. ApplyingOhmâslaw;
R=V/I
Where: R is resistance (Unknown) (âĻ)
V isbiasingvoltage (3.3V to5.0V)
I isthe currentflowingthroughthe electrodes(Amps)
Figure 2.1 homemade soil moisturesensor
6. When the moisture content in the soil is high more current will be allowed to flow thus
indicating low resistance. On the other hand for dry soils the sensor will indicate higher
resistance portrayedbythe low currentreading.
Thistype of sensorischeapand readilyavailable.Electrical resistance blocksSensorscanalsobe readily
assembledfromhome usingtwometal platesorsteel nails.
Electrical resistance blocks Sensors are mostly used in small projects and gardens due to the
disadvantages;
Theyare badlyaffectedbysoil PHandsalinitythusrequiringregularmaintenance
Theyhave lowsensitivity.
The electrodes;especiallywhichprovidesaconstantsource of ions;do not dryat the same rate as the
soil surroundingit
ELECTRICAL CONDUCTIVITYPROBESENSORS
Electrical conductivity probes employ the same principle as the Electrical resistance blocks
Sensors. The one major difference between the two types of sensors is that Electrical
conductivityprobessensorshave theirelectrodes/probesindirectcontactwiththe soil.By definition
electricity is the flow of charges and water in its pure form cannot conductelectricity. The
amount of impurities in water and mineral salts make it polar thus able to conduct electricity.
A large volume of water will mean more ions and thus better electricconduction.Electrical
conductivityprobessensorstakesadvantage of thisphenomenon.The amount of current passing
between the probes is directly proportional to the soil moisture content.Moistsoil allowmore
currentto flowbetweenthe probeswhiledriersoilsonlyallowalittle current to flow between the
probes.Betterconductivityindicates a lower electrical resistance.
Most of the soil moisture sensors currently in the market especially for small projects are
Electrical conductivityprobessensors.Theyhave the followingadvantages.
īˇ Theyare cheap
īˇ Theyare readilyavailable
īˇ Easy to calibrate andinstall
YL-69 Moisture Sensor
Thisis an Electrical resistance Sensor.The sensorismade upof two electrodes.Thissoil moisture sensor
readsthe moisture contentaroundit. A currentis passedacrossthe electrodesthroughthe soil and
the resistance tothe current in the soil determinesthe soil moisture. If the soil hasmore water
resistance will be lowandthusmore currentwill passthrough.Onthe otherhandwhenthe soil
moisture islowthe sensormodule outputsahighlevelof resistance.Thissensorhasbothdigital and
analogue outputs.Digital outputissimple touse butisnot as accurate as the analogue output.
7. Figure YL-69 Sensor
Othertypesof soil moisture sensorsinclude
īˇ Capacitance sensors
īˇ Time DomainReflectometry(TDR) sensors
īˇ Dielectricsensors
īˇ Heat dissipationsensors
īˇ TensiometerSensors
SensorSelection
When deciding on which sensor to use the following factors should be put into consideration:
īˇ Price: Thisis the most importantparameterwhenselectinganycomponent.The price of the
sensor will ultimately affect the price of the whole system as this is one of the major
systemmodules. Sensorwiththe mostcompetitive price shouldbe chosen.
īˇ Power: In anyelectrical systempowerefficiencyiscritical.Moisture sensorwilllow power
consumptionshouldbe selected. Sensors which can be battery powered can be used in
areas withoutelectricityconnection.
īˇ Technology: Technologyusedtodesignsensordictate the sensitivity,costanddurabilityof the
sensors. Most low cost sensors have poor sensitivity, rust and corrode over time.
Resistive orconductive sensorswhichare affectedbysoli salinitythushave ashortlife.
īˇ Shape:Long andslendersensorscanbe usedinmanyapplicationsthanbulkyones.
īˇ Durability:Soil moisture sensorwhichare notaffectedbysoil salinity,corrode orrustshouldbe
selected.Soilmoisturesensorprobesthatmeasure conductivityorresistance shouldbe
avoided,since theywill wearoutovertime.
8. īˇ Accuracy and Linearity: A qualitysoil moisture sensorprobe should give an output which
isproportional to water content over the full output range. In addition,the soil moisture
sensorprobe shouldhave agood outputrange to reduce sensitivitytonoise.
īˇ Voltage Range:Choose asensorthathas a big supplyvoltage range.Poweringasensorwiththe
wrongvoltage will damage the sensororgive inaccurate results.
SensorInstallation
Sensorsorientationandinstallationdependsonthe sensortype,size andshape (īŦat,node,androd).
Installationshouldbe guidedbythe manufacturer'sinstallationmanual.Butingeneral the sensorshould
be installedasclose tothe root area as possible.Onnew fields; the SMS should be installed prior to
planting crops.The sensorshouldbe installedatapproximately3inchesdeep.Forexistingfields
trenchesare dug at uniformintervalsandSMSinstalled.
SENSORCALIBRATION
As isthe case of sensorsinstallation,sensorcalibrationshouldalsobe done inline withthe
manufacturer'sspeciīŦcations.Differentsensorshave differentcalibrationprocedures.Development
stage of the plants roots also determines the SMSs calibration.The soil type andcropswater
requirementsgreatlyinfluencethe sensorscalibration.
YL_69 sensor valuedescription
MAINTENANCE
The technology used to design the sensors determines the regularity of maintenance. Electric
resistance and conductance sensors tend to corrode with time and thus require regular
maintenance and replacement.TDTand TDR (Time DomainReflectometry(TDR) sensors) sensors are
the most stable and durable thusrequiringminimummaintenance
WATER PUMP:
The water pump is used to artificially supply water for a particular task. It can be electronically
controlled byinterfacingittoa microcontroller.Itcanbe triggeredON/OFFbysendingsignalsas
required.The processof artificiallysupplyingwaterisknownaspumping.There are manyvarietiesof
9. waterpumpsused.Thisprojectemploysthe use of asmall waterpumpwhichisconnectedto a H-
Bridge. Figure below showsawaterpump:
The pumpingof wateris a basicand practical technique,farmore practical thanscoopingit upwith
one'shandsor lifting itin a hand-held bucket. This is true whether the water is drawn from a
fresh source, moved to a neededlocation, purified, or used for irrigation, washing, orsewage
treatment, or for evacuating water from an undesirable location.Regardlessof the outcome,the
energyrequiredtopumpwaterisan extremelydemandingcomponentof waterconsumption. All
other processes depend or benefit either from water descending from a higher elevation or
some pressurizedplumbingsystem.
Microcontroller
A microcontrollerisa single onchipcomputerwhichincludesnumberof peripherals likeRAM,EEPROM,
Timersetc.,required toperformsome predefined task.There are differentmicrocontroller families
including: 8051, PIC (Programmable Interface Controller) and AVR.Microcontrollersare usedin
digital applicationsascontrol units.Some microcontrollerscome withtheirin-buildcircuitslike Analog
to digital convertorsordigital toanalogconvertors.Microcontrollersare mostlyprogrammedusing
assemblylanguage butinrecentyearshighlevel
languages like C, C++ PASCAL and java have been used.Highlevel programmingof microcontrollers
bringsthe advantage of not havinga differentprogramforeachmicrocontroller manufacturer. High
level programming is also neat, easy to document and maintain and userfriendly.
Typesof Microcontrollers
8051
These are among the earliermicrocontrollerstobe fabricated.Due tosuperiorityintechnologyinthe
newerversions,veryfewcompaniesstill fabricate 8051.Earliertypesof 8051 have 12 clocks per
instruction whereas the newer versions have 6 clocks per instruction.8051 microcontrollerdoes
not have an inbuiltmemorybusandADC. First8051 microcontrollertobe fabricatedwith Harvard
architecture wasdone in1980 by Intel.
Programmable Interface Controller(PIC)
Programmable Interface Controllersare commonlyreferredtoasPIC.PICsare slightlyolderthan8051
microcontrollers. PICs are preferred to8051 because of their small low pin countdevices. PICs
performbetterandare affordable than8051. The Microchiptechnologyfabricatedthe single chip
10. microcontrollerPICwithHarvardarchitecture.The onlymajordownside of PICisitsprogrammingpartis
verytedious.PICsare hence notrecommendedforbeginners.
AVR:
In 1996, Atmel fabricatedthissinglechipmicrocontrollerwithamodifiedHarvardArchitecture.Thischip
isloadedwith C- compiler and a free IDE. Like PIC,AVRmicrocontrollersare difficult forthe beginners
to workwith.AVRmicrocontrollerhason-chipboot-loaderthusAVRcanbe programmedeasilywithout
any external programmer.[3] AVRcontrollershasnumberof I/O ports, timers/counters, interrupts,
A/D converters, USART, I2C interfaces, PWM channels,on-chipanalogcomparators.
Arduino
Arduinoisan open-source electronicsdesignplatform.The Arduinoboardisspeciallydesigned
for programming and prototyping with Atmel microcontrollers. [5] An arduino interacts with
physical world via sensors. Using arduino; electric equipments can be designed to respond to
change in physical elements like temperature, humidity, heat or even light. [5] This is the
automation process. For example, reading a humidity sensor and turning on and off of an
automaticirrigationsystem.There several typesof arduinoboards.
The open-source Arduino environment allows one to write code and load it onto the
Arduinoboard's memory. The development environment is written in Java and based on
Processing, AVR-GCC, and other open source software. [5] The Arduino programming
language is an implementation of Wiring, a similar physical computing platform, which is
based on the Processing multimedia programming environment. The arduino software is
published as opensource tools, available for extension by experienced programmers. The
language can be expanded through C++ libraries, and people wanting to understand the
technical details can make the leap from Arduino to the AVR C programming language on
whichit'sbased.Similarly,AVR-Ccode canbe added directlyintothe Arduinoprogramsif one
so wishes.[5
Typesof arduinoboards
2.2.3.1 Legacy Versions
ArduinolegacyversionsincludeArduinoNG,Diecimila,andthe Duemilanove.Thesearduinos
use ATMEGA168 chips.Theyrequire manual selectionof eitherUSBor batterypower.[5] For
11. Arduino NG one is required to hold the rest button on the board for a few seconds before
uploadingaprogram onto it.
Figure 2.14 Differenttypesof arduino
ArduinoUno
Thisis the most common arduino type.This arduino type uses ATmega328 AVR microcontroller.
Figure 2.15 Parts of
arduinouno
ATmega328 is more preferreddue tothe followingfeatures:
Have three 8-bitbi-directional I/Oportswithinternal pull-upresistors.[5]
īˇ 32K Bytes of flashmemory.
īˇ 1K BytesEEPROM
īˇ 2K Bytesof RAM
īˇ 2 instructionwords/vector.
īˇ 8-channel 10-bitsuccessive approximationADC
īˇ Programmable Serial USART
īˇ 23 Programmable I/OLines
īˇ OperatingVoltage 1.8- 5.5Ve.t.c
12. ArduinoMega2560
Thisis regardedasan advancementof arduinouno.Ithas more memorythanarduinouno.It has
a total of 54 input pins of which 16 are analog inputs. It has a larger PCB board than arduino.
Overall itismore powerful thanarduinouno.ThisarduinoboardisbasedonATmega2560. [5]
ArduinoLilyPad
Thisarduinoboard isdesignedforwearableapplications.Itisusuallysewnonfabric.Thisboard
requiresthe use of a special FTDI-USBTTL serial programmingcable.ArduinoLilyPadis used
to design"smart"wearable.[5]
ArduinoMega ADK
Thisarduinoboard isspecificallydesignedtointeractwithandroiddevices.
LiquidCrystal Display(LCD)
LiquidCrystal Display(LCD) screenisanelectronicdisplaymodule.AnLCDhas a wide range of
applicationsin electronics. The most basic and commonly used LCD in circuits is the 16x2 display.
LCDs are commonly preferred in display because they are cheap, easy to programme and can
displayawide range of characters and animations.
13. A 16x2 LCD have two display lines each capable of displaying 16 characters.This LCD has
Command and Data registers. The commandregister stores command instructions given to the
LCD while the Dataregisterstoresthe data to be displayedbythe LCD.
Figure 2.17 LCD (16X2)
Whenusing8-bitconfigurationall 8data pins(DB0-DB7) are usedwhile only4data pins(DB4-DB7) are
usedina 4-bitconfiguration.
Automaticswitchingcircuits
In electronicsautomation manytimesthe designerisconfrontedbyasituationwhere he/she hasto
switchveryhighvoltage equipmenton,usingalow voltage circuit.Forexample usinga5v dc voltage,it
ispossible toswitchon/off a230v ac machine.Digital ordiscrete signalsenablesasopposedtoanalog
signalsare used.There are a numberof componentsused in electronicswitchingtoday.
DESIGN ANDIMPLEMENTATION
14. The systemhas three majorparts;humiditysensingpart,control sectionandthe outputsection.The
soil humidity was detected using YL-69 soil sensor (a resistance type sensor).The control unitwas
achievedusingATMega328microcontrollerbasedonarduinoplatform.The outputwasthe control unit
was usedtocontrol the irrigationsystembyswitching itonand off dependingonthe soil moisture
contents.Twostagesof designwere undertaken;hardware andsoftware.
Hardware design
Control Unit:ATMega328 microcontrolleronarduinoplatform
ATMega328 microcontroller on arduino platform was selected the control unit of the
microcontroller.ArduinoUnowasselectedfromthe expansive arduinofamily.ArduinoUnohasa total
of 20 inputspinsof which14 are digital and6 are analoginputs.[5] The digital pinscanbe usedas either
inputsor outputsandalso6 of the 14 pinscan be utilizedasPMW. The board has a 16 MHz ceramic
resonator,a USB connectionanda powerjack.
Figure 3.1 ArduinoUno
In the design of the system analog pins were selected as the arduino input and digital pin was
selectedasthe arduinooutputpins.[5]
Otherimportantpinson the arduinoboardare showninthe table below.
Table 3-1 Important
pinsinarduino
The pinson the arduinowere selectedasshownbelow.
15. Table 3-2 Selected
pinson arduino
SensingUnit:
YL-69 soil moisture sensorconnectiontoarduino
YL-69 soil moisture sensorwasinterfacedtothe arduinothrougha digital aPCB drive.The PCBdrive has
a digital potentiometeranda LM393 comparator. The LM393 comparator isusedto compare the
voltagesacrossthe sensorprobesandthe set Vcc voltage.[7] The digipotisusedtoalterthe sensitivity
of the sensorwhenconnectedindigitalmode.The outof the PCB drive hasfourconnectionspinsas
showninthe table below.
YL-69 PCB pins
The analogue configurationwasselectedasitsmore stable comparedtothe digital configuration.
The PCB drive pinA0 was connectedtothe arduinoanalogpinA0.
16. YL-69 Connectiontoarduinoboard
The outputof the sensorto the arduinoanalogpinA0 was resistance.The resistance toflow of current
between the sensor probes changes with soil moisture level and soil type.The currentpassing
throughthe sensorprobes(Iout) fordifferentsoilsanddifferentsoil moisturelevels wascalculatedas
shownbelow:
Iout= Vcc / {Soil Resistance value(RS)}
Equation3-1 YL-69 Currentcalculation
OutputUnits
LCD interface withArduino
To affectdisplaya16x2 LiquidCrystal Display(LCD) waschosen.LCDpinsD4, D5, D6 and D7 were used
as data linesina 4 bit mode configuration. These pinswere connectedtoarduino 5,4, 3 and 2
respectively.Pin15(A) wasconnectedtoVccand pin16 (K) wasconnectedto GND. These pins(A and K)
are forthe LEDs integratedonthe LCD circuitboard. LCDâs pinE (Enable) wasconnectedtodigital pin11
on the arduinoboard. PinRS (RegisterSelect) onthe LCD was connected to arduino digital pin 12.
R/W pin of the LCD was connected to GND (ground).
The figure belowshowsthe LCD-microcontrollerinterface.
LEDS
17. To indicate the three statesof the soil three LEDswere used.The three LEDs litup dependingonthe soil
moisture content.Whenthe soil wasdryLED connectedtoarduinodigital pin13 was lit. For moistsoil
(requiredcondition)LEDconnectedtoarduinodigital pin12 litup and forsoggysoil LED connectedto
arduinodigital pin11 litup.
The three LEDs were connectedtothe microcontrollerasshownbelow.
Ohmslawwas utilizedto determine the size(inohms) of the protectionresistortobe interfacedwith
the LEDs. From Ohmslaw
Voltage (V) ={Current(I)}*{Resistance(R)}
Where as inour case;
V= Vcc (5V) -Voltage dropacrossLED (selectedLEDshas2.0V)
ILED= LED current (20mA)
VLED = LED Voltage drop(redincolour) (2V)
R= minimumrequiredresistance value
Therefore
Rmin= {(5-2) V}/{20mA} =150 Ί
To achieve currentlimitationaresistance value higherthanthe calculatedRminwasselected.A
220Ί resistorwasusedand thusonly13.6mA currentwas allowedtopassthrough eachof the three
LEDs.
Waterpump connectiontothe Arduino
To implementthe final bitof the automatedirrigationsysteman electricmotor(240VAC) was
selectedasthe waterpump.The firsttwounitsof the systemi.e.sensingunitandthe control unit
18. (microcontroller) are poweredby5VDC. To interface the twounitsa 5VDC relay(SLT73-5D-1Z) was used
as the isolationunit.
The microcontrollerwasconnectedtothe relayviaan NPN transistor(2N4123). To protectthe
transistor;while turningiton,aresistorwasused.The resistorlimitsthe currentflowingthrough
the transistor.Aswas the case withLEDs ohmslaw was usedas shownbelow.
Rmin= (5 â 0.7) V / 40mA = 107.5đē
A resistorof 470đē was selectedandthusthe currentthroughthe transistorwaslimitedto;
4.3V / 470đē =9.12 mA
To protect the microcontroller from back e.m.f during switching a diode was connected across
the relay.The connectionwasas shownbelow.
Program Pseudocode
READ sensorvalue
COMPARE sensorvaluewithsetthreshold
IF sensorvalue>maximumsetvalue
TURN-ON pump
DISPLAYsoil conditiononLCD
19. LIGHT dry soil LED
ELSE IFsensorvalue < maximumsetvalue >minimumsetvalue
TURN-OFFpump
DISPLAYsoil conditiononLCD
LIGHT moistsoil LED
ELSE IFsensorvalue < minimumsetvalue
TURN-OFFpump
DISPLAYsoil conditiononLCD
LIGHT soggysoil LED
PROGRAMFLOW CHART
CONCLUSION ANDRECOMMENDATIONS
CONCLUSION
A system to monitor moisture levels in the soil was designed. The systemwasusedto switch
on/off the watering system/pump according to set soil moisture levels. The control unitthe
20. prototype was implemented using a microcontroller on arduino platform while the sensing bit
was implementedusingaSMSYL-69. Three LEDs and an LCD were usedto implementthe displayof the
three soil statesi.e.soggysoil,moistsoilandthe drysoil states.Toswitchbetweenthe control andthe
irrigationsystemsarelayswitchingcircuitwasused.
RECOMMENDATIONS
īˇ To improve on the effectiveness and efficiency of the system the following
recommendationscanbe put intoconsiderations:
īˇ Cost effective techniques to overcome the limitation of requiring a soil specificcalibration
shouldbe employed.
īˇ Integrating GSM technology can be used, such that whenever the water pump switches
īˇ ON/OFF,anSMS is sentto the concernedpersonregardingthe statusof the pump.
īˇ The pump shouldalsobe controlledviaSMS.
īˇ The system can be integrated with temperature and humidity sensors to monitor the
weatherconditionsinthe farm.
REFERENCES
īˇ MassimoBanzi,GettingstartedwithArduino,SecondEdition,OâReillyMedia,Inc,2011 Francis
Z. Karinaand Alex Wambua Mwaniki, irrigation agriculture in Kenya, Nairobi,Kenya,2011
īˇ Allan Trevennor, Practical AVR Microcontrollers, New York , USA, Springer Science +
BusinessMedia,2012
īˇ Clemmens, A.J. Feedback Control for Surface Irrigation Management, ASAE Publication
04 -90, 1990.
īˇ www.arduino.ccAccessed on6thDec,2013 , 25Th Dec,2013 and 17th Jan,2014
īˇ Songle relayDatasheet
īˇ Soil moisture sensordatasheet
īˇ W. C. Dunn,IntroductiontoInstrumentationSensors,andProcessControl,BritishLibrary
īˇ Cataloguing,2005
īˇ General Purpose TransistorsNPN Silicon(KSP2222A) datasheet
īˇ http://www.vision2030.go.ke/accessedon25th
2014