# A Smart Multi-parameter Sensor with Online Monitoring for the Aquaculture in China

Fa Peng, Jinxing Wang, Shuangxi Liu, Daoliang Li, Dan Xu, Yang Wang

► To cite this version:

Fa Peng, Jinxing Wang, Shuangxi Liu, Daoliang Li, Dan Xu, et al.. A Smart Multi-parameter Sensor with Online Monitoring for the Aquaculture in China. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.444-452, 10.1007/978-3-642-54341-8_46 . hal-01220855

HAL Id: hal-01220855

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

Submitted on 27 Oct 2015

**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 Smart Multi-parameter Sensor with Online Monitoring for the Aquaculture in China

Fa Peng<fnref n="1" />,<fnref n="2" />, Jinxing Wang<fnref n="2" />, Shuangxi Liu<fnref n="2" />, Daoliang Li<fnref n="1" />,<fnref n="3" />,* Dan Xu<fnref n="3" />, Yang Wang<fnref n="4" />

**Abstract.** PH, DO, ORP, EC and water-level are important parameters of the aquaculture monitoring. But the high cost of foreign sensors and high-energy consumption of Chinese sensors make it impossible for wide use in China. This paper uses MCU STM8L152 to realize the ultralow power design. With simple hardware structure design, the cost of the multi-parameter sensor can be reduced. The experiment data of the multi-parameter sensor contrasting with the results obtained by Hach multi-parameter meter, indicates that the sensor is reliable to monitor the water quality with low cost, high efficiency and good precision.

**Keywords:** Multi-parameter, aquaculture in China, Ultralow power, Low cost

## 1. Introduction

From the 1970s, the portable water quality analyzer has been appeared in Japan; the water quality on-line monitoring started to be used in 1980s [1-2]. However, the first water quality monitoring system was used in China in 1988, which was in inadequate due to various reasons: (i) most parts of the system were imported from the oversea; (ii) it was very costly for the maintenance in proper operation; (iii) it didn't adapt to the aquaculture in China.

With the transformation of Chinese agriculture from the traditional way to the modern way, the monitoring of water quality attracts more and more attention of Chinese researchers. For example, Sun has designed the online multi-parameter water quality analyzer; Zhang has finished the research on multi-parameter microsensor array [3-4]. All these things make a great progress of Chinese sensor technology. However, foreign corporations still take control of the sensor-market in China at present; for ion electrode of sensors is very mature and the foreign sensors have higher precision and stability than Chinese sensors. But the high cost made it impossible that foreign sensors or analyzers are used in China widely.

The on-line monitoring has advantages over traditional monitoring approaches such as sampling followed by laboratory analysis; the on-line monitoring can collect the data anytime and help to know the dynamic information of some element real-time.

<footnote n="1">¹Beijing Engineering and Technology Research Center for Internet of Things in Agriculture,
Beijing 100083, China</footnote>

<footnote n="2">²College of Mechanical and Electronic Engineering, Shangdong Agricultural University,
Taian271000, China</footnote>

<footnote n="3">³College of Information and Electrical Engineering, China Agricultural University, Beijing
100083, China</footnote>

<footnote n="4">⁴College of Engineering, China Agricultural University, Beijing 100083, China
dliangl@cau.edu.cn</footnote>
But data collection and management, energy efficiency still exist hindering the long-term using of on-line monitoring [5]. A large variety of faults can impact on data quality, including sensors affected by aging, biofouling or leaking of internal solutions, or simply sensors with bad connections to the data collection device. What's more, sensor networks should be focused on in order to realize the commercialization of multi-parameter sensor.

This paper aims to present a multi-parameter sensor with online monitoring for the aquaculture in China, which makes the real-time monitoring come true with low cost, high efficiency and good precision. The multi-parameter sensor is based on advanced microsensor, microprocessor and smart data acquisition and transfer technology. As a result, pH, dissolved oxygen (DO), electrical conductivity (EC), oxidation-reduction potential (ORP) and water level can be measured.

# 2. System Design

## 2.1 Detection Principle

There are many ways to get the information of water quality; for multi-parameter sensor, ion-selective electrodes and other physical electrodes are applied. So, only the detection principles about ion-selective electrodes and other physical electrodes are introduced here.

Nernst equation is a mathematical description of an ideal pH or ORP electrode behavior [6-8]. It's an important connection between the electric potential difference and the density of the active material in electrochemical system:

$$E = E^0 - \frac{RT}{nF} \ln \frac{a_{i1}}{a_{i2}} \quad (1)$$

Where E is the single electrode reduction potential; E° is the standard electrode reduction potential; T is the absolute temperature (K); R is the universal gas constant: R=8.31 J·mol⁻¹·K⁻¹; n is the number of moles of electrons transferred in the half-reaction; F is the Faraday constant, the number of coulombs per mole of electrons: F = 9.6467×10⁴ C·mol⁻¹; αᵢ is the chemical activity for the relevant species, where αᵢ₁ is the reductant and αᵢ₂ is the oxidant. αᵢ = Cᵢ fᵢ, where Cᵢ is the concentration of species i; fᵢ is the activity coefficient of species i, when Cᵢ is less than 10⁻³ mol·L⁻¹, fᵢ≈1.

At room temperature (25°C), RT/F can be replaced by a constant, then we get Eq.(2):

$$E = E^0 + \frac{0.05916}{n} \lg \frac{a_{i2}}{a_{i1}} \quad (2)$$

Clark electrodes are widely used to monitoring the dissolved oxygen. When an
appropriate polarization voltage is applied on the two electrodes, the dissolved oxygen can come through the polymer film and participate in the reaction at the cathode:

Oxidation at the anode: $4Ag+4Cl^- \rightarrow 4AgCl+4e^-$

Reduction at the cathode: $O_2+2H_2O+4e^- \rightarrow 4OH^-$

Overall reaction: $4Ag+O_2+2H_2O+4Cl^- \rightarrow 4AgCl+4OH^-$

Based on the Faraday's law Eq.(3), the diffusion current is proportional to the oxygen concentration at a certain temperature when the electrode is selected. That means once we get the measured current, the oxygen concentration can be known [9].

$$i = K \times N \times F \times A \times C_5 \times P_m / L \quad (3)$$

Where K is the constant; N is the number of moles of losing electrons in the reaction; F is the Faraday's constant; $P_m$ is the permeability coefficient of the film; L is the thickness of the film; A is the cathode area; $C_s$ is the oxygen partial pressure(dissolved oxygen concentration) in the sample[10-11].

The measurement of electrode conductivity is based on the principle of electrolytic conduction. When electrodes are immersed in the solution with appropriate voltage, positive and negative ions in solution will move along the direction of electric field, which makes the solution become the conductor. The electric capability of conductor can be demonstrated by conductance or conductivity. The relationship between conductance (G) and conductivity (σ) is expressed by Eq.(4):

$$G=1/R=s/(\rho \cdot l)=\sigma \cdot s/l=\kappa^{-1} \cdot \sigma \quad (4)$$

Where R is the conductor resistance (Ω); l is the length of the conductor (cm); s is the cross sectional area of the conductor (cm²); ρ is the resistivity of the conductor (Ω·cm); κ is the constant relating to conductivity cell.

Conductance is proportional to conductivity; in order to monitoring the conductivity of aquaculture water, we need to design the circuit and get the information of conductance.

As we know, the deeper of water a probe locates at, the larger pressure it suffers. Piezoresistive pressure probe is based on Pascal's principle [12]. When there is no pressure on the probe, there's no output voltage. The output voltage increases with pressure if the probe is immersed in water.

## 2.2 Hardware Structure Design

In Fig.1, analog signals of water quality can be collected by detecting probes. However, chemical probe is sensitive to temperature changing and interfering ions can reduce the accuracy. Meanwhile, the limited range of microprocessor is exceeded by the analog signals if detecting probes are connected to the microprocessor directly. So we need the signal conditioning circuit to solve these problems. Not only should the signal conditioning circuit remove noise, but it can adjust the amplitude of analog signals. The signal conditioning circuit consists of operational amplifiers and some filter circuits.
<figure><img src="image_2.png" /><figcaption>Fig.1.Schematic diagram of multi-parameter sensor</figcaption></figure>

In order to reduce the energy consumption of the multi-parameter sensor, ST's ultra low power MCU STM8L152 is chosen to be a core processor. STM8L152 is integrated with 64 Kbytes of high-density embedded Flash program and 4 Kbytes of RAM. Its ultralow power consumption is 1μA in active-halt mode. STM8L152 can operate either from 1.8 to 3.6 V (down to 1.65 V at power-down) or from 1.65 to 3.6 V[13]. All these features make the microprocessor suitable for ultralow power sensor. What's more, analog to digital conversion chip is embedded in STM8L152, which makes it possible of converting analog signals from signal conditioning module into digital signals. What's more, up to 28 analog channels are very helpful for following study. With energy management module, microprocessor can control the power supply for each probe, preventing the noise by disturbances.

The spreadsheets (TEDS) in the flash of STM8L152, which store the channel information and calibration parameters, are designed to realize self-identification, self-diagnosis and self-calibration of the multi-parameter sensor. The communication interface module can be RS485 bus or GPRS, which is wildly used to communicate with PC monitoring plat. When monitoring values exceed the warning values, alarm signal is emitted by the alarm module. Moreover, the energy management module can provide stable voltage for detecting probes, signal conditioning circuit and alarm module. Rechargeable batteries and solar energy as the power are alternative energy methods.
## 2.3 Description of system program

Software flow chart of the Multi-parameter sensor's system is shown as Fig.2.

<figure><img src="image_3.png" /><figcaption>Fig.2. Multi-parameter sensor's system program</figcaption></figure>

The Multi-parameter sensor' system program is composed of the main program and interrupt service program. The purpose of the main program is to finish the initialization after system power on. Whether the supply voltage holds in a proper range can be tested by the self- diagnosis program of the main program. Meanwhile, the main program also can diagnose the nature of detecting probes and other faults of multi-parameter sensor. After the initialization and self-diagnosis, the device can operate normally. Then power supply of peripheral devices is stopped by the microprocessor and all the idle ports are placed on a high or low level simultaneously, which means the system enters into interrupt service program (ultralow power mode).

Ultralow power mode is designed to improve the energy efficiency. The focus of ultralow power mode is on interrupt triggering caused by PC monitoring plat. When collecting the data, the microprocessor executes the instruction of data acquisition sent by PC monitoring plat via either RS485 bus or GPRS. Then peripheral devices get the power supply; with controlling the power supply for each probe, microprocessor can acquire analog signals. After converting analog signals into digital signals, the data will go through compensation calculation and calibration calculation so as to get actual values. If actual values exceed the warning values, alarm signal is emitted by the alarm module. When finish the data acquisition, the system is back to ultralow power mode. What's more, system parameters and sensor calibration can be realized through serial ports.
# 3. Results and Discussion

## 3.1 Preparation of the Experiment

The standard solutions of pH 4.00, 6.86 and 9.18 were prepared for verify the multi-parameter sensor's reliability and accuracy. So the electronic analytical balance of Denver TP114 was purchased from America. The potassium hydrogen phthalate (KHC₈H₄O₄) of 10.12 g was dissolved in distilled water and diluted to 1000ml with a 1000 ml volumetric flask, when the buffer at pH 4.00 was made. Before use, the distilled water boiled for 15~30 min in order to remove the carbon dioxide in the water. For the buffer of pH 6.86, the potassium dihydrogen phosphate (KH₂PO₄) of 3.39 g and anhydrous di-sodium hydrogen phosphate (Na₂HPO₄) of 3.35 g were dissolved in distilled water and diluted to 1000ml. The borax of 3.80 g is dissolved in distilled water and diluted to 1000ml in order to get the buffer at pH 9.18.

High-low temperature test chamber of Surui RGDJ-100, high precision water bath of Jinghong DKB-501S and Hach HQ40d multi-parameter meter were purchased for the experiment. The conductivity of standard EC solution depends on the mess of KCL, so precious weighing is needed. With Denver TP114, standard EC solutions of different conductivity were prepared.

<table><caption>Table 1. Required mess of KCl for standard EC solution (20°C)</caption><thead><tr><th>Standard EC (mS/cm)</th><th>15</th><th>25</th><th>40</th><th>60</th></tr></thead><tbody><tr><td>KCL(g)</td><td>5.0442</td><td>8.588</td><td>14.0072</td><td>21.3669</td></tr></tbody></table>

The standard solution of hydroquinone is a very reliable material for verifying the accuracy of ORP measurement. Three portions of 10 g hydroquinone were respectively dissolved in the buffer of 1000 ml at pH 4.00, pH 6.86 and pH 9.18; meanwhile, there should be some solid hydroquinone guaranteed the saturation condition of the solution. Precise ruler was used as the criteria for the measurement of water level.

## 3.2 Characterization and Validation of the multi-parameter Sensor

The multi-parameter sensor and Hach HQ40d multi-parameter meter were put into high precision water bath of Jinghong DKB-501S. The amount of DO was measured per five degree centigrade increase. From Table 2, the accuracy of the multi-parameter sensor with DO probe is less than 1%, which means the multi-parameter sensor can be applied to monitor the amount of DO in the field.
<table><caption>**Table 2.** Detection accuracy of the multi-parameter sensor with DO probe</caption><thead><tr><td>Temperature (°C)</td><td>Reference value (mg/l)</td><td>Measured value(mg/l)</td><td>Relative error(%)</td></tr></thead><tbody><tr><td>5</td><td>9.97</td><td>9.88</td><td>-0.90%</td></tr><tr><td>10</td><td>9.16</td><td>9.12</td><td>-0.44%</td></tr><tr><td>15</td><td>8.88</td><td>8.86</td><td>-0.23%</td></tr><tr><td>20</td><td>8.50</td><td>8.49</td><td>-0.12%</td></tr><tr><td>25</td><td>6.93</td><td>6.95</td><td>0.29%</td></tr></tbody></table>

<table><caption>**Table 3.** Detection accuracy of EC in different temperatures</caption><thead><tr><td>Temperature(°C)</td><td>Reference value (mS/cm)</td><td>Measured value (mS/cm)</td><td>Reference value (mS/cm)</td><td>Measured value (mS/cm)</td></tr></thead><tbody><tr><td>5</td><td>15</td><td>15.32</td><td>40</td><td>39.82</td></tr><tr><td>15</td><td>15</td><td>15.16</td><td>40</td><td>40.51</td></tr><tr><td>25</td><td>15</td><td>15.28</td><td>40</td><td>40.06</td></tr><tr><td>35</td><td>15</td><td>15.22</td><td>40</td><td>40.72</td></tr><tr><td>5</td><td>25</td><td>25.43</td><td>60</td><td>61.27</td></tr><tr><td>15</td><td>25</td><td>25.21</td><td>60</td><td>60.62</td></tr><tr><td>25</td><td>25</td><td>25.20</td><td>60</td><td>60.31</td></tr><tr><td>35</td><td>25</td><td>25.10</td><td>60</td><td>60.43</td></tr></tbody></table>

<table><caption>**Table 4.** Detection accuracy of pH in different temperatures</caption><thead><tr><td>Temperature (°C)</td><td>Standard solution</td><td>Measured value</td><td>Relative error</td></tr></thead><tbody><tr><td>10</td><td>4.00</td><td>4.03</td><td>0.03</td></tr><tr><td>20</td><td>4.00</td><td>4.05</td><td>0.05</td></tr><tr><td>30</td><td>4.02</td><td>4.04</td><td>0.02</td></tr><tr><td>10</td><td>6.85</td><td>6.85</td><td>0</td></tr><tr><td>20</td><td>6.88</td><td>6.87</td><td>-0.01</td></tr><tr><td>30</td><td>6.85</td><td>6.87</td><td>0.02</td></tr><tr><td>10</td><td>9.33</td><td>9.22</td><td>-0.11</td></tr><tr><td>20</td><td>9.23</td><td>9.27</td><td>0.04</td></tr><tr><td>30</td><td>9.14</td><td>9.31</td><td>0.17</td></tr></tbody></table>
<table><caption>**Table 5.** Detection accuracy of the water-level</caption><thead><tr><td>Reference value (m)</td><td>Measured value(m)</td><td>Relative error(%)</td></tr></thead><tbody><tr><td>7.67</td><td>7.62</td><td>-0.65%</td></tr><tr><td>5.68</td><td>5.63</td><td>-0.88%</td></tr><tr><td>7.49</td><td>7.42</td><td>-0.93%</td></tr><tr><td>6.50</td><td>6.54</td><td>0.62%</td></tr><tr><td>6.93</td><td>6.95</td><td>0.29%</td></tr><tr><td>7.82</td><td>7.87</td><td>0.64%</td></tr><tr><td>8.54</td><td>8.49</td><td>-0.59%</td></tr></tbody></table>

<table><caption>**Table 6.** Detection accuracy of the ORP</caption><thead><tr><td>pH</td><td>Reference value (mV)</td><td>Measured value(mV)</td><td>Relative error( mV )</td></tr></thead><tbody><tr><td>4.02</td><td>218.5</td><td>219.0</td><td>0.5</td></tr><tr><td>6.90</td><td>59.0</td><td>58.3</td><td>0.7</td></tr><tr><td>9.21</td><td>-76.5</td><td>-76.1</td><td>-0.4</td></tr></tbody></table>

At the same way, the multi-parameter sensor and standard EC solutions in DKB-501S had shown the detection of EC. The values measured by the multi-parameter sensor were found to be in a good agreement with standard solutions. Measurement error is less than 1mS/cm as shown in Table 3. DKB-501S can guarantee the precision of the measurement thanks to isolating solutions from the atmosphere.

In Table 4, Standard solution means the standard solutions of pH 4.00, 6.86 and 9.18. Besides, the experiment was performed in high-low temperature test chamber of Surui RGDJ-100. When the temperature increases every time, one hour is needed to get the stable and reliable data. At the room temperature, the maximum error of the multi-parameter sensor with pH probe is 0.05. Relative error of the multi-parameter sensor with water-level probe is less than 1% and relative error of the multi-parameter sensor with ORP probe is less than 1mV, from Table 5 and 6.

All these results demonstrated the reliability, accuracy and sensitivity of the multi-parameter sensor for online monitoring with pH, DO, EC, ORP and water level, which means compensation calculation and calibration calculation are effective to get actual values. So the multi-parameter sensor we designed can be used for online monitoring the aquaculture in China with acceptable errors.
## 4. Conclusion

It has been demonstrated that a multi-parameter sensor with online monitoring for the aquaculture in China is designed. The multi-parameter sensor makes the real-time monitoring come true with low cost, high efficiency and good precision. Detection principles of water quality are introduced in this paper.

In particular, STM8L152 is chosen to be a core processor embedding analog to digital conversion chip, which simplifies the system's design. What's more, active-halt mode of the chip is helpful to the ultralow power design. In addition, compensation calculation and calibration calculation guarantee the accuracy of data. With energy management module, microprocessor can control the power supply for each probe, preventing the noise by disturbances. With simple hardware structure, the cost of the multi-parameter sensor is very low, which means the multi-parameter sensor can be used in China widely.

## Acknowledgement

This research is founded by “Special Fund for Agro-scientific Research in the Public Interest” (201203017), Key Program for International S&T Cooperation Projects of China (2013DFA11320), Key Projects in the National Science & Technology Pillar Program during the Twelfth Five-year Plan Period (2012BAD35B03).

## References

[1] W. P.: Introduction to on-line aquaculture water quality monitoring system. Fishery Modernization (4), 17–19(2006) (in Chinese)

[2] Lee P. G.: A Review of Automated Control Systems for Aquaculture and Design Criteria for Their Implementation [J]. Aquacultural Engineering. 14: 205–227 (1995).

[3] Sun, M. J., Li, X.Y., Li, X.Y.: Design and Application of Online Multi-parameter Water Quality Analyzer Based on Cygnal Microcomputer C8051F020. Control and Instruments in Chemical Industry 36(6), 56–58(2009) (in Chinese)

[4] Zhang, H.H., Liu, B., Jin, Q.H., Liu, Y.S.: Research and fabrication of multi-parameter microsensor array for water quality monitoring based on integrated reference electrode. Transducer and Microsystem Technologies 30(10), 99–101 (2011) (in Chinese)

[5] Philip W, et al.: Environmental sensor networks in ecological research. New Phytologist(182), 589–607(2009)

[6] Bard, A.J., Faulkner, L.R.: Electrochemical Methods: Fundamentals and Applications, seconded. Wiley, New York (2001)

[7] Trinidad P., de Leon CP., Walsh F.C.: The use of electrolyte redox potential to monitor the Ce(IV)/Ce(III) couple. Journal of Environmental Management 88 (4), 1417-1425 (2008)

[8] DAVID, JEFF M.: ORP Measurements in Water and Wastewater. Ultrapure Water Journal
25(5), 26-31 (1993)

[9] Liu, Q., Zou, Y. q., Xing, H.y.: Measuring Instrument of Dissolved Oxygen Based on MSP430. Instrument Technique and Sensor (9), 33-35 (2009) (in Chinese)

[10] Milka T. N., V. Nikolova, V. Petrov: New real-time analytical applications of electrochemical quartz crystal microbalance: Stoichiometry and phase composition monitoring of electrodeposited thin chalcogenide films. Analytica Chimica Acta 573, 34-40(2006)

[11] Liu, X.w., et al.: Nano-structured manganese oxide as a cathodic catalyst for enhanced oxygen reduction in a microbial fuel cell fed with a synthetic wastewater. Water Research 44(18), 5298-5305 (2010)

[12] Liu, L., Deng, S.J., Zhang, J.: Research of Technologies of Water Level Detection for Water Supply and Drainage System. Industry and Mine Automation 37(12), 21-24 (2011) (in Chinese)

[13] ST. STM8L15X microcontroller family (2010). http://www.st.com