<figure><img src="image_1.png" /></figure>

HAL
open science

# Design of Integrated Low-Power Irrigation Monitoring Terminal

Hongwu Tian, Mingfei Wang, Jinlei Li

► To cite this version:

Hongwu Tian, Mingfei Wang, Jinlei Li. Design of Integrated Low-Power Irrigation Monitoring Termi-
nal. 9th International Conference on Computer and Computing Technologies in Agriculture (CCTA),
Sep 2015, Beijing, China. pp.255-265, 10.1007/978-3-319-48357-3_25 . hal-01557813

HAL Id: hal-01557813

https://inria.hal.science/hal-01557813

Submitted on 6 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Design of Integrated Low-Power Irrigation Monitoring Terminal

Hongwu Tian<sup>1,a,*</sup>, Mingfei Wang<sup>1,b</sup> and Jinlei Li<sup>1,c</sup>

<sup>1</sup>Beijing Research Center of Intelligent Equipment for Agriculture, Beijing 100097, China

<sup>a</sup>tianhw@nercita.org.cn, <sup>b</sup>wangmf@nercita.org.cn, <sup>c</sup>lijl@cerctia.org.cn

**Abstract.** In order to realize low-cost automatic control of field irrigation and water metering, an integrated low-power irrigation monitoring terminal based on wireless data communication was designed. Powered by battery or solar, the terminal could acquire and store data of sensors and water meters in real-time. Taking valve as control object, the terminal can provide safe irrigation strategy based on multiple control logic, such as data overrun, time and manual operation. The detection of fault on-site and reasonable judgment of irrigation can be carried out by using self-check function, querying of local data and remote data transmission based on GPRS and Modbus Protocol. Experimental results showed that the terminal could work stably, and control irrigation water usage accurately with low power cost.

**Key words:** Field irrigation; Low-power; Multi-control; GPRS; Protect; Fault detection
# 1 Introduction

With continuous growth of population and economic in China, increasing pressure has been placed on the water management and conservation, and continues to drive growing demand for improving water use efficiency for agricultural irrigation and developing water saving technology in China. Irrigation automatic control technology has been widely used, and water-saving agriculture also has become agricultural development strategy for many countries [1]. China tops the list of farmland effective irrigation area in the world. In terms of water-saving automatic control, in the past few decades, China has introduced many advanced equipment and irrigation control system from abroad enterprises, including Eldar-Shanny, RainBird, Hunter, Toro, etc. However, high cost, poor compatibility with the characteristics of domestic irrigation and different user habits restricted its large-scale application [2-4]. Agricultural water-saving information technology research was started in the 1950s and great progress was achieved in China. Intelligent decision control model and control system were constructed based on information fusion technology. Jiangsu University developed winter wheat precise irrigation intelligent system based on fuzzy decision theory; Tianjin Normal University of engineering constructed soil water potential intelligent decision model and support system; National Engineering Technology Research Center for Information Technology in Agriculture developed water-saving irrigation automatic control system, which could realize water pump and valve automatic control[1]. Those systems and applications mentioned above required the users to be professional, which hindered the promoting of information system. The No. 1 central file released by GOV.CN in 2011 put forward “Three Red Line” management system, which made specific limits on water use quantity, water use efficiency and in water pollution in function area. However, the actual situation is that stations for agricultural water information monitoring are concentrated and lack in number, which results in difficulties to accomplish real-time monitoring [5-9]. To some extent, it has limited the development of information technology applied to the agricultural water-saving management.

A low power cost field irrigation control terminal was designed in this paper. Different application mode could be built, and a variety of irrigation control mode, information collection, storage and download function were also developed. Meanwhile, the introduction of simplified menu design, online data query and equipment local online self-check function could greatly help users with the controller useand improv the efficiency of equipment maintenance, which made the developed terminal easier to be promoted.

# 2 Hardware Structure

Considering that the equipment would be practically used in open field, where the stable utility power lines are not available, the terminal was powered by battery or solar. MCU C8051F964 was selected as its core chip, which was a high rate and low power cost single chip microcomputer of high-performance. The sleep-mode power consumption of this chip could be as low as 700nA. A built-in ultra-low power consumption clock provided the equipment with timing awaken resource. Two LDO served as independent power for main chip systems and peripherals. Independent external clock calendar served for equipment basic time and equipment operation. All the peripheral devices, including sensor, solenoid valve control, USB and Bluetooth, GPRS module, LCD display were controlled separately by power switch. Communication part adopted the design of plug and play mode, and also reserved interfaces for standard RS485 BUS and GPRS module, which guaranteed the extending ability for networking functions, data remote transmission and local download function. The framework of the proposed system hardware and picture are shown in Figure 1.
<figure><img src="image_3.png" /><figcaption>Fig. 1. Framework of system hardware and picture</figcaption></figure>

# 3 System Function Design

The function was designed based on the requirements of end user, equipment practical applications and the possible problems that might arise in practical use. The reliability, convenience, protection and fault tolerance were all taken into consideration, in order to improve the performance of the equipment.

## 3.1 Data Acquisition Function

### 3.1.1 Sensor Data Acquisition

Sensor information acquisition, especially the soil moisture [10], is indispensable function in irrigation monitoring and control system. The obtained data can not only reflect real-time measurement of soil moisture, but also can be used as a reference index to guide irrigation control. Considering the particular occasions, there would be a sensor damage or malfunction, especially the short circuit fault. Therefore, in the sensor interface design, power independent control and OCP(Over Current Protection) were used, which meant power was activated only when data sampling happens through each channel and shut down for the rest of time. If voltage or current value over range was detected, the device would automatically cancel the measurements, shut off the power, and prompt error message, such as display hints or text message.

Using the proposed design, it can not only reduce the power consumption of the equipment running status, but also can avoid long time short-circuit fault which might lead to paralysis.

### 3.1.2 Water Meter Data Collection

In view of the increasingly serious situation of water resources and the present situation of the agricultural water inefficient use, in addition to irrigation control, accurate measurement of water consumption is equally important. The water use information can be used to help with water management. The irrigation water use information, including timing of data acquisition, water use accumulation in a certain area, water use accumulation of a specific valve, and the density of water use in different period of time could be analyzed, which could provide the basis for realizing effective water management[11].

The equipment has 4 channels of remote meter signal acquisition interface of impulse type. Using MCU's pulse detection and level matching function, it achieved the real time measurement of water use. The operating principle is: two continuously impulse generated by water meter separately means the preset smallest unit. In practical use, external interference signal jitter could produce continuous single pulse on one signal wire. Low pass filtering in MCU could effectively prevent the happening of such error. Port match level flip function could also prevent the water meter signal from deadlock, which might cause program to enter infinite loop. The combination of both protection procedures could ensure water pulse measurement accurate and reliable.
## 3.2 Record Store and Download

Combined with section 2.1, using nonvolatile memory of external expansion, data record, store and download functions were developed for the logging system. The record types were divided into S (sensor data), T (time water record), and Q (fixed quantity of the water). In order to guarantee the consistency of the data format, fixed-length data package structure was used. Figure 2 shows the data store format.

<table><caption>Fig. 2. Data store format</caption><thead><tr><td>Type</td><td>Year</td><td>Month</td><td>Day</td><td>Hour</td><td>Min.</td><td>Data1</td><td>Data2</td><td>Data3</td><td>Data4</td></tr></thead><tbody><tr><td>1Byte</td><td>1Byte</td><td>1Byte</td><td>1Byte</td><td>1Byte</td><td>1Byte</td><td>HSB&LSB</td><td>HSB&LSB</td><td>HSB&LSB</td><td>HSB&LSB</td></tr><tr><td>W</td><td>0x0E</td><td>0x07</td><td>0x0F</td><td>0x0C</td><td>0x20</td><td>0x00 0x20</td><td>0x10 0x20</td><td>0x01 0x12</td><td>0x00 0x13</td></tr></tbody></table>

History data could be checked locally, and downloaded through USB or Bluetooth. APP based on Android was developed to accomplish data download using smart phone. The maximum data records capacity was 8000, which meant the storage of half a year with saving interval by 30 minutes. All the data could be downloaded within 2 minutes with TXT or EXCEL file format.

## 3.3 Data Communication

Data communication methods included: (1) RS485 bus communication; (2) GPRS wireless network communication.

RS485 communication mode was mainly used for multi-point network by external 433MHz or 2.4GHz wireless data transmission module. Data remote transmission was accomplished based on GPRS or SMS using embedded SIM900A module. In actual use, due to high current consumption GPRS at both starting and running period, SIM900A would be timed to start and connect. At the same time, many problems might lead to net connection failure, including module failure, SIM card error, network instability, default network interruption, server without electricity, and so on. In order to ensure the wireless communication reset function without frequent restarting the module, method by resetting times and reconnection time management was used to save power and ensure the GPRS general communication. The two communication modes both followed industry standard Modbus Protocol [12].

# 4 The Software Design

## 4.1 Task Partitioning

The main task for the software was to accomplish valve control and water management based on different logic. According to the characteristic of time benchmark for the system, the main task was divided into several subtasks, including data acquisition, communication response, key press, calendar update, data storage, updating of operation parameters, and equipment status information display. Time slice polling and software timer mechanism accomplished the main function. Figure 3 shows the main program structure.

<figure><img src="image_4.png" /></figure>
<caption>**Fig. 3.** The main program structure</caption>

The terms in Fig.3 are explained as following:

Control logic: Logical judgment and mission task started according to the user preset mode.

Timing of equipment running: In the main loop, the equipment start flag would be checked regularly and was used to start the counting down timer. Equipment running status would be updated when overflow flag was detected.

Update of equipment status: According to the countdown overflow, equipment running status would be updated, and the latest status of the equipment would be used as the factor for main program logic judgment.

## 4.2 Control Logic

In control logic design, mainstream irrigations control methods were referenced, such as Hunter, Netafim, etc. Meanwhile, combining with the target user demand and domestic use, menu was simplified in order to make less information input by user and reduce the incidence of parameter errors in practical use. Four types of control logic, including transfinite control, timing control, quantitative control and manual control, were accomplished in the design, and protection mechanism was also taken into consideration as supplementary.

### 4.2.1 Sensor Limit Value Control

Control mode based on soil moisture sensor measurements has been widely used in actual irrigation control system and it could help to fill water in time while crop in water stress status. Its disadvantage is that, firstly unrepresentative install position of the sensor will greatly affect the reasonable irrigation. Secondly, sensor fault or damage would lead to decision errors, and serious consequences would happen under the extreme condition.

Aiming at the problems above, we focus on the analysis of sensor failure factors, which might lead to the measured value to be continuous high or low. Reasonable supplement irrigation and, limited irrigation mechanism were designed to avoid excessive and insufficient irrigation happening. According to empirical analysis, relatively low measured value might be caused by the following three factors:

(1) Illogical measure point selection;

(2) Pulling out of sensor;

(3) Sensor damage or disconnection.

The reason that leads to larger measured value may probably lied in:

(1) Illogical measure point selection, such as low-lying place;

(2) Sensor h connection error.

If one of the above two conditions occurs, the changing trends of soil moisture would be like the charts shown in Figure 4 and 5.

<figure><img src="image_5.png" /><figcaption>**Fig.4.** "Defective irrigation" moisture variation trend</figcaption></figure>
<figure><img src="image_6.png" /><figcaption>Fig.5. "Excessive irrigation" moisture variation trend</figcaption></figure>

To solve the problems above, overrun control setting parameters were designed as shown in table 1. Besides the commonly used preset, two additional parameters, 'maximum delay time' and 'daily maximum irrigation quantity', were added. They had higher priority than other parameters. The overrun control parameters are shown in Table 1.

<table><caption>**Tab.1** Overrun control parameters setup list</caption><thead><tr><th>controlling condition</th><th>parameter setup</th></tr></thead><tbody><tr><td>The reference number of sensor(1-4)</td><td>S1</td></tr><tr><td>The reference value (%)</td><td>15.0</td></tr><tr><td>Returned difference (%)</td><td>3.0</td></tr><tr><td>entry condition</td><td>Ultra lower limit</td></tr><tr><td>Maximum delay time(DD)</td><td>02</td></tr><tr><td>The maximum daily amount of irrigation(m³)</td><td>20</td></tr></tbody></table>

The terms in Table 1 are explained as following.

**Maximum delay time:** day was the smallest unit, after overrun irrigation program starting, the timer begins to countdown. If irrigation started again before the overflow of the countdown timer, the timer would reset and restart. If there was no restart during the maximum delay time, forced irrigation would be activated. Through this way, irrigation would start at least one time during the maximum delay time interval and ineffective irrigation caused by larger soil moisture value could be avoided.

**The maximum daily amount of irrigation:** If the sensor measurement was continuous too low to start irrigate and no action is taken, flood irrigation would happen due to the unchanging soil moisture. The maximum irrigation quantity could control the upper limit of daily irrigation water accumulation, which could avoid over irrigation. If no water meter was installed, the actual largest water should be converted to the largest irrigation time.

The two parameters introduced above could offer the protection for fault condition which might result in excessive or defective irrigation, and reduce the extreme damage to the crops.

### 4.2.2 Timing Control

Timing control was one of the most common automatic control irrigation methods, efficient irrigation time could be set in advance, and the system would automatically start the valve and complete the irrigation in the specified time. The advantage of timing control was that irrigation frequency could be guaranteed. However, if the irrigation cycle was too long and dry weather occurs during the time, crop would be withered for water shortage.

In order to solve the problem, 'supplementary irrigation' mechanism was applied to ensure crop hydrate properly in the occasional extremely dry weather conditions, and to reduce the resulting losses. While 'supplementary irrigation' happening, 'the largest irrigation quantity' was also set to avoid over-irrigation in the condition of sensor error occurred.

### 4.2.3 Manual Control Mode
Valve control failure often happens in practical use, and human intervention irrigation is a common practice. Also users do not want the original parameters and scheme to be affected after manual control operation, such as a supplementary irrigation. For example, the user would start manual supplementary irrigation one time in dry weather. Manual control is an effective solution to solve the problems above. It was designed as a "mandatory" irrigation method which had the highest priority. All of the control logic wouldn't be unlocked until the manual control completed. Thus, it could be used in the case of valve failure. Valve could be opened for a short time and left enough time for the user to observe the valve status. Additionally, a forced irrigation time was set in advance for complementary irrigation in a prospective special time. Users do not need to close the valve manually, and the valve would be closed automatically after finishing the preset running time.

The completeness and flexibility of the system would be greatly improved through the combination of manual control, normal control logic and control mode based on priority.

## 4.3 Power Consumption Analysis

Internal timer and external events trigger mode were designed for the system's wake-up function. MCU could be waken-up once per minute by internal real time clock, logic judgment, valve control, data sampling and data transmission task. Key push and water pulse input were two main external wakeup sources. Sleep mode, idle mode, sensors data sampling, valve control, key pressing and GPRS data transmission were the main working statuses of the terminal. The average current consumption calculating equation is written as:

$$I_{av} = I_{mcu} + I_{sam} + I_{ctr} + I_{comm} \quad (1)$$

Where, $I_{av}$ is Average current; $I_{mcu}$ is MCU working current; $I_{sam}$ is Sensor sampling current; $I_{ctr}$ is Valve activating current; $I_{comm}$ is Data transfer current.

$$I_{mcu} = (I_{sl} T_{sl} + I_{act} T_{act})/(T_{sl} + T_{act}) \quad (2)$$

Where, MCU's sleep current $I_{sl}$ is 45µA; Working current $I_{act}$ is 3mA; System was waken up per minute; Work time is 1second; Sleep time is 59 second; Calculation is 110µA.

$$I_{sam} = (N_{times} N_{num} T_{run} I_{run})/(24 \times 3600) \quad (3)$$

Where, $N_{times}$ is Sampling frequency; $N_{num}$ is number of sensors; $T_{run}$ is sampling time; $I_{run}$ is sampling current.

The parameters were set as following: the number of sensors was four; sampling cycle was 500 ms; sampling current was 30mA; sampling interval was in accordance with 30 minutes; the average sampling current sensor was about 34µA.

Assume the number of sensor is four, valve active current is 30mA and switching impulse width is 100ms. If each valve open and closes 10 times a day, according to equation (3), the average current of valve is 3µA. Also assume that the GPRS data transmits twice a day, working current is 60mA, active time is 10s, the average current is 10µA.

Therefore, according to equation (1), the system's average current cost $I_{av}$ is 157µA. If a 9V battery with 1200mA·h is used, considering battery capacity loss and other factors, the actual utilization was calculated as 50%, the equipment continuous working time would be 160 days which means it could be normally used for a complete irrigation season.

## 4.4 Self-Test Mode

Self-test mode was integrated in software, in order to provide the users with intuitive online test information through relatively simple means, and quickly locate fault. The following options show the common test mode options:

(1) Channel data sampling test;

(2) Valve ON-OFF test;

(3) Channel power output test;
(4) GPRS connection test.

Users can enter test mode through menu options, select the test option, then the device enters test procedure automatically, test results or prompt information will be displayed in the LCD. User can preliminary judge fault according to the test result, and communicate with remote staff about the related message with quick fault-locating and propose solutions. It can help to improve the efficiency of device maintenance.

## 5. Conclusion

A low cost field irrigation control terminal is designed in this paper, in order to suit with the agriculture water use situation in China. The highlights of the proposed design are as following.

(1) Low power design based on power management and timing wakeup technology made it possible for the equipment to work for a whole irrigation season with a 9V alkaline battery.

(2) It could not only be used as a water recorder to install on the pipe cooperating with GPRS for data remote transmission, but also as a small irrigation control equipment for automatic irrigation control in a small scale. The provided communication interfaces can be extended to multi-point wireless measurement and control system.

(3) By using simplified control logic based on 'excessive' and 'defective' protection mechanism, the reliability of equipment can be greatly improved. The developed fault location online test function, has greatly improved the efficiency of equipment maintenance.

(4) The records of water use can provide the data base for precise irrigation decision making and water management decision-making.

In general, the developed terminal is simple to install, low cost and with a good practicability and application prospect. However, when using battery as its power, the reliability and stability also need to be improved.
References

1. Zhao Chunjiang, Zheng Wengang. Applications of Information Technologies in Agricultural Water Saving [M]. Beijing: Science Press, 2012: 1-3.

2. An Jinqiang, Wei Kai, Wang Liqian, Song Zengfang. Internet of Things Based Accurate Automation Irrigation[J]. Journal of Northwest A&F University, 2013, 41(12): 220-221. (In Chinese with English abstract)

3. Kranz W L, Evans R G, Lamm F R, et al. A Review of Mechanical Move Sprinkler Irrigation Control and Automation Technologies[J]. Applied Engineering in Agriculture, 2012,28(3): 389-397.

4. Cardenas-Laihacar B, Dukes M D. Soil Moisture Sensor Landscape Irrigation Controller: A Review of Multi-study Results and Future Implications [J]. Transactions of the ASABE, 2012, 55(2): 581-590

5. Zhu Huanli, Ru Zhengbo, Rong Xiaoming. Development of Automatic Control System for Irrigation[J]. Journal of Irrigation and Drainage, 2009, 28(4): 124-126. (In Chinese with English abstract)

6. Xie Shouyong, Li Xiwen, Yang Shuzi et al. Design and Implementation of Fuzzy Control for Irrigating System with PLC. Transactions of the CASE, 2007, 23(6): 208-210. (In Chinese with English abstract)

7. Jiang Ming, Chen Qigong, Yan Xingfang. Precision Irrigation System Based on Fuzzy Control[J]. Transactions of the CASE, 2005, 21(10): 17-20. (In Chinese with English abstract)

8. Chen Zhifang, Song Ni, Wang Jinglei. Water-saving Irrigation Management and Decision Support System[J].

9. Zhang Zenglin, Han Wenting. Application of Automatic Control in Water Saving Irrigation System[J]. Water Saving Irrigation, 2012, (10): 65-68. (In Chinese with English abstract)

10. Wei Hengwen, Chen Xidong, Yin Mingyu. Burying Depth of Soil Moisture Sensors in Intelligent Drip Irrigation System [J]. Journal of Irrigation and Drainage, 2010, 29(4): 16-20. (In Chinese with English abstract)

11. Chen Haorui, Huang Jiesheng, Zeng Gejun, et al. Research on WUA-based & Total Water Quantity Controlled Management Mode of Irrigation Scheme[J]. Journal of Irrigation and Drainage, 2009, 28(4): 14-17. (In Chinese with English abstract)

12. Sun Gang, Zheng Wengang, Zhao Chunjiang, et al. A Wireless Irrigation Control System Based on Modbus Protocol[J]. Water Saving Irrigation, 2009, (10): 60-63. (In Chinese with English abstract)

13. Zhang Junfu, Chen Junqi, Hu Jianfei, et al. Control system of urban green land precision irrigation based on GPRS/GSM and µC/OS embedded technology[J]. Transactions of the CASE, 2009, 25(9): 1-6. (In Chinese with English abstract)

14. Ren Hongy, Ma Xiaoyi, Lin Xxiangyang, et al. Research and Application of Information Transmission Protocol for Irrigation Area Based on GPRS[J]. Journal of Agricultural Mechanization Research, 2010, 32(4): 143-146. (In Chinese with English abstract)

15. Zhang Wei, He Yong, Qiu Zhengjun et al. Design of Precision Irrigation System Based on Wireless Sensor Network and Fuzzy Control[J]. Transactions of the CASE, 2009, 25(S2): 7-11. (In Chinese with English abstract)