The Development of an Automated Irrigation System Using an Open Source Microcontroller PDF
Document Details
Uploaded by BelovedPyramidsOfGiza
Universiti Teknikal Malaysia Melaka
A. Hassan, W. M. Shah, N. Harum, N. Bahaman and F. Mansourkiaie
Tags
Summary
This paper proposes an automated irrigation system using an Arduino microcontroller for cost-effective and automatic watering of plants. It utilizes a moisture sensor, LCD display, and relay module to control water pump operation based on soil moisture levels. This system is designed for farms and home gardens.
Full Transcript
View metadata, citation and similar papers at core.ac.uk brought to you by CORE The Development of an Automated provided Irrigat...
View metadata, citation and similar papers at core.ac.uk brought to you by CORE The Development of an Automated provided Irrigation System Teknikal by Universiti Using an OpenMelaka: Malaysia SourceUTeM Microcontroller Open Journal System The Development of an Automated Irrigation System Using an Open Source Microcontroller A. Hassan1, W. M. Shah1, N. Harum1, N. Bahaman1 and F. Mansourkiaie2 1 Center for Advanced Computing Technology, Faculty of Information and Communication Technology, Universiti Teknikal Malaysia Melaka, Hang Tuah Jaya, 76100 Durian Tunggal, Melaka, Malaysia. 2 Faculty of Engineering and Applied Science, Memorial University of Newfoundland, St. John’s, Newfoundland A1B3X5, Canada [email protected] Abstract—This paper proposes an automated considered as a critical need in the agriculture irrigation using Arduino microcontroller system sector for future global food security ,. which is cost effective and can be used in a farm or However, continuous increase in demand for in an average home garden. The proposed system is water by domestic and industrial sectors and developed to be automatically watering the plants greater concerns for environmental quality have when the soil moisture sensor detected water created a challenge to every country to reduce insufficiency in the soil by using the Arduino as the farm water consumption while sustaining the center core. The automated irrigation system the fresh food requirement. Consequently, is a fully functional prototype which consists of there is an urgent need to create strategies based a soil moisture sensor; an LCD display to show on science and technology for the sustainable the moisture percentage and pump status; a relay use of water. Industrialist and researchers module which is used to control the on and off are working to build efficient and economic switch of the water pump; and a water pump. automatic systems to control water usage in When the soil moisture sensor senses the dry soil, order to reduce much of the wastage. it will show the moisture percentage on the LCD Irrigation is an artificial application of display, and the relay module will switch on the watering the land for agricultural production. water pump automatically to start the watering The requirement of water for soil depends on process or vice versa. Hardware testing is soil properties such as soil moisture and soil conducted to ensure the proposed system is fully temperature. functional. Effective irrigation can influence the entire growth process and automation in irrigation Keywords—microcontroller; sensor; automated system using modern technology can be used irrigation system to provide better irrigation management. In general, most of the irrigation systems are manually operated. These traditional I. INTRODUCTION techniques can be replaced with automated F resh water is needed for crop and energy production, industrial fabrication as well as human and ecosystem. According to techniques of irrigation to use water efficiently and effectively. Conventionally, farmers must be present in their fields to do irrigation AQUASTAT database, in the year 2010, 69% process. Nevertheless, nowadays farmers need of the total extracted freshwater is used by to manage their agricultural activity along with the agriculture sector, whereas 19% is used other occupations. A sensor based automated by industrial sector and the rest in used by irrigation system provides a promising solution domestic segment. Therefore, water can be to farmers where the presence of a farmer in the farm is not compulsory anymore during the Article history: Manuscript received 12 March 2019; received in process of irrigation. revised form 06 April 201X; Accepted 08 April 2019. ISSN: 2590-3551 eISSN: 2600-8122 Vol. 3 No. 1 April 2019 101 pump supplies water to the plants. In , a smart drip water International Journal of Human and Technology Interaction irrigation system using Raspberry Pi and Arduino is proposed level o for the home automation system. A drip irrigation system for ele makes the efficient use of water where the water is slowly immed Arduino is a flexible programmable hardware II.roots dripped to the METHODOLOGY of the plants through narrow tubes and valves. The water flows from the system can be remotely B. High-l platform and designed to control the circuit A. Functional Requirements controlled via email. Figure 2 logically. Central to the Arduino interface Fig.1 shows a functional block diagram of irrigation sy board is the main component of an integrated the proposed automated irrigation system. It II. METHODOLOGY starts from circuit chip that can be programmed using includes several functional blocks, namely: level of moi A. Functional Requirements Arduino to C++ language –. This micro controller is acquisition block, microcontroller block, Fig.1 shows a functional block diagram of the proposed status of the an AVR type, produced by Atmel firm. The automatic automated functional irrigation system. block, and It includes monitoring several functional to be displa blocks, relay to sign device can read an input, process a program, block. namely: acquisition block, microcontroller block, automatic functional block, and monitoring block. and produce many outputs based on project requirements. In this paper, the development of an automated irrigation system based on Arduino micro controllers is presented. In this system, a soil moisture sensor is used to detect and check the soil humidity of a plant. Based on the soil moisture level from the soil, the system will let the water pump to automatic water the plant when it is too dry and turn off the water pump when the soil of the plant is wet. In the previous works related to the automated watering techniques, it can be Fig. 1. Functional block diagram found that the Arduino based sensors have Fig. 1. Functional block diagram been utilized for the plant watering system Acquisition Acquisition block block – and automated irrigation systems This block consists of one of soilone moisture This block consists soilsensor which moisture –. A number of the automated irrigation takes the data from the soil. It depends on the moisture sensor which takes the data from the soil. system proposed have extended their intelligent level of the soil whether to send high or low voltage to the Itmicrocontroller depends on to the showmoisture level that it is wet of When or dry. the soilthe features such as adapting to weather conditions whether soil is wet,to send it will sendhigh or low the low outputvoltage to the voltage, whereas and. Integrating big data analytics in when it is dry, it willto send the high output microcontroller show that it voltage. is wetThis or forecasting water requirement in an irrigation sensor is directly connected to Arduino microcontroller. dry. When the Microcontroller block soil is wet, it will send the field. low In thisoutput voltage, block, Arduino Unowhereas when it which is the microcontroller is dry,is Fig. 2. T An Arduino Based Automatic Plant itthewill core send hardware theof high output this project. voltage. It receives the This input Watering System is proposed in where the from the soil moisture sensor and processes the input sensor is directly connected to Arduino C. Hardw authors developed the Arduino microcontroller based on the requirement coded in the microcontroller. microcontroller. Figure 3 Automatic Functional Block used to control two functional components proposed sy Microcontroller This block includes block the automated watering function of necessary at which are the moisture sensors and the motor/ the system. In this The automated block, function consists Arduino Uno of twois main the Arduin water pump to automatically water the plant. controlling hardware, which is relay module and DC microcontroller which is the core hardware watering pump. The relay is an automatic electric switch The Ar The moisture sensor’s function is to sense the which of thatthis uses anproject. It receives electromagnet to move thetheswitch inputfromfrom OFF Arduin level of moisture in the soil whereas the water the to ON soilor moisture vice versa. sensor The switch and processes controls the the electric analog pump supplies water to the plants. In , a signal that passes through the water pump. When the power input based on the requirement coded in the smart drip irrigation system using Raspberry moisture level is below the threshold level, Arduino sends The A microcontroller. a signal to the relay module to automatically open the control Pi and Arduino is proposed for the home Automatic Functional path for the electric to passBlock through the water pump to a platf automation system. A drip irrigation system This block includes the automated watering makes the efficient use of water where the ISSN: 2590-3551 function of the system. The automated water is slowly dripped to the roots of the function consists of two main controlling plants through narrow tubes and valves. The hardware, which is relay module and DC water flows from the system can be remotely watering pump. The relay is an automatic controlled via email. electric switch that uses an electromagnet to move the switch from OFF to ON or vice versa. The switch controls the electric signal 102 ISSN: 2590-3551 eISSN: 2600-8122 Vol. 3 No. 1 April 2019 The Development of an Automated Irrigation System Using an Open Source Microcontroller that passes through the water pump. When C. Hardware Requirements the moisture level is below the threshold Figure 3 shows the complete hardware schematic level, Arduino sends a signal to the relay of the proposed system which includes the module to automatically open the path for Arduino board and all the necessary attached the electric to pass through the water pump hardware. to water the plant. After the system detects Arduino Uno Rev3 the sufficient level of the water in the soil, the The Arduino Uno is an open source relay will close the path for electric and thus microcontroller board which based on the the water pump will be stopped immediately ATmega328P architecture. An Arduino pumping the water. board contain 14 digital input/output pins, 6 action (IJHaTI), Vol. 3, No. 1, April 2019 analog inputs, a USB connection, and ICSP B. High-level Design header, a power jack, a 16MHz quartz crystal mart drip Figure water 2theshows plant. the Aftersystem the system architecture detects the of the sufficient and a reset button. The Arduino is the central proposed automatic level of theirrigation water in the system. soil, the relay Fromwill Fig. 2, path close the it core of this project as it controls all the n system for electric is shown thatandthethusprocess the water pumpfrom starts will the be stopped soil hardware that are attached to it. It contains is slowly immediately pumping ubes and moisture sensor. Thethe water. detects the level of sensor a platform for coding when connecting it remotely moisture from the soil, and the measured data B. High-level Design to a computer with a USB cable with a self- isFigure sent 2toshows Arduino to bearchitecture the system processed. Next, of the the automatic download software named Arduino IDE. irrigation system. From Fig. 2, it is moisture level and the status of the DC pump shown that the process Soil Moisture Sensor YL-69 starts from the soil moisture sensor. The sensor detects the from level Arduino of moisture fromis the sent soil,toand thetheLCD screen measured tosent data is beto This sensor is used to detect the moisture displayed. Arduino to be At the same processed. Next,time, the the datalevel moisture willand alsothe level of the soil. When the soil is having proposed status of the to be sent DCrelay pump from Arduinothe to signal is sent to thepump water LCD screen to water shortage, the module output is at high unctional to be displayed. At the same time, the data will also be sent to switch on or off. level, otherwise the output is at low level. r block, relay to signal the water pump to switch on or off. Liquid Crystal Display (LCD) It is a flat panel display that uses light- modulating properties of liquid crystals. The backlight will produce the screen images for showing the content that comes from the coding in the Arduino. In this project, the LCD screen is used to show the moisture level of the soil and the pump status which is set it early in the Arduino board through coding. Relay Module The relay module is a switch that controlled by an electromagnet. It is used to control the on and off of the DC watering pump by opening or closing the electric path that passes to the watering pump. It is controlled or which by the code from the Arduino. moisture DC Water Pump age to the When the The DC water pump used in this project is whereas H-Bridge type. It is used to water the plant age. This by sucking the water from the source and troller. push out the water from the second hole Fig. 2. The system architecture of the Automatic to make the water process complete. It is which is Irrigation Fig. 2. The system architecture of System the Automatic Irrigation System the input controlled by the relay module which can be he input switch on and off automatically based on the C. Hardware Requirements roller. signal sent from the Arduino. Figure 3 shows the complete hardware schematic of the proposed system which includes the Arduino board and all the nction of necessary attached hardware. wo main ISSN: 2590-3551 eISSN: 2600-8122 Vol. 3 No. 1 April 2019 103 Arduino Uno Rev3 and DC The Arduino Uno is an open source microcontroller board ic switch It code is used to the from water the plant by sucking the water from the Arduino. Fig. 4. Hardware implementation for the automatic irrigation system (Top source DC Waterand push Pumpout the water from the second hole to view) make The the water DC Journal process water pump complete. used in and It is controlled this project is H-Bridgebytype. the International of Human Technology Interaction relay module It is used which to water can bybe the plant switch sucking on and the water from off the Fig. 4. Hardware implementation for the automatic irrigation system (Top automatically source and pushbasedout on the the signal water sent fromfrom the Arduino. the second hole to view) make the water process complete. It is controlled by the relay module which can be switch on and off automatically based on the signal sent from the Arduino. Fig. 5. Hardware implementation for the automatic irrigation system (Side view) Fig. 5. Hardware implementation for the automatic irrigation system Fig. 5. Hardware implementation (Side view) for the automatic irrigation system (Side E. The Automated Irrigation view) System Operation This section describes the configuration and the code E. The Automated implementation E. The Automated the Irrigation of Irrigation automatic System irrigationOperation System Operation system. As previously This sectionmentioned, describes the the system starts with the configuration sensor andcodethe This section measures the leveldescribes of moisturethe inconfiguration the soil. and the code implementation implementation of the automatic irrigation In Fig. 5, the code fragment reads the sensor value fromAsthe of the automatic irrigation system. Fig. 3. Schematic for the Automatic Irrigation System previously mentioned, the system starts with the sensor system. soil moisture As sensor. previouslyThe value mentioned, is analog the valuesystem is then measures the level of moisture in the soil. Fig. 3. Schematic for the Automatic Irrigation System convertedwith starts into digital the value either sensor to be used the measures for switching level on of In Fig. 5, the code fragment reads the sensor value from the D. Hardware Implementation the water pump or to be displayed on the LCD screen. The moisture soil moisture code in the sensor.soil. The value is analog value is then fragment converts the upper bound 400 into 100% and D. HardwareFig. 3. Implementation From Fig. 4 and Fig 5, it can be seen that the lowers Schematic for the Automatic Irrigation System converted into digital value either to be used for switching on In Fig. 900or5, From Fig. 4 and Fig 5, it can be seen that the Arduino is the the waterbound pump tothe into be code fragment 0%displayed respectively on thein the LCDlastreads statement screen. theof The Arduino center of this is thewhich system center of this connects all the system required which sensor hardware. the codecode. value fragment from converts the the soil upper moisture bound 400 sensor. into 100% The and D. Hardware Implementation connects The From all the soil moisture Fig. 4 and sensorrequired Fig 5,measures it can be the hardware. seenlevel The soil of moisture that the Arduino isfrom lowers bound 900 into 0% respectively in the last statement of the value is analog value is then converted into the soil, moisture and it is sensor transferred measures to the theArduino level board of to process moisture the code. center of this system which connects all the required hardware. digital value either to be used for switching on and make The soil decision. sensor measures the level of moisture from from themoisture soil, and it is transferred to the Arduino the water pump or to be displayed on the LCD the soil, and it is transferred to the Arduino board to process board and maketo process decision. and make decision. screen. The code fragment converts the upper3 The LCD display shows the value thatISSN: the 2590-3551 bound 400 into 100% and lowers bound 900 into Arduino received from the moisture sensor.ISSN: At 2590-3551 0% respectively in the last statement of the code. 3 the same time, the data acquired is sent to relay ction (IJHaTI), Vol. 3, No. 1, April 2019 module to determine whether to switch on or named offThe theLCDwater display pump. If the shows the valuecondition is required that the Arduino received the water from the moisturepump to Atbetheswitched sensor. same time, on, theacquired the data water is sent attached pipe to relay module to determine to the pump will whether to switch begin on or off to draw up he soil. the water pump. If the condition is required the water pump to the water from the water source output be switched on, the water pipe attached to the pump will beginand push the. water to draw to thewater up the other side from the of water water source pipe to complete and push the water to the other side of water pipe to complete the watering process Fig. 6. Code fragment for sensor reading the watering for the soil. process for the soil. dulating produce The code fragment in Fig. 6 is mainly for comes he LCD the printing of the percentage that is acquired oil and from soil moisture sensor to determine whether o board the soil is wet or dry. The value of the sensor also determines whether to switch the water by an pump on or off. From the code in Fig. 6, it is f of the ric path shown that when the soil moisture percentage by the is below 38%, the water pump will be switch on automatically, and the LCD screen will show ge type. the water pump status is ‘ON’. When the soil Fig. 4. Hardware implementation for the automatic rom the irrigation system Fig. 4. Hardware implementation (Top view) for the automatic irrigation system (Top moisture percentage reaches 47%, the water hole to view) pump will be switch off automatically, and the by the nd off LCD screen will show the water pump status is duino. ‘OFF’. 104 ISSN: 2590-3551 eISSN: 2600-8122 Vol. 3 No. 1 April 2019 soil=map(sensorvalue,400,900,99,0); } sensorvalue=constrain(sensorvalue,400,900); water and see for the wet condition in the serial monitor in soil=map(sensorvalue,400,900,99,0); Step 3: Immersed Arduino IDE too. the soil moisture sensor into a glass of } water and see for the wet condition in the serial monitor in The Development of an Automated Irrigation Arduino Expected System The Using soil IDE an Open too. sensor moisture Source is light Microcontroller up in the controller when Fig. 6. Code fragment for sensor reading Result it is switched on, and it can show the lower and upper Expected The soil moisture boundaries sensorvalue of the sensor is light up in in dry thewet and controller when conditions. Fig. 6. Code fragment for sensor reading The code fragment in Fig. 6 is mainly for the printing of the Result Figure 8 it is switched on, and it can show the lower and upper and Figure 9 show the functionality test for the values forboundaries dry condition of the sensorand value low values in dry and for wet wet conditions. percentage The code fragment in Fig. 6 from that is acquired soil for moisture sensor to moisture sensor. In this test, the the soil functionality moisture sensor determine is mainly the printing of the condition. Figure The 8 and Figure values 9 show of the upper testcaptures boundary for the percentage whether that is the soil is from acquired wet orsoildry.moisture The value of the sensor to high values moisture for sensor.dry In condition this test, and the low soil values moisturefor wet sensor condition. captures sensor alsowhether determines thewhether soil is to switch the The watervalue pumpofonthe or Thefor dryof thecondition are around 893 with 900 determine off. wet or dry. high values values for dryupper boundary condition and lowfor values dry condition for wetare around condition. sensorFrom also the code inwhether determines Fig. 6, itto is shown switch thethat when water pump theonsoil or 893whereas The with 900 values theupper the values of whereas of the theboundary values offorlower the lower dry boundary boundary condition are for for wet around moisture off. Frompercentage the code in is Fig. below6, 38%, the water it is shown that pump when thewillsoil be condition are around 399 with 400. Figure 10 shows the switch on automatically, and the LCD screen will show the 893wet withcondition 900 whereasare the around values of the399lower withboundary 400. Figure for wet moisture percentage is below 38%, the water pump will be moisture condition sensor are functionality around 399 withtest 400.forFigure both 10dryshows and wetthe water 10 shows the moisture sensor functionality test switchpump status is ‘ON’.and on automatically, When the the LCD soilscreen moisturewillpercentage show the condition. moisture sensor functionality test for both dry and wet reaches 47%,status water pump the water pump is ‘ON’. will the When be switch off automatically, soil moisture percentage for both dry and wet condition. and the LCD condition. reaches 47%,screen the waterwillpump show will the water pumpoff be switch status is ‘OFF’. automatically, and the LCD screen will show the water pump status is ‘OFF’. void loop() { void loop()readSensor(); { lcd.setCursor(0,0); readSensor(); lcd.print("Moisture = "); lcd.setCursor(0,0); lcd.print(soil); lcd.print("Moisture lcd.print("%"); = "); lcd.print(soil); lcd.print("%"); if (soil