# Intelligent Ammonia-Nitrogen Sensor Which Based on Ammonia Electrode

Fan Zhang, Yaoguang Wei, Yingyi Chen, Chunhong Liu

► To cite this version:

Fan Zhang, Yaoguang Wei, Yingyi Chen, Chunhong Liu. Intelligent Ammonia-Nitrogen Sensor Which Based on Ammonia Electrode. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.534-543, 10.1007/978-3-642-54341-8_56 hal-01220865

HAL Id: hal-01220865

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

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
# Intelligent ammonia-nitrogen sensor which based on ammonia electrode

Fan Zhang, Yaoguang Wei*, Yingyi Chen, Chunhong Liu

College of Information and Electrical Engineering, China Agricultural University, Beijing
100083, China

**Abstract.** To solve the problems that the traditional ammonia detection methods were complex, not easy to maintenance and difficult to realize quick measurement in situ, an intelligent ammonia sensor has been designed in this paper. The intelligent ammonia sensor integrates ammonia electrode, pH electrode and Ammonium ion electrode together to realize the In situ detection of ammonia. Because the output signal of ammonia electrode is weak and easy to be disturbed by external interference, a low-pass filter circuit has been designed, this kind of circuit have a good effect. The test results have shown that the sensor is easy operation, low cost and no pollution.

**Keywords:** aquaculture Ammonia nitrogen Ammonia sensitive electrode Sensor on-line monitoring

## 1 Introduction

Our country is a big agricultural country. Aquatic production has been 15 consecutive years ranked first in the world. However, most farmers rely on their own experience, with color, smell, water taste or observed other aquatic animal's abnormal behavior to evaluation aquaculture water quality. For aquaculture, dissolved oxygen, ammonia nitrogen, PH is one of the important water quality parameters need to be monitoring[1]. Ammonia existing in water has certain toxicity for aquaculture products. It influents the quality of aquatic products, restrict the sustainable development of aquaculture, especially with the promotion of high density factory farming technology, ammonia pollution control demand is increasingly prominent. Ammonia harm the aquatic organisms mainly refers to the dangers of non-ionic ammonia, after non-ionic ammonia entering aquatic organisms [2]. It has a significant impact on enzyme hydrolysis reaction and membrane stability. Demonstrated difficulty in breathing, not feeding, decreased immunity, convulsions, coma and other phenomena, affect the growth and reproduction of aquatic organisms, even lead to aquatic organisms decimated, even causing loss to the economy[3].

There are different ways to determine the content of ammonia nitrogen in the water[4][5]. The existing method of ammonia nitrogen determination has some shortcomings[6]. Such as titration's sensitivity is not high enough. Spectrophotometry needs a large amount of chemical reagent and complicated steps[7]. Ammonium ion electrode method is easily affected by other monovalent cations. Optical fluorescence technology is not mature. Spectrometry instruments are expensive. These methods are
difficult to meet the needs of the scene in situ detection with high frequency. With
ammonia sensitive probe we can realize quick measurement in situ. The sensor has
some good features, such as simple operation, low cost, pollution-free, and don't need
to pretreatment the water. Based on the above analysis, an compound ammonia
sensors which integrated ammonia sensitive probe and PH probe has been designed in
this paper. A low cost ammonia nitrogen on-line monitoring method will be the main
research content, and find a solution of electrochemical intelligent ammonia sensor.

## 2 Measurement principle

Ammonia nitrogen content in the water is in the form of free ammonia NH₃ and ammonium ion NH₄⁺ chemical combination of the existence of the amount of nitrogen[8]. It is an important index of water pollution. When free ammonia NH₃ reaches a certain concentration is harmful to aquatic organisms. For example, it will be able to cause toxic effects on some kind of fish when free ammonia over 0.2mg/L. The solubility of ammonia in water at different temperatures and PH is different, when the PH content is high, it will have a higher proportion of free ammonia, on the contrary[9], a higher proportion of the ammonium ions. Under a certain condition, the ammonia and the ammonium ion has the following balance equation: $NH_3 + H_2O ⇌ NH_4^+ + OH^-$

In this study, Ammonia electrode 9512HPBNWP was elected to measure ammonia content in water. The ammonia electrode is a composite electrode, PH glass electrode as indicator electrode, silver - silver chloride electrode as the reference electrode. Put the electrodes inside a plastic sleeve which containing 0.1mol/L ammonium chloride liquid-filled, and equipped with gas-sensitive film. Add ionic strength to the aqueous sample solution, PH may be raised to 11 or more, and ammonium salts are converted to ammonia, because of diffusion, ammonia gas will pass through the membrane (water and other ions can't pass the gas membrane). After ammonia gas into the inner filling, will present the following balance: $NH_3 + H_2O = NH_4^{+} + OH^-$

Ammonia leads the balance equation shift to the right, then the value of PH increased with the entry of ammonia. Finally PH glass electrode measured value changes. At constant ionic strength, temperature, nature and electrode parameters, the measured electromotive force and the ammonia concentration in water samples meet the Nernst equation[10]. We can determine the nitrogen content of the sample from the measured potential value. Finally draw a standard curve by measured voltage signal to determine the concentrations of the unknown samples. Fig.1 shows measuring device of ion selective electrode.
<figure><img src="image_2.png" /><figcaption>Fig. 1 Measuring device of ion selective electrode</figcaption></figure>

As content of free ammonia in the solution changes, formed the overall balance:

$$E = E^0 - \frac{RT}{nF} \ln \frac{\alpha_{j1}}{\alpha_{j2}} = E^0 + 2.303 \frac{RT}{nF} \lg \frac{\alpha_{j1}}{\alpha_{j2}} \quad (1)$$

In the formula above, E is a single electrode potential; E° is the potential difference between standard electrodes; T is the absolute temperature; R is the gas constant and equal to 8.31J / (mol × K); n is the transferred charge moles under E°; F is the Faraday constant equal to 96467C.

Nernst equation is an important formula which linking the potential difference of the chemical system and electro-active substance activity (concentration) together. It is also an important theoretical basis for the electrochemical analysis method[11].

Under the action of strong alkaline solution Ammonium ions is converted to the dissolved ammonia. Since ammonia through the semipermeable membrane into the internal electrolyte, free ammonia and H⁺ in the electrolyte thin are combined to form the ammonium ion. Assuming the electrolyte is not a PH buffer solution, as a characteristic of alkaline ammonium action will then increase the PH value of the test solution, as a characteristic of alkaline ammonium the PH value of the test solution will increase. Using 0.1mol/L NH4Cl as buffer solution, due to the concentration of NH₄⁺ is significantly higher than reaction of NH₄⁺ therefore consider that NH₄⁺ concentration is a constant. The change of PH value is determined by the change of concentration of NH₄⁺. Therefore, there are following equations:

$$a_{H^+} = K \frac{a_{NH_4^+}}{a_{NH_3}} = \frac{k}{P_{NH_3}} \quad (2)$$

$$K = a_{H^+} + \frac{P_{NH_3}}{a_{NH_4^+}} \quad (3)$$

$$E = E^0 - \frac{2.303RT}{F} \lg P_{NH_3} \quad (4)$$
$P_{NH_3}$ is the partial pressure of ammonia in the sample or in the thin layer, According to Henry's law $P_{NH_3} = K[NH_3]$, K is Henry's law constant, so the battery voltage and ammonium ion concentration in the sample under Nernst relations:

$$E = E^0 - \frac{2.303RT}{F} \lg NH_3 \quad (5)$$

The formula expressed that potential difference between two electrodes and the measured molar concentration of ammonia solution has a logarithmic relationship. Therefore, it is only need to test potential difference between the two electrodes and the temperature. Then the concentration of ammonia in the solution can be measured by calculating.

# 3 Circuit design of Ammonia sensor

## 3.1 Overall framework

Smart sensors include ammonia-sensitive probe ammonia, ammonium ion probe, pH and temperature probe, signal conditioning modules, TEDS memory, microcontrollers MSP430, bus interface module, power management modules, etc. As shown above. A free ammonia signal will be obtained by Ammonia-sensitive probe, a ammonium ion signal will be got through the ammonium ion probe, PH signal got by the pH probe. Signals are transferred to MSP430 MCU A/D input port through the transmission circuit. And then the concentration of free ammonia, the concentration of ion ammonium, value of pH, water temperature and nitrogen content are calculated by the microcontroller. Finally, the bus interface module output variables.

<figure><img src="image_3.png" /><figcaption>Fig. 2 overall framework of Intelligent ammonia sensors</figcaption></figure>
## 3.2 Power modules

For glass electrode's characteristics that output positive voltage in acid solution and output negative voltage in alkaline solution, a negative 3.3V power supply module was designed.

<figure><img src="image_4.png" /><figcaption>Fig. 3 +3.3V schematic circuit diagram</figcaption></figure>

## 3.3 Single transmission modules

Since ammonia electrode and pH electrode output impedance are particularly high, so the first stage of the amplifier circuit must use high input impedance op amp to match impedance. In addition, during the test it is easy to see that the electrode probe output signal susceptible to interference by 50Hz signal, so the low-pass filter circuit is added to the signal conditioning module.

<figure><img src="image_5.png" /><figcaption>Fig. 4 working principle diagram of Ammonia sensitive circuit</figcaption></figure>

Impedance matching circuit is a voltage follower constituted by CA3140. As shown, CA3140 input impedance is as large as 1.5TΩ, therefore has a very low input current. Connect resistors 15M to positive output of glass electrode and 1000pF polystyrene capacitors to negative output. Then access to the CA3140 positive input port.
<figure><img src="image_6.png" /><figcaption>Fig. 5 Impedance matching circuit</figcaption></figure>

Low-pass filter circuit is a II-type RC filter constituted by a TLC27L4, and it is also a bidirectional integration filter. We can adjust the RC value to precisely control the time constant. In this experiment, the low-pass filter cutoff frequency is 50Hz. When the external interference is greater than 50Hz, the interference signal will be attenuated less than 45db. This circuit has a good filtering effect.

<figure><img src="image_7.png" /><figcaption>Fig. 6 Low-pass filter circuit</figcaption></figure>

3.3 Temperature compensation

Temperature compensation circuit is used to ensure the circuit working properly and stability in a certain temperature range. Some devices have difference of the positive temperature coefficient and the negative temperature coefficient such as transistors, diodes, resistors. When temperature rises, positive temperature coefficient devices' effect will increase, and the negative coefficients devices have opposite effect.

Since platinum RTD has good stability, on line analyzers always use it to automatically compensate for temperature. The working principle of platinum PRD is to transform the changes of temperature into the changes of resistance. The following figure is Pt100 platinum resistance's resistance changes with temperature. In the range of 0-100°C.
<figure><img src="image_8.png" /><figcaption>Fig. 7 Temperature compensation circuit</figcaption></figure>

Operational amplifiers and platinum thermal resistance may constitute automatic temperature compensation circuit. In this circuit A is the integrated operational amplifier, Rt is a platinum RTD, Vi is the output signal of the transmitter. When the input signal Vi is not the maximum value, the output signal V0 is always constant in the range of 0-100°C. So this kind of circuit realized the purpose of automatic temperature compensation

## 4 Software design of ammonia smart sensor

First, initialize, and then detect whether there is power and communication signals. If a signal is entered, convert the analog signal is to digital signal. According to predetermined Nernst equation to calculate the concentration of ammonia nitrogen. Finally transfer the data to PC via the serial port[12].
<figure><img src="image_9.png" /><figcaption>Fig. 8 Software flow chart</figcaption></figure>

The digital filter is an important foundation for digital signal processing in the signal filtering, monitoring and parameter estimation process. It is the most widely used of a new system. Digital filter is complete signal filtering functions, using finite precision arithmetic to achieve discrete-time linear time-invariant systems. The inputs are a group of analog signal sampling and quantization coding of the digital, the output is another set of digital which had been digital conversion. Digital filter has high stability, high accuracy, flexibility and other prominent features.

IIR digital filter system function can be written in the form of closed functions. Which using recursive structure, namely the structure with a feedback loop. IIR filter structures are usually composed by the basic operations such as delay, multiplied by the coefficient and adding.

An N-order IIR filter system function can be expressed as:

$$H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 + \sum_{k=1}^{N} a_k z^{-k}} \quad (6)$$

$$y(n) = \sum_{k=0}^{M} b_k x(n-k) - \sum_{k=1}^{N} y(n-k) \quad (7)$$
5 Experimental data analysis

Firstly, checking electrode slope, Obtaining the slope value provides the best means
for checking electrode operation. Slope is defined as the change in milivolts
observed with every tenfold change in concentration. This experiment used
9512HPBNWP ammonia electrode. When the solution temperature is in the range
of 20°C to 25°C, the slope should be between -54mV to -60mV. If the slope is not in
this range, which means that ammonia electrode is not working normally,
troubleshoot need to be done firstly.

Analyze the factors that affect ammonia electrode.

In the conditions of a temperature of 25 °C, using standard ammonia solution to configure sample solution of 0.01mg/L, 0.1mg/L, 1mg/L and 10mg/L. added Ionic strength agent to adjust the PH. When PH is equal 7,8,9,10,11, it can measured values of ammonia-sensitive transmitter output of different concentrations of the sample solution. From the measured data can be seen, when the PH is greater than 11, ammonia nitrogen in the solution can be completely converted to free ammonia overflow and accurately measuring the amount of free ammonia.

<figure><img src="image_10.png" /><figcaption>Fig. 9 Curve of ammonia electrode transmitter output voltage follows the PH value</figcaption></figure>

Using standard ammonia solution to configure sample solution of 0.01mg/L, 0.1mg/L, 1mg/L, 10mg/L. Measured ammonia electrode transmitter output value once every 10 °C. In the range of 10°C to 50°C. The measurement results as shown below. When the PH value is greater than 11, it can be seen that the effect of temperature on the concentration of free ammonia is not obvious.

<figure><img src="image_11.png" /><figcaption>Fig. 10 Curve of ammonia electrode transmitter output voltage follows the temperature</figcaption></figure>
Measure the effect of temperature and pH on concentration of free ammonia with a fixed concentration of a sample solution. Recorded ammonia electrode transmitter output value once every 10 °C In the range of 10°C to 50°C. While adjust the pH by the ion strength agents, making pH of the sample solution is stable at 7, 8, 9, 10, 11, 12. By experiment, obtain a curve of ammonia electrode transmitter output voltage follows the temperature and pH in solution of 10mg/L. From the figure can get the conclusion that the same with the above two curves. When the pH is greater than 11, ammonia nitrogen in the solution can be completely converted to free ammonia overflow and accurately measuring the amount of free ammonia. The effect of temperature on the concentration of free ammonia is not obvious from 10°C to 50°C. Therefore, in order to simplify processing, the temperature may be regarded as constant.

<figure><img src="image_12.png" /><figcaption>Fig. 11 Curve of ammonia electrode transmitter output voltage follows the temperature and pH</figcaption></figure>

## 6 Conclusion

According to the actual needs of aquaculture water quality monitoring, to solve the problems that the traditional ammonia detection methods were complex, not easy to maintenance and difficult to realize quick measurement in situ, Ammonia electrode and PH electrode was chosen as the sensing probe. Using both hardware and software filtering to solve the problems that Ion selective electrode output signal is weak and susceptible to be disturbed. A smart ammonia sensor is developed. According to the Nernst equation and characteristics of interactions among free ammonia, ammonium ions, PH and temperature, an algorithm and a relationship between ammonia concentration and voltage signal from ammonia-sensitive probe can be got. This kind of smart sensor achieved rapid detection of ammonia concentration and has many advantages such as need no pretreatment of water samples, simple operation, low cost and no pollution.
Acknowledgment

This work was supported by the National Agricultural Science and technology achievement transformation project (2012GB2E000330), the Fundamental Research Funds for the Central Universities (2013QJ053).

References

[1] Palani S, Liong S Y, Tkalich. An ANN application for water quality forecasting[J]. Marine Pollution Bulletin. 2008, 56(9): 1586~1597.

[2] Dutot A L, Rynkiewicz J, Steiner F. A 24-h forecast of ozone peaks and exceedance levels using neural classifiers and weather predictions[J]. Environmental Modelling & Software. 2007, 22(9): 1261~1269.

[3] Palani S, Liong S Y, Tkalich. An ANN application for water quality forecasting[J]. Marine Pollution Bulletin. 2008, 56(9): 1586~1597.

[4] Rodriguez M J, Sérodes J. Assessing empirical linear and non-linear modelling of residual chlorine in urban drinking water systems[J]. Environmental Modelling and Software. 1998, 14(1): 93~102.

[5] Alp M, Cigizoglu H K. Suspended sediment load simulation by two artificial neural network methods using hydrometeorological data[J]. Environmental Modelling & Software. 2007, 22(1): 2~13.

[6] Waich K, Mayr T, Klimant I. Fluorescence sensors for trace monitoring of dissolved ammonia[J]. Talanta. 2008, 77(1): 66~72.

[7] Ming-Zhi Yang, Ching-Liang Dai and Chyan-Chyi Wu. A Zinc Oxide Nanorod Ammonia Microsensor Integrated with a Readout Circuit on-a-Chip[J] *Sensors* 2011.

[8] P. Temple-Boyer, B. Hajji, J.L. Alay, J.R. Morante, A. Martinez. *Properties of SiOxNy films deposited by LPCVD from SiH4/N2O/NH3 raseous mixture* [J]. *Sensors and Actuators A: Physical*, 2009; Volume 74

[9] Amit L. Sharma, Kamal Kumar, Akash Deep. *Nanostructured polyaniline films on silicon for sensitive sensing of ammonia*[J]. *Sensors and Actuators A: Physical, Volume* 198

[10] Jiarui Huang, Junhai Wang, Cuiping Gu, Kun Yu, Fanli Meng, Jinhuai Liu. A novel highly sensitive gas ionization sensor for ammonia detection [J]. *Sensors and Actuators A: Physical, Volume 150*.

[11] Waich K, Mayr T, Klimant I. Fluorescence sensors for trace monitoring of dissolved ammonia[J]. Talanta. 2008, 77(1): 66~72.

[12] Juncao Li, Nicholas T. Pilkington, Embedded architecture description language, *Journal of Systems and Software*[J], 2009