Tải bản đầy đủ (.pdf) (10 trang)

Design and fabrication of an online low cost monitoring and warning system for temperature and pH of water

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (616.91 KB, 10 trang )

Research

DESIGN AND FABRICATION OF AN ONLINE LOW-COST
MONITORING AND WARNING SYSTEM FOR TEMPERATURE
AND pH OF WATER
Pham Van Thanh*, Nguyen Tien Dat, Dang Xuan Bai,
Nguyen Thi Phong, Vi Van Hoang
Abstract: In this study, an online low-cost monitoring and warning system for
pH and temperature of water is presented with the design and construction
described in detail. This system was constructed based on the low cost 8-bit
Microcontroller Atmega 16 and sensor node for real time monitoring. The pH and
temperature of water were measured in-pipe and on-line. This system is suitable to
measure pH in the range from 2 to 10 and temperature from 0 to 90 oC. The
accuracy of pH and temperature was estimated about ±0.1 and ±0.32 oC,
respectively. These measured parameters were successfully uploaded to
thingspeak.com through GPRS service in real time. Specially, these parameters were
automatically evaluated based on QCVN 01:2009/BYT standard for tap water. If one
of measured parameters was out of standard ranges, a warning SMS message was
sent to the selected mobile number. The obtained results showed that the fabricated
system is stable for longtime with reliable results. Because of low-cost, good
accuracy and on-line measurement, this system is suitable for monitoring multiparameters of water in real time.
Keywords: pH; Temperature; Internet of Thing; Drinking water; GPRS.

1. INTRODUCTION
Clean drinking water is very important for the health of all humans. However,
drinking water have many challenges because of limited resources, growing
population, industrial activities, attention of safeguarding water supplies from
accidental or deliberate contamination [1]. Therefore, it is needed to have an online water monitoring systems to detect contaminations and quickly evaluate the
drinking water quality in real time.
To evaluate the quality water, many multi-parametric sensor arrays and water
quality monitoring systems have been developed and reported in previous articles.


Lambrou suggested some main parameters of drinking water which are suitable for
real time monitoring including temperature, turbidity, oxidation reduction potential
(ORP), pH, and electrical conductivity (EC) [1]. Martínez-Máñez reported a multisensor based on thick-film technology to control the water quality; especially, a
stationary unit for water quality monitoring was successfully constructed by using
Analog Data Acquisition Card Adlink PCI 9112 connected to personal computer
[2]. An integrated multi-sensor based on semiconductor RuO2 nanostructures for
water quality assessment on temperature, pH, conductivity and turbidity was
designed and fabricated by Serge Zhuiykov et al [3, 4]. Haijiang Tai presented a
smart turbidity transducer with temperature compensation for distributed
measurement system [5]. In addition, Ruan Yue reported a water quality

Journal of Military Science and Technology, Special Issue, No.54A, 05 - 2018

27


Electronics & Automation

monitoring system based on solar power supply and wireless sensor network in
which the pH and turbidity of water were successfully measured in real time [6].
Furthermore, a colorimeter was also implemented by Anzalone et al based on the
open-source Arduino prototyping platform [7]. These researches show that the
smart and online monitoring system for assessment on the quality of water is very
interesting and need to develop more in future. However, these researches have not
yet had automatic warning function if one of water’s parameters is out of standard
which is very important for automatic on-line system.
In this report, we designed and constructed an on-line automatically monitoring
and warning system for pH and temperature of water. This system was fabricated
based on a low-cost 8 bit Microcontroller Atmega 16. The sensor node including
pH and temperature sensors was developed based on Hanna HI-1110B and

DS18B20 sensors, respectively. Obtained data were successfully uploaded to
thingspeak.com through GPRS service base on Module SIM800C. Especially,
when one of pH and temperature parameters is out of the standards for drinking
water, a warning SMS message is sent to a selected mobile number.
2. EXPERIMENTS
2.1. Materials
The Hanna HI-1110B combination electrode is used as pH sensor, in which the
electrolyte is gel filled and Ag/AgCl electrode is reference electrode. The digital
temperature sensor DS18B20 (Maxim Integrated TM) is used to measure water’s
temperature. The casing of sensor node casing of sensor node is 21-mm diameter
PVC tube (Tien Phong Plastic Joint-Stock company). The central processing of
system is the low-cost 8 bit Microcontroller Atmega 16 (Atmel Corporation)
installed on KIT AVR V4 (Minh Ha Group) for developer. The obtained
parameters is uploaded to thingspeak.com through GPRS service based on the
Module SIM800C, this module is also used to send a warning SMS message if any
parameter of water is out of the standard range.

a)
b)
c)
d)
Figure 1. Components of systems: (a) pH combination sensor Hanna HI-1110B,
(b) temperature sensor DS18B20 in waterproof casing, (c) Kit AVR V4, and (d)
Module SIM800C.
The FOX-2005 temperature meter is used as reference to evaluate accuracy of
temperature measurement. The Hanna pH buffer solutions with the pH variation of
4, 7, and 10 are used to calibrate the pH measurement. All components of this
28

P. V. Thanh, …, V. V. Hoang, “Design and fabrication … temperature and pH of water.”



Research

system is shown in Figure 1. The program of this system was written and compiled
by Atmel Studio 6. The approximate cost of system’s components is shown in
Table 1; it is shown that the total cost of system is about 120.5$ at the time of
manufacture.
Table 1. Approximate system’s component costs.
Components
Approximate cost ($)
Hanna HI-1110B
75
DS18B20
1.5
Kit AVR V4 including Atmega 16
25
LCD 16x2
3
Module SIM800C
10.5
21-mm diameter PVC
~ 5.5
Total
~120.5
2.2. System’s architecture and algorithms

a)
b)
Figure 2. (a) Architecture and (b) block diagram of fabricated system.

Architecture and block diagram of this system is shown in Figure 2. The sensor
node includes pH sensor (Hanna HI-1110B) and temperature sensor (DS18B20).
The casing of the sensor node was fabricated by the 21-mm diameter PVC pipe
due to its stable, high chemical resistance and low-cost. An electric valve is
mounted on the PVC pipe to control time of water flow by PA2 pad of Atmega 16.
In this system, the DS18B20 sensor communicates with Atmega 16 over a 1-Wire
Journal of Military Science and Technology, Special Issue, No.54A, 05 - 2018

29


Electronics & Automation

bus through PA0 pad of Atmega 16. While the output potential of pH sensor was
amplified and then connected to Analog-to-Digital-Converter channel 0 (ADC0) of
Atmega 16, the 10 bit resolution of this ADC0 was selected with internal reference
voltage of 2.56V. The Module SIM800C communicated serially with Atmega 16
by UART protocol. Furthermore, the measured parameters were also displayed on
the Liquid Crystal Display (LCD).
Figure 3 shows the algorithms of this fabricated system. Firstly, the system is
started and resets all parameters of system. Then Atmega 16 opens the electric
valve for 1 minute. Next step, the system measures data and displays them on the
LCD each second. After 60 seconds, the system measures and selects the
temperature of water which would be used to evaluate at end of program. After 300
s, the system measured and selected the pH of water. And then, the system
automatically evaluated the temperature and pH based on QCVN 01:2009/BYT
standards for water. If temperature is higher than 40 oC (T0) or pH is out of range
from 6.5 (pH1) to 8.5 (pH2), a warning SMS message would be sent to a selected
mobile number. Finally, all logged data are uploaded to thingspeak.com using
GPRS service based on the Module SIM800C.


Figure 3. System’s algorithms.
3. RESULTS AND DISCUSSIONS
3.1. System calibrations
The advantage of the DS18B20 is direct-to-digital to digital temperature sensor,
the resolution of this temperature sensor is user-configurable to 9, 10, 11, or 12 bits,

30

P. V. Thanh, …, V. V. Hoang, “Design and fabrication … temperature and pH of water.”


Research

corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C,
respectively [8]. In this fabricated system, the 10 bits resolution of this sensor was
selected. To calibrate and evaluate the accuracy of this sensor, the increasing and
decreasing temperature processes of water were carried out, the water’s
temperature was measured by both of the fabricated temperature system and the
FOX 2005 temperature controller as reference with resolution of 0.01oC. The
increasing temperature process was performed by natural warming of ice-water
from 0oC to 25oC, and the decreasing one was done by natural cooling of hot water
from 90oC down to 25oC. The obtained temperatures shown in Figure 4. For both
processes, the water’s temperatures measured by DS18B20 sensor are very close to
one of the FOX2005, the average errors of the fabricated system were calculated to
be 0.32oC and 0.22oC for the increasing and decreasing processes, respectively.
These results indicated that this DS18B20 is comparable with other systems
reported by Lambrou et al [1] and Yiheng Qin et al [9].
(a)


(b)

Figure 4. The water’s temperature of (a) increasing temperature process and (b)
the decreasing one measured by DS18B20 and FOX 2005.
The Hanna HI-1110B is glass combination pH sensor that converts pH of water
to output potential based on Nernst equation [10] as following:
2.3RT
E  Eo 
log ai
(1)
nF
Where: E is total potential (in millivolts) between the glass electrode and reference
electrode (Ag/AgCl); Eo is the standard potential of the ion; R is the gas constant
(8.314 Jmol-1K-1); T is the temperature; F is Faraday’s constant, which is 9.6437
×104 J V-1mol-1; n is charge of the ion; and ai is the reaction quotient. In the case
of the hydrogen ion in solution, equation 1 represents as following:
E  E o  1.98  104   T  pH

(2)

Where: pH is defined as the negative logarithm of the hydrogen ion activity.
Equation 2 shows that the value of E is linear dependence on pH of solution. The
slope of this dependence will change when temperature changes. Therefore, the
Journal of Military Science and Technology, Special Issue, No.54A, 05 - 2018

31


Electronics & Automation


temperature compensation to slope of this dependence is needed to improve the
accuracy of pH measurement.
Notably, due to the high resistance of about 100 MΩ, the output potential of the
Hanna HI-1110B pH sensor is needed to amplify before applying it to Analog–toDigital Converter (ADC) and then logging by the Atmega 16. The pH amplifier
was designed and fabricated based on TL082 op-amp. The schematic circuit of this
amplifier is shown in Figure 5(a). The output voltage (Vo) of this pH amplifier was
calibrated at room temperature (~25 oC) by the standard buffer solutions with pH
variation of 4, 7, and 10. The linear dependence of Vo versus pH was obtained and
shown in Figure 5(b) with R2=0.9995. The slope (s) of this linear dependence was
estimated to be 99.3 mV/pH.
Based on linear dependence of Vo versus pH, the following equation is used by
the Atmega 16 to convert the value of Vo to pH:
pH  Sv  Vo  1.26
(3)
where Sv=10.07 pH/V. Furthermore, in order to correct the obtained pH value
Sv is compensated for sample’s temperature as following [11]:
T  273.15
S vT  S vcal  cal
(4)
T  273.15
where SvT is compensated slope at T degree of sample, Svcal is slope at calibrated
temperature (Tcal).

(a)

(b)

Figure 5. (a) pH amplifier circuit and (b) Vo vs pH of buffer solution.
By using equation 4, the fabricated system was measured and displayed the pH
values of some solutions which indicate as Table 2. The error of pH measurement

of the fabricated system is estimated about ± 0.07 pH.
Table 2. Measured pH value of some standard buffer solutions.
pH of solution
Measured pH
Error
1.68
1.61
0.07
32

P. V. Thanh, …, V. V. Hoang, “Design and fabrication … temperature and pH of water.”


Research

4.01
7.00
10.01

3.96
6.99
9.94

0.05
0.01
0.07

Furthermore, stability of pH measurement was determined and shown in Figure
6 (a). In these measurements, the buffer solutions with pH of 4, 7 and 10 were used
to measure for about 1 hour and each measurement was performed after 1 min. It is

indicated that the pH measurements is stable for long time with average variation
being about ± 0.1 pH. This obtained result is comparable to other on-line pH
measurement system [1, 9, 12]. Therefore, this system is suitable for on-line pH
measurements of water.
The warning SMS message function of the fabricated system was also
investigated and shown in Figure 6(b). The 5 cases of warning messages were
indicated. In case 1, the sample’s temperature (T0) was shown normal meaning
that T0 is smaller than standard temperature of 40oC, sample’s pH was 3.94 lower
than one of standard range from 6.5 to 8.5. In case 2, the sample’s temperature
(T0) was shown normal, while the sample’s pH was 9.85 higher than pH2=8.5. In
case 3, sample’s pH was normal meaning that which is in range from 6.5 to 8.5; T0
is 70.56 oC higher than 40 oC. In case 4 and 5, the T0s were higher than 40 oC and
values of pH were out of standard range. In the case of T0<40 oC and pH in the
standard range from 6.5 to 8.5, the warning SMS message was not sent. These
obtained results confirmed that the warning SMS message function of the fabricated
system was well operated as system’s algorithms (Figure 3).

Case 1
Case 2
Case 3
Case 4
Case 5

(a)

(b)

Figure 6. (a) Stability of pH measurements,
and (b) warning SMS message function.
Journal of Military Science and Technology, Special Issue, No.54A, 05 - 2018


33


Electronics & Automation

The fabricated system was used to on-line measure the temperature and pH of
tap water at 334 Nguyen Trai – Thanh Xuan – Hanoi. Then the measured data were
successfully uploaded to thingspeak.com (Channel ID: 318914) from Oct 7 to Nov
1 through GPRS service using Module SIM800C (Figure 7). The temperature of
tap water was in the range from 24.45 to 27.91 oC, and its pH was from 7.42 to
7.97. Especially, the lowest temperature was 24.45 oC on Oct 19 corresponding to
the cool day in Hanoi; and the lowest pH was 7.42 on Oct 13 due to heavy rain for
a week before. Therefore, these obtained data are reliable and accuracy. In
conclusion, the on-line measurement function of the fabricated system was
successfully operated.
3.2. On-line measurements

Figure 7. Online measured data of tap water uploaded to thingspeak.com.
4. CONCLUSION
In this article, an online low-cost monitoring and warning system for pH and
temperature of water was designed and fabricated. The obtained data indicated that
this system is stable and reliable for long time measurements. The pH and
temperature of tap water was successfully online measured with accuracy of ±0.1
pH and ±0.32oC, respectively. The measured data were successfully uploaded to
thingspeak.com through GPRS service based on Module SIM800C (Channel ID:
318914). Especially, when anomalies are detected, a warning SMS message is sent
to a selected mobile number indicating what is abnormal; this function is very
useful for manager of system. Because of its low-cost, stability, good accuracy, online measurements and attractive function of warning SMS message, this system is
suitable for water consumers, water companies and authorities.


34

P. V. Thanh, …, V. V. Hoang, “Design and fabrication … temperature and pH of water.”


Research

Acknowledgement: This research is funded by the Vietnam National
University, Hanoi (VNU) under project number QG.15. 11.
REFERENCES
[1]. T. P. Lambrou, et al., "A Low-Cost Sensor Network for Real-Time Monitoring
and Contamination Detection in Drinking Water Distribution Systems",
Sensors Journal, IEEE, Vol. 14, No. 8(2014), pp. 2765-2772.
[2]. Ramón Martínez-Máñez, et al., "A multisensor in thick-film technology for
water quality control", Sensors and Actuators A: Physical, Vol. 120, No.
2(2005), pp. 589-595.
[3]. Serge Zhuiykov, David O'Brien, and Michael Best, "Water quality assessment
by an integrated multi-sensor based on semiconductor RuO2 nanostructures",
Measurement Science and Technology, Vol. 20, No. 9(2009), pp. 095201.
[4]. Serge Zhuiykov, "Solid-state sensors monitoring parameters of water quality
for the next generation of wireless sensor networks", Sensors and Actuators B:
Chemical, Vol. 161, No. 1(2012), pp. 1-20.
[5]. Haijiang Tai, et al., "Design and characterization of a smart turbidity
transducer for distributed measurement system", Sensors and Actuators A:
Physical, Vol. 175, No. (2012), pp. 1-8.
[6]. Ruan Yue and Tang Ying, "A Novel Water Quality Monitoring System Based
on Solar Power Supply & Wireless Sensor Network", Procedia Environmental
Sciences, Vol. 12, Part A, No. 0(2012), pp. 265-272.
[7]. G. C. Anzalone, A. G. Glover, and J. M. Pearce, "Open-source colorimeter",

Sensors (Basel), Vol. 13, No. 4(2013), pp. 5338-5346.
[8]. M. Integrated, "Datasheet of DS18B20-Programmable Resolution 1-Wire
Digital Thermometer ", Avaiable from:
/>[9]. Yiheng Qin, et al., "Integrated water quality monitoring system with pH, free
chlorine, and temperature sensors", Sensors and Actuators B: Chemical, Vol.
255, No. (2018), pp. 781-790.
[10]. Martin L. Thompson and Laura J. Kateley, "The Nernst Equation:
Determination of Equilibrium Constants for Complex Ions of Silver", Journal
of Chemical Education, Vol. 76, No. 1(1999), pp. 95-96.
[11]. Hach Company,"Temperature compensation with pH measurement",
LIT2007, 2013
[12]. J. L. Wu, et al., "Hyperspectral sensing for turbid water quality monitoring
in freshwater rivers: Empirical relationship between reflectance and turbidity
and total solids", Sensors (Basel), Vol. 14, No. 12(2014), pp. 22670-88.

Journal of Military Science and Technology, Special Issue, No.54A, 05 - 2018

35


Electronics & Automation

TÓM TẮT
NGHIÊN CỨU CHẾ TẠO HỆ ĐO ONLINE GIÁ THÀNH THẤP
CÓ KHẢ NĂNG THU THẬP VÀ CẢNH BÁO
THÔNG SỐ NHIỆT ĐỘ VÀ pH CỦA NƯỚC
Trong nghiên cứu này, một hệ thống giá thành thấp có khả năng thu thập
online và cảnh báo thông số pH và nhiệt độ của nước được thiết kế và chế
tạo. Hệ thống được xây dựng dựa trên vi xử lý giá thành thấp 8 bit Atmega 16
và hệ cảm biến cho nhiệm vụ thu thập thông số online và đánh giá kết quả đo.

Hệ thống phù hợp để đo pH trong khoảng từ 2 đến 10 và nhiệt độ từ 0 đến
90oC của nước. Sai số của phép đo pH và nhiệt độ lần lượt là ±0.1pH và
±0.32oC. Các kết quả sau khi đo được gửi lên trang web thingspeak.com sử
dụng mạng di động không dây GPRS theo thời gian thực. Đặc biệt, nếu một
trong các thông số đo đạc vượt chuẩn (QCVN 01:2009/BYT), hệ thống sẽ gửi
tin nhắn cảnh báo tới một số điện thoại xác định. Các kết quả thu được cho
thấy hệ ổn định trong thời gian dài và có độ chính xác cao. Do giá thành
thấp, độ chính xác cao, có khả năng đo online theo thời gian thực, hệ thống
này phù hợp cho mục đích đo đa thông số môi trường nước trong tương lai.
Từ khóa: pH, Nhiệt độ, Internet kết nối vạn vật (IoT), Nước, GPRS.

Received 13th November 2017
Revised 2 nd February 2018
Accepted 15 th April 2018
Author affiliations:
Faculty of Physics, Natural University of Science, Vietnam National University.
*Corresponding author:

36

P. V. Thanh, …, V. V. Hoang, “Design and fabrication … temperature and pH of water.”



×