# A Multi-parameter Integrated Water Quality Sensors System

Mingli Li, Daoliang Li, Qisheng Ding, Ya Chen, Chengfei Ge

► To cite this version:

Mingli Li, Daoliang Li, Qisheng Ding, Ya Chen, Chengfei Ge. A Multi-parameter Integrated Water Quality Sensors System. 6th Computer and Computing Technologies in Agriculture (CCTA), Oct 2012, Zhangjiajie, China. pp.260-270, 10.1007/978-3-642-36124-1_32. http-01348107

HAL Id: hal-01348107

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

Submitted on 22 Jul 2016

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_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Multi-parameter Integrated Water Quality Sensors System

Mingli Li¹, Daoliang Li¹,*, Qisheng Ding¹,², Ya Chen¹, Chengfei Ge²

¹College of Information and Electrical Engineering, China Agricultural University, Beijing
100083, P. R. China

²Jiangsu Normal University, Xuzhou, Jiangsu, P. R. China

**Abstract:** Because of the rapid development of aquaculture in China at present, it is more and more urgent to apply hi-tech devices in aquaculture field to guarantee its efficiency. There are already many devices used for monitoring water quality have been developed. However, many of them are only in a step of academic research or too expensive to apply to practices. In this paper, a multi-parameter integrated water quality sensors system which has a practical value based on self-contained design is introduced and the hardware and software of this system are researched and discussed. A test conducted at Taihu Lake in Jiangsu province, China shows that this system can perform well. And this system has many features such as low cost, low consumption, multi-parameter and real-time data upload. The features and good performance above suggest the practical and potential application of the system in water monitoring. And this system still has much space to improve. It may become lighter, more integrated, and more portable in the future.

**Keywords:** water quality monitor, multi-parameter, aquaculture, low consumption

* Corresponding author, Email: dliangl@cau.edu.cn
# 1. Introduction

China has a flourishing aquaculture and the production of it ranks first in the world for many years which occupies above 70% of the world. And output of aquaculture in China is still increasing increasingly [1-2]. Thus aquaculture has made much contribution to development of Chinese agriculture. However, compared to other developed country, aquaculture in China has many weak points such as low efficiency and high consumption due to the low level of technology and management [3]. We still monitor water quality through experience and visual observation. Even though we also sample water for experimental analysis, lacking real-time monitoring and adjustment cause its low accuracy. In addition, experimental test costs much, has a long circle and collects limited data [4]. Water quality is a vital factor in the aquaculture. Short of monitoring of water quality parameters such as pH, Dissolved Oxygen (DO) and temperature can cause the low quality of water. What's more, the problems above may lead to waste of forage, residue of medicine and bacterial reproduction which have big terrible impact to aquaculture of our country. For example, the EU restricted the import of shrimps from China due to the medical residue a few years ago [5]. Therefore the high technology and smart management are important to raise production output and quality, improve productive efficiency, guarantee production safety and achieve sustainable development of aquaculture [6].

There are some researches in this field in China. A plan about a real-time multi-parameter test system is put forward by Zhang Libao from Qingdao University which can monitor four parameters of water quality as pH, temperature, DO(dissolved oxygen), and conductivity continuously in real time [7]. A real-time smart water quality monitoring system is researched by Ma, congguo from Jiangsu University, achieving smart controlling and information sharing in aquaculture. There are also some researches abroad [8]. A Multi-Sensor System is developed by O. Postolache from Portugal which can test turbidity, pH and temperature of water quality [9]. Losordo, Piedrahita and Ebeling from California researched an automated water quality data acquisition system based on self-contained microprocessor. This system can monitor and record weather data and pond environmental data [10]. However, researches and plans inland are often far from perfect and stay in a developing step. They cannot be applied in practice. On the other hand, productions abroad are often
too expensive to afford by common people. Price of a set of foreign monitoring
system can be higher than ¥100,000, thus they are not economical in large scale
aquaculture.

Aiming at problems above, this paper develops a multi-parameter integrated water
quality sensor system which can achieve multiple parameters collection, data
storage and upload. 6 parameters of water quality are considered: pH, dissolved
oxygen(DO), temperature, conductivity, NH3+ and water level which play
important roles in water quality. For example, pH can influence the solubility and
biological availability of water. Short of DO can generate toxic substances in water.
Moreover, suitable temperature and other parameters also contribute to the good
growth of aquatic life.

Each parameter of water quality can be monitored through this system of
aquaculture to make it convenient for people to observe the states of water and adjust
water quality in time to fit the requirements of aquaculture. And this system can
achieve self-identification, self-correction and self-complement. It also has
characteristics as low cost, low consumption, anti-interruption, multi-channel
collection and easy operation.

## 2. Principle and Structure of System

### 2.1. Principle of System

Principle of multi-parameter integrated water quality sensors system is shown in
Fig.1. The whole system can be divided into three layers: Application layer, process
layer and perception layer. Perception layer faces the monitoring objects. Application
layer faces users. And they are connected by process layer.
<figure><img src="image_2.png" /><figcaption>Fig.1 Overall Principal of System</figcaption></figure>

Perception layer is composed of 6 channels of water quality sensors which can collect 6 parameters of water quality. After the layer acquires these parameters and change them into electric signal through transducer, signals are sent to process layer.

Process layer can receive the analog and digital signals and analyze them through MCU msp430. And then MCU has AD conversion on the signals of pH, Dissolved Oxygen (DO), conductivity, NH3+ and use RS-485 to collect signals of temperature and water level. Finally, CPU revises these data by software and transmits them to application layer.

Application layer receives data from process layer. And then it will store these data in the flash and upload them to PC. In the application layer, users can configure and read parameters of sensors and read real-time data of every channel through software Unilog.

## 2.2. Structure of System

Multi-parameter integrated water quality sensors system is shown in Fig.2. The left part shows the appearance of the system and the right part shows the section of system. From these figures we can see that this system is a cylinder, with a hook on its top. PCB is placed at the middle of system. Batteries are put near the top of the system. Sensors and water pump connected with PCB are fixed at the lower place. Signals are collected through sensors from the bottom of the system.
<figure><img src="image_3.png" /><figcaption>Fig.2 Multi-parameter integrated water quality sensors system</figcaption></figure>

# 3. Design of System Hardware

## 3.1. Hardware Structure

Fig.3 shows the hardware diagram of the multi-parameter integrated water quality sensors system. The hardware of system is mainly consist of CPU, sensors, PC, clock module, storage module, power module and water pump.

<figure><img src="image_4.png" /><figcaption>Fig.3 Hardware diagram of system</figcaption></figure>

## 3.1. Design of Circuit

### CPU and storage

Multi-parameter integrated water quality sensors system use MSP430F1612 made by
TI as CPU. This is a mixed signal micro-controller which has 5 low-power modes. Proper clock mode can be chosen according to our real need in order to decrease the energy consumption. It also has rich resources inside, such as timer A, timer B, 12-bit ADC module, Watch dog, 8-bit general I/O. CPU connects the data storage part and parameter storage part through SPI and I2C respectively. Parameter storage part uses chip FM24CL64 with 64k ROM to store parameters of channels, serial ports, communication, dormancy and ADC. Data storage part use chip M23PE80 to store data which are processed by CPU. This chip is a page-erasable serial flash memory with byte-alterability.

## Water Pump

Water pump can wash sensors every day under the control of software, thus to make sure the continuing of service and get rid of trivial human washing work. Circuit of water pump module is shown in Fig.4. It mainly consists of a PMOS and a BJT. Port SP7 connected with I/O of CPU is the enable port. When water pump is working, CPU will give a high level to this port and port POWER+ will get 9.6V to provide water pump with proper working voltage.

<figure><img src="image_5.png" /><figcaption>Fig.4 Wash pump control module</figcaption></figure>

## Power Module

Nickel-Hydrogen Battery is used in this system. It has features of long service life, no pollution and rechargeable capability to meet the requirements of self-contained sensors. The rated voltage of this battery is 1.2V. 8 batteries are used in series, so the output of power module is 9.6V. In order to supply voltage for every module they
need, this system uses an ultra-low dropout regulator LP2981. It has an output tolerance of 0.75% and is capable of delivering 100-mA continuous load current. The output of this chip is 3.3V which supply voltage to CPU, communication module, and storage module. Power module can also charge the battery automatically when the battery voltage is low to guarantee continuing work. In addition, power module provides protect measures to prevent accidents caused by miscellaneous interferences such as excessive voltage and current. In order to protect system from under voltage, 1/4 of battery voltage is input into CPU through port A3. And the voltage of this Pin is monitored every regular interval. Circuit of this voltage monitor module is shown in fig.5 (a). When the voltage is too low, buzzer will ring to give a warning signal. Structure of buzzer module is shown in figure 5(b). BUZ_CTRL is an enable port. CPU controls this module through a BJT.

<figure><img src="image_6.png" /><figcaption>Fig.5 Protection module</figcaption></figure>

Communication Module

This module can realize the exchange of data among PC, CPU and sensors. Sensors and PC are connected to CPU with two serial ports. Through this module, PC can transmit commands to CPU or sensors in order to read and change parameters of every channel and check real-time data. The acknowledge signals are also transmitted to CPU or PC via communication module.

Serial communication is easier and simpler than parallel communication in the microprocessor circuit which has little data throughput. Therefore communication in this system is achieved by chip MAX3485 which is a RS-485/RS-422 serial transceiver. Its transmission rate is high to 10Mbps. The interface between CPU and RS-485 is shown in figure 6. RS485_B- and RS485_A+ are connected with sensors
and 430_URXD1 and 430_URXD1 are connected with CPU.

<figure><img src="image_7.png" /><figcaption>Fig.6 communication module</figcaption></figure>

Moreover, there is also communication between CPU and storage module. The I²C bus protocol is used in communication between FM24CL64 and CPU. This is a serial extended bus, using two-wire system. Every node is linked to clock line SCL and data line SDA and every device has a unique address and independent electrical characteristic which can simplify the structure of circuit. It can realize the modularization and standardization design of circuit system [11]. SPI bus protocol is used in communication between chip M23PE80 and CPU. SPI is serial peripheral interface which is a four-wire system and full duplex. SPI provides programmable clock and have write conflict protection and bus contention protection [12-13].

# 4. Design of System Software

## 4.1 Program Flow

Software of multi-parameter integrated water quality sensors system combining with its hardware realizes the monitoring of 6 parameters of water quality. The main part of software includes initialization module, serial port communication module, ADC module, data storage module and dormancy module as shown in fig.7. Timer interruption and serial port interruption are used to control data collection, monitor and communication task. When there is no task on the go, software can change MCU into dormancy mode. At this time, CPU works in LPM (low-power mode) which is the embodiment of low-consumption.
<figure><img src="image_8.png" /><figcaption>Fig. 7 Main flow of software</figcaption></figure>

## 4.2 ADC Module

ADC module can process the analogy signals from sensors, transferring them into digital value. Timers are used to trigger the ADC task. There are 2 channels of signal need to be AD converted. Before the start of ADC operation of one channel, software will read the information of the channel such as power style, number of channel, address, state of channel and collection style. CPU repeats collection and processing of these 2 channels one by one. Data which have been processed are stored in a TEDS (Transducer Electronic Data Sheet). When all the data of sensors have been stored in the TEDS, the TEDS will be stored in a FLASH. And these data can be read by PC and analysis of water quality can be done according to these data. The flow of ADC module is shown in fig.8:

<figure><img src="image_9.png" /><figcaption>Fig. 8 Flow of ADC module</figcaption></figure>

The step Data adjustment shown in the flow above is used to revise data to more
accurate ones through a mathematical calculation. And the results are given by:

$$y = A(x + B) \qquad (1)$$

Where A and B are coefficients. The default values of A and B are 1.0 and 0.0 respectively. And the real values of A and B vary according to specific applications.

## 4.3 Communication Module

Software of this module can code command frame according to target device address and purpose of instructions. And CRC is used as check code [14]. Later these commands will be sent to PC or sensors by serial ports.

When serial port receives command frames, software can calculate the checksum to judge whether the frame is correct. And then software will analyze command frame to extract address and purpose of the command frame. If the address is not the CPU itself, command frame will be sent to the sensor which has the corresponding address. Finally, command will be implemented in the correct device.

<figure><img src="image_10.png" /><figcaption>Fig.9 Flow of communication module</figcaption></figure>

## 4.4 Dormancy Module

In order to save energy, multi-parameter integrated water quality sensors system is
in dormancy mode when there is no active task. After a circle of operation, CPU mode is changed into LPM. The consumption of CPU in LPM is a thousandth of normal mode. When timer is timed out, CPU will quit LPM and a new circle of operation starts.

# 5. Results and Discussion

## 5.1. Configuration of System Parameters

A multi-parameter integrated water quality sensors system was installed in Yixing, China to test the water quality of Taihu Lake. Sensors connected to main part of system have been put in the water to start to acquire data of 6 water quality parameters. First of all, in order to ensure that data can be collected correctly, every module of software has many parameters to configure. Each device should have a unique address which guarantees that the communication information can be transmitted to right places. Second, time parameters should be configured to ensure that every operation should last proper minutes. Among all the parameters, important ones have been set as Tab.1 below before the beginning of monitoring. They are set by the software Unilog.

Tab.1 shows the basic time relative parameters in each module.

<table><caption>Tab.1 Configuration of time parameters</caption><tr><td colspan="2"><strong>Storage Parameters</strong></td></tr><tr><td>Data storage time interval</td><td>600000ms</td></tr><tr><td>Record start time</td><td>2011-10-10 0:00</td></tr><tr><td>Record end time</td><td>2011-10-17 0:00</td></tr><tr><td colspan="2"><strong>Communication Parameters</strong></td></tr><tr><td>Baud rate of serial ports</td><td>9600B</td></tr><tr><td colspan="2"><strong>Dormancy Application</strong></td></tr><tr><td>Dormancy Circle Time</td><td>60000ms</td></tr><tr><td colspan="2"><strong>ADC Parameters</strong></td></tr><tr><td>ADC measurement time interval</td><td>60000ms</td></tr></table>
<table><tr><td>Battery monitoring time interval</td><td>600000ms</td></tr><tr><td>Frequency for ADC for each channel</td><td>50</td></tr></table>

## 5.2. Responses of Water Quality Sensors

After a one-week monitor, the multi-parameter integrated water quality sensors system has collected lots of information of water quality. Data is collected every 10 minutes, so there are 1008 records have been acquired for each water quality index in a week. Rely on these records, charts which show trends of 4 indexes have been plotted. And they are shown in Fig.10. From curves in these charts, we can analyze the states of water quality parameters as DO, pH, conductivity and NH3-H. Parameter as pH is more stable than the rest. And others as DO and conductivity are changing obviously based on the circle of the day. We can notice that DO concentration is lower than the normal standard from the curve of DO of the fifth day. Thus on these days we should take steps to enhance the content of DO. For example turning on the oxygen enhance machine.

<figure><img src="image_11.png" /><figcaption>Fig.10 Curves of water quality parameters over time</figcaption></figure>

## 6. Conclusion

This paper introduced a procedure of development for multi-parameter integrated
water quality sensors system. This system can monitor water quality to meet the demand of large scale aquaculture and it can be used in practical applications. Because this system can make the monitor operations easier, more effective, and more accurate, it saves much time and money of human in a long term. This method may replace the traditional monitor way which depends on human's observation and takes people much more time for monitoring water quality and cannot obtain precise data. As shown above, this system is able to obtain states of 6 parameters for water quality continuously in humans' absence. And the data of water quality is available on PC in real time. We can get much useful information for estimating water quality based on these responses of sensors. And the result proves that the system works well in practice.

## Acknowledgements

This work was supported by 948 Project of China Agriculture Ministry (2010-Z13). And the programs "Development and Applications of sensor network applied to monitor bloom of blue-green algae in Taihu Lake" (2010ZX03006-006)

## References

1. National Bureau of Statistics of China. China Statistical Yearbook. http://www.stats.gov.cn/tjsj/ndsj/2011/indexch.htm. 2011

2. Yang Jun, He Zhigang. Discussion about current situation of aquaculture and its prospect in China. China Science & Technology Overview. 5,248 (2012)

3. Research group of the Ministry of Agriculture Bureau of fisheries aquaculture. Research of main aquaculture in China [J]. CHINA FISHERIES 2,11-13(2006)

4. Wang Pengxiang, Miao Lei, Zhang Yewei, Tang taolin, Huang jian. On-line water quality monitoring system integration technology in aquaculture. Fishery Modernization 6,18-22(2008)

5. Yu Zhijie, Yang Fengmei. Aquatic disease and pollution-free cultivation. Jiangxi Agriculture Technology. 4,13-15(2003)

6. Li Daoliang, Wang Jianqin, Duan Qinglin, etc. Research of integrated digital aquaculture system.
China science and technology achievements. 2,8-11(2008)

7. Zhang Libao, Online multi-parameter water quality monitoring system[D]. Qingdao. Qingdao University. 2007

8. Ma Congguo, Zhao Dean, Qin Yun, Chen Qianliang, Liu Zhe. Intelligent Monitoring and control for aquiculture process based on field bus. Transactions of Chinese society in agricultural machinery. 38(8),113-115,119(2007)

9. O. Postolache. M. Pereira. H. Ramos. An internet and microcontroller-based remote operation multi-sensor system for water quality monitoring. IEEE Conference Publications. 2, 1532-1536(2002)

10. Losordo, Thomas M. Piedrahita, Raul H. Ebeling, James M. Automated water quality data acquisition system for use in aquaculture ponds. Aquaculture Engineering 7,265-278(1988)

11. Wang Chuhang. Di Qing. Control method of I²C bus memory. Changchun Normal Collage Journal(nature), 27(4),30-32(2008)

12. Long Anguo, Design of FRAM based on SPI bus interface [J].Jishou University Journal(Nature), 29(6),62-64(2008)

13. Zhang Bing, Liu Yu, Rong Jinfeng, IP design and achievement of general SPI bus.China integrated circuit, 20(7),43-47(2011).

14. Luo Yan, Frame error correction in WLAN system using CRC, High technology letters, 14(4),12-15(2004)