The Dissolved Oxygen Sensor Design Based on Ultrasonic Self-Adaption and Self-Cleaning

School of Mechanical and Electrical Engineering, Guangzhou University, Guangzhou 510006, China School of Mathematics and Statistics, Hunan University of Technology and Business, Changsha 410205, China School of Business Administration, Guangzhou University, Guangzhou 510006, China Data Recovery Key Laboratory of Sichuan Province, Neijiang Normal University, Neijiang, Sichuan 641100, China School of Public Administration, Guangzhou University, Guangzhou 510006, China


Introduction
Dissolved oxygen [1] is not only a main parameter to characterization of water environment quality but also an essential condition for the survival of higher aquatic animals such as fish. e dissolved oxygen measurement is of great significance for the environmental monitoring and the development of aquaculture. e common methods of dissolved oxygen measurement are iodimetry [2,3], current measurement (Clark dissolved oxygen electrode) [4,5], fiber-optic fluorescence quenching [6][7][8], and so on. Iodimetry is a classical method of dissolved oxygen measurement with high accuracy, but since it is timeconsuming and laborious, it is unsuitable for online monitoring. Fiber-optic fluorescence quenching has complex manufacturing process and high manufacturing cost, so it is less used at present. Current measurement is an electrochemical method that obtains the dissolved oxygen content by measuring the current of dissolved oxygen sensor. Since the sensor solves the online measurement problem of dissolved oxygen and it is simple, fast, and not easy to be affected by chromaticity of water, turbidity of water, and impurities, it is widely used in water quality environmental measurement. Liu et al. proposed the measuring instrument of dissolved oxygen based on MSP430 [9]. Li et al. set forward the AVR in Detection of Dissolved Oxygen [10], Dong and Zhan designed an automatic control system based on ZigBee technology for the oxyty in fresh water cultivation [11]. e design conducted effective researches on the principle, structure, and system of the online measurement of dissolved oxygen. Nowadays, neural network [12,13], self-adaptive methods, machine learning, and deep learning have been successfully applied in various fields and achieved significant results [14][15][16].
However, the probe of dissolved oxygen sensor is easy to be blocked up by algae and phytoplankton in water, which leads it to not be able to continuously work for a long time and it cannot be used in projects, and the change of water temperature can easily increase the output current of the probe and indirectly affects the accuracy of measurement. In order to solve the above problems and improve the accuracy of measurement, this paper suggests a new design of dissolved oxygen sensor based on ultrasonic self-adaption and self-cleaning.
is novel dissolved oxygen sensor with cleaning mechanism and automatic calibration solves the problem of pollution and blockage, which leads to the continuous decrement of the sensitivity of probe, improves the accuracy of measurement, and produces a barrier-free dissolved oxygen sensor with long service life and high precision.

Overall Structure of Measurement System.
e dissolved oxygen sensor is an advanced intelligent sensor, which has an important component of the dissolved oxygen measurement system. e dissolved oxygen measurement system is shown in Figure 1. It includes some intelligent dissolved oxygen sensors with remote communication function, a cloud server, and some intelligent terminals such as mobile phones. Among them, the intelligent dissolved oxygen sensors measure the water temperature and the dissolved oxygen content, upload data, automatically clean the probe, and adapt to temperature for calibration. e cloud server stores the data uploaded by intelligent dissolved oxygen sensors and the control command of intelligent terminals. e intelligent terminals monitor the status of water temperature and dissolved oxygen in real time, dynamically display the historical curve, and send the control commands such as cleaning and calibration.

Circuit Composition.
e main functions of an intelligent dissolved oxygen sensor are to measure the water temperature, measure the dissolved oxygen content, calibrate the system, and clean the probe automatically. Its structure is shown in Figure 2. It is composed of an embedded microcontroller (MCU), a one-wire digital temperature sensor, a primary battery dissolved oxygen sensor, an operational amplifier circuit, a relay module group, an ultrasonic power supply, an ultrasonic transducer, a system power supply, and the GPRS/4G module. e MCU requires a certain amount of IO, enough timers and interrupts, an analog-to-digital converter (ADC), a onewire interface, an universal asynchronous serial interface, and other universal interfaces, as well as a watchdog timer and strong anti-interference ability. It is suitable to choose STM32 series products of Italian French Semiconductor Company, PIC series products of Microchip Company, or relevant compatible microcontroller products as MCU. e operational amplifying circuit is applied to amplify the millivolt level voltage signal output by the dissolved oxygen sensor almost 100 times and complete the measurement with the ADC in MCU. Since most of the ADC in MCU is 10-bit precision or 12-bit precision, the products that are not satisfied with such settings need the higher measurement precision in order to add 16-bit or 24-bit special ADC module in the back end of operational amplifier circuit such as AD7705, MAX195, AD7710, and ADuC845. DS18B20 [17][18][19] can be used as the temperature sensor, which is flexible and portable and has high precision. It can provide temperature in the range of −55°C∼125°C with precision of ±0.5°C. DS18B20 uses one-wire interface, which is simple to connect with MCU and convenient to be applied. e relay module group is applied to control the ultrasonic power supply and submersible pump in order to automatically clean the probe. GPRS/4G module is applied to connect the cloud server remotely and build a communication channel for the establishment of intelligent aquaculture Internet of things system and the implementation of remote monitoring of intelligent terminals.

Dissolved Oxygen Sensor.
e intelligent dissolved oxygen sensor is the front end of the measurement system. Its quality, service life, and accuracy are the basis of water environment monitoring and aquaculture development. A good design ensures the safety, the accuracy, the stability, and a long service life of the measurement system.
In general, coated primary battery electrode or polarographic electrode is used as the electrode of dissolved oxygen sensor, so the sensor is essentially an oxygen battery, with oxygen as its cathode and lead as its anode. e sensor's cathode is usually made of silver wire, which is filled with electrolyte inside and covered with coating outside for isolation, since oxygen needs to be discharged by metal. e molecular oxygen in water enters the sensor through the permeable film and meets the electrode, which leads to the oxidation-reduction reaction; then the cathode of the electrode outputs the microlevel current. e reaction formulas that take place in battery are as follows: e coated oxygen sensor is a current element. In the coated oxygen sensor, the current outputted by the electrode is proportional to the oxygen consumption, and the rate of oxygen passing through the film is also proportional to the pressure on the film. Since oxygen is consumed rapidly at the cathode, it can be assumed that there is no pressure on the film, which will lead to the diffusion of oxygen, and that the force through the film and the pressure on the film both force the oxygen to reach the electrode rapidly. If the pressure outside the probe increases, more dissolved oxygen will diffuse through the film and more current will be generated. Otherwise, the current decreases, which can be described by the diffusion current model. e related formula is as follows: In this formula, n is the number of electrons in electrode reaction, F is the Faraday constant, A is the surface area of the cathode, D is the coefficient of oxygen diffusion, L is the distance from the outer surface of the permeable film to the surface of the cathode, and C is the partial pressure of oxygen. According to Faraday's law, when the material and structure of battery are determined, the current generated by the diffusion of molecular oxygen through the film to the electrode is proportional to the partial pressure of oxygen at certain temperatures, which can be expressed as linear element: i � k * c.

Mechanical Structure of Intelligent Sensor
Intelligent sensor is a digital measurement system rather than a common sensor element. It has the rational and perfect design including MCU, conditioning circuit, communication circuit, measurement mechanism, and cleaning mechanism. It is not only convenient in output control and function enhancement but also has a short learning curve. e mechanical structure of intelligent sensor is shown in Figure 3. e sensor system floats on the surface of water; the upper part of it (above the surface) and the lower part of it (below the surface) are both in the shape of cylinders, and the middle part of it is in the shape of a disc (floating on the surface). e groove in the center of the upper part is embedded with a dissolved oxygen probe, and the cavity around it is used to contain the water which is pumped up by the submersible pump and needs to be measured. One side of the lower edge of the middle part is the water inlet which is connected with a small submersible pump, and another side is the lower water outlet, while the upper water outlet is on the upper part. e upper water outlet with a large opening is the main water outlet, and the lower water outlet with a small opening is the auxiliary water outlet. e flow direction of water is also shown in Figure 3. e purpose of this design is to provide water for the probe, while the water flows in a suitable speed, and prepare for air calibration (see Section 4) by stopping the submersible pump, draining the water, and exposing the dissolved oxygen probe to the air. e temperature sensor which is inserted into the bottom shell of the upper part is used to measure the temperature of the water in cavity. e middle part is designed as a disc in order to float on the water and store enough flowing water to be measured. e lower part is used to put the ultrasonic transducer and the ultrasonic power supply and they are both set below the water line. Such setting has two advantages: firstly, the temperature below the water line is lower than the temperature above, which is convenient for the heat dissipation of the ultrasonic power supply; secondly, the weight of the ultrasonic transducer and the ultrasonic power supply is large enough to be used as the counterweight of the system in order to prevent the system structure from overturning. However, there is a difficulty in manufacture that it is hard to ensure the features of waterproofing and sealing in ultrasonic transducer and ultrasonic power supply shell.

The Design of Automatic Cleaning
e effect of the permeable film on the probe is to make the molecular oxygen in water permeate through it from the outside under the push of dissolved partial pressure and react with the electrode in the probe to generate current, while water, organic matter, and other macromolecules are blocked outside the film at the same time. Due to the selective feature of the film, the organic matter will be stuck on the surface of the film and lead to the film pollution, which is the main factor that limits the sensor to continuous work for a long time.
erefore, the effective cleaning of the permeable film is a good way to extend the sensor's service life.

Complexity 3
Common cleaning methods include biological cleaning, chemical cleaning, and physical cleaning. Biological cleaning is to remove the contaminants on the film with the help of microorganisms, enzymes, and other biological active agents. Its weakness is that the cleaning takes a long time and it is prone to secondary pollution after cleaning. Chemical cleaning is to soak and clean the film with a cleaning solution added with a suitable chemical agent. Its weakness is that the cleaning is time-consuming, laborious, and unsafe. Both of the above cleaning methods can improve the permeability of the film, but there is also a possibility that they introduce new contaminants and damage the film. Otherwise, they are complex in operation and have low reliability.
Physical cleaning includes mechanical method and ultrasonic method. Mechanical methods, such as manual wiping, water washing, and automatic wiping mechanism, have several disadvantages such as difficult cleaning operation, poor cleaning effect, and high damage rate since the thickness of the probe film is usually 20-40 μm.
Ultrasonic cleaning is to use the cavitation effect of ultrasonic to break down the adsorption of the dirt and the surface of the cleaning parts and destroy the dirt layer. e cavitation effect is that the micro bubble (cavitation core) in the liquid vibrates under the periodic action of ultrasonic, so the micro bubble in the liquid will expand rapidly and then suddenly close. At the moment of bubble closing, the strong shock wave and the high-temperature and high-speed micro jet will be generated, and the shock wave will hit on the interface between solid and liquid. In addition, the hightemperature and high-speed micro jet will hit on the surface of the film. It will destroy the insoluble dirt, wash the particles and organic substances away, and make them separate and disperse in the liquid, so as to achieve the purpose of cleaning.
Cui et al., combined with the application of the technology of ultrasonic cleaning and the research of relative influencing factors, looked forward to the development's direction of ultrasonic cleaning technology [20,21]; Huang and Mo investigated the film pollution and the cleaning statue of water source polluted by suspended growth MBR and two kinds of adherent growth MBR [22]; the results showed that the ultrasonic cleaning can significantly improve the performance of the film with high surface viscosity polluted by adherent growth MBR. e previously mentioned researches show that the ultrasonic cleaning technology will be suitable for the cleaning of the film of the dissolved oxygen sensor probe if the cleaning mechanism is designed reasonably and the working parameters are selected appropriately.
In this design, the ultrasonic cleaning mechanism is located at the bottom of the sensor system, with the transducer facing up and facing the vertical probe, which means that the ultrasonic cleaning mechanism is especially designed for the cleaning. In the process of the cleaning, the submersible pump keeps working normally and the cavity is full of water, which is used as cleaning fluid. After the repeated experiments, this paper finds that it can ensure the probe's nondestructive cleaning and long-term use when the working frequency is 28 kHz, the transducer is 50 W, the cleaning period is four times a day, and the cleaning time is 20 seconds. e flow chart of regular automatic cleaning is shown in Figure 4. e concentration polarization of the electrolyte in the sensor is caused by ultrasonic wave; that is, the concentration of the electrolyte near the two electrodes is obviously higher than the electrolyte itself; the electrode potential of the anode or cathode of the sensor deviates from the equal potential produced by the concentration of the electrolyte itself, which causes the output current of the sensor to change greatly and the result of measurement to increase suddenly, so the system cannot normally measure the dissolved oxygen content. erefore, the system stops data sampling in the process of cleaning and after the process of cleaning in order to prevent the collection of the error data with large deviation.

Temperature Compensation Design
e temperature compensation of an instrument is to correct the final parameters (indirect parameters), which are easily affected by the temperature. e measurement of dissolved oxygen is a relative measuring method, which obtains the dissolved oxygen content by linear calculation through measuring the output current of the sensor. Due to the limitation of thickness of the film, the electrolyte concentration, the purity of lead silver metal, and the manufacturing level, the output current of each sensor probe is different. erefore, zero calibration and span calibration should be carried out before measurement, that is, calibrating the instrument's current value of the zero point and the saturation point under a certain temperature t. Since the current value of zero point corresponds to the zero dissolved oxygen value and the current value of saturation point corresponds to the saturated dissolved oxygen value under temperature t and there is a linear relationship between the dissolved oxygen content and the output current of the electrode when the temperature is constant, the two-point calibration can determine the coefficient of linear relationship between current and dissolved oxygen k t , and the mapping relationship between current and dissolved oxygen at temperature t is established. For example, if the dissolved oxygen sensor system is calibrated at 20°C, i � k 20 c can be used for accurate calculation to obtain the accurate dissolved oxygen content when the water is at 20°C. Figure 5 is a comparison of the relationship between dissolved oxygen saturation and temperature under ordinary temperature, salinity of 0°C, and standard atmospheric pressure. Since the relationship between dissolved oxygen saturation and temperature is not linear just like the example above, k 20 cannot be used to calculate the dissolved oxygen content when the temperature rises to 22°C or falls to 18°C. e calibration line has different slopes at different temperatures. Since the linear relationship between the electrode current and oxygen partial pressure is based on environmental temperature, if the temperature of water changes, the output current will increase or decrease. For example, with the increment of temperature, the oxygen penetration coefficient of the film will increase and the diffusion coefficient of dissolved oxygen in the electrolyte solution will increase, so the permeability of dissolved oxygen will increase, which leads to the increment of the reaction speed of electrode and the change of the signal of current, so the indirect measurement results of dissolved oxygen content will also increase. At the same time, the oxygen partial pressure may remain or change very little, so the dissolved oxygen content will remain and the change of temperature will change the probe's current output and lead to an inaccurate measurement. erefore, the probe should be compensated based on temperature.
Ding et al. put forward a compensation and correction method for intelligent dissolved oxygen sensor [23]. Zhang and Shao studied the characteristics of the temperature of dissolved oxygen sensor [24], analyzed the temperature compensation of oxygen electrode, and designed a software compensation method. e accuracy of dissolved oxygen measurement can be significantly improved when the difference between the calibration temperature and the water temperature is small. However, the software temperature compensation may miscalculate the dissolved oxygen content when the difference is large enough (±8°C). Moreover, the third-order polynomial which is used to fit the slope of the temperature saturated dissolved oxygen degree may cause too heavy burden of MCU, which is inconvenient and impractical. erefore, it is necessary to study and design a new and advanced temperature compensation method to improve the accuracy of dissolved oxygen measurement.
In this paper, a method combining software temperature compensation with real-time recalibration is suggested. In this new method, the linear temperature compensation model is used when the temperature difference is tiny, and the real-time recalibration is used when temperature difference is large, which means that the measured water temperature is within the range of ±2°C of the calibration temperature. At first, it uses the formulation D � K * T + b to correct the saturated solubility, and then it uses the formulation i � k t * c to indirectly calculate the dissolved oxygen content (partial pressure of dissolved oxygen). If the water temperature is outside the range of ±2°C of the calibration temperature, it needs to recalibrate and calibrate the   Complexity 5 instrument at a new temperature to determine new k t . On one hand, since the zero calibration of the instrument is generally determined by anaerobic water before the product leaving factory and is hardly affected by the temperature, the recalibration can be ignored. On the other hand, there are four kinds of span calibration: classical chemical method, air calibration method, water calibration method, and electrolytic oxygen calibration method, and air calibration method and water calibration method are usually used in online measurement. In this paper, air calibration method is selected to be implemented. Air calibration method is also known as air calibration for water's saturated vapor. When the water is saturated by air at a certain temperature, the partial pressure of dissolved oxygen is equal to the partial pressure of oxygen in the air on the surface of water, so the rate of oxygen entering the water from the air is equal to the rate of oxygen escaping from the water to the air. erefore, no matter whether the electrode is immersed in water or placed in the air, it can produce the same current, and the method that is based on it is known as air calibration method. e air calibration method is easy to implement and is able to measure at high accuracy, so it is one of the best methods for on-site calibration.
e air calibration process of the sensor is shown in Figure 6. It turns off the submersible pump at first and then drains the water and waits for 60 seconds, measures the temperature and current by adjusting the slope of the dissolved oxygen instrument based on Figure 6, and recalibrates the dissolved oxygen electrode at last.

Experiment and Discussion
ere are two different aquaculture ponds selected for experiments below. e experiments mainly focus on two aspects of the probe. Experiment 1 was used to reveal the effect of ultrasonic cleaning on the durability of the probe. Experiment 2 was used to reveal the influence of the new temperature compensation technology on the accuracy of the measurement.

Experiment 1.
ere is an outdoor soil pond as aquaculture pond which is sunny and rich in algae. e main way to increase dissolved oxygen content is to naturally add oxygen, and the auxiliary way is to add oxygen by aerator. e aquaculture organism is Penaeus vannamei. e temperature of water is usually 25 ± 3°C. e measurement time each day is from 15:00 to 17:00 and the experiment lasts for 90 days. Among them, A corresponds to the results measured by iodimetry, B corresponds to the results measured by the probe which is periodically ultrasonic cleaned, and C corresponds to the results measured by the probe which is never cleaned. e results are shown in Figures 7 and 8. e results show that the C-type probe's relative error increases and its result of measurement decreases with the passing of time. In the 30th day, the C-type probe's relative error has reached 30.3%, which means that this probe can no longer be used for measurement. However, the B-type probe can continuously work for more than 90 days and its relative error is still less than 1%. In practice, the sensor with B-type probe has already continuously worked for more than one year; it still does not need to replace the film or the electrolyte and its attenuation of output is less than 5%.  ere is an indoor factory-built cement pond as aquaculture pond. Its pond is paved with micropore oxygenating pipe. ere are little algae in the water and the main way to increase dissolved oxygen content is to artificially add oxygen. e aquaculture organism is gentian grouper. e temperature of water changes in real time and the measurement time each day is from 8:00 to 18:00. Among them, A corresponds to the results measured by iodimetry, B corresponds to the results measured by the probe with software temperature compensation and real-time calibration, and C corresponds to the results measured by the probe which is only calibrated at 23°C. e results are shown in Figures 9 and 10. e results show that the C-type probe's relative error increases with the temperature deviation of 23°C (calibrated temperature) and its relative error reaches 2.38% at the maximum, though it retains the software temperature compensation. Meanwhile the B-type probe's relative error is less than 1%, which means that it has a very good accuracy on measurement.

Conclusion
e research shows that the new dissolved oxygen measurement system developed by MCU can reasonably solve the problem of probe cleaning after applying ultrasonic cleaning technology, since, compared with other cleaning technologies, ultrasonic cleaning technology has the advantages of higher cleaning rate, less residue, shorter cleaning time, and better cleaning effect, and it greatly prolongs the service life of the sensor. e application of software temperature compensation and real-time air calibration can significantly improve the accuracy of the measurement, achieve the continuity, stability, reliability, and accuracy in dissolved oxygen measurement in water quality environmental monitoring, and provide important data for scientific aquaculture in aquaculture industry. At present, there are about 100 sets of measuring instruments implemented in many shrimp pond farms in Beihai, Qinzhou, Fangcheng, Haikou, Sanya, Zhongshan, and Shanwei of Guangdong Province, and all of them have worked continuously for more than one year. e introduced GPRS/4G module can effectively establish the big data of water quality monitoring and aquaculture industry and the new self-cleaning self-adaptive dissolved oxygen sensor system will provide higher-quality services for water-quality monitoring and aquaculture industry.

Complexity 7
Data Availability e data used to support the findings of this study are included within the article.