INTERNET OF THINGS BASED REAL-TIME WATER QUALITY MONITORING SYSTEM FOR WATER STORAGE TANK

Water leaving the treatment plant should be safe and of good quality, but contamination could easily happen along the distribution pipelines. This is due to factors like rusty pipes that cause heavy metals to leach and dissolve in water, damaged or broken pipes that let soil and other contaminants or sewage enter the water. Sediments, scale and algae could also build up on water storage tanks over time. In order to keep track of water quality, this study is aimed to develop a real-time water quality monitoring system in water storage tanks that can be implemented in society, residential areas and restaurant and food service industry by utilizing Internet of Things (IoT) technology. This system employs sensors to collect water quality parameters (pH, temperature, TDS and turbidity), transmits the data wirelessly and uploads it to cloud so users can monitor remotely. The intelligent system can alert users at real-time in case of failing water quality
ORIGINAL POST
By Tan Shin Yin
components
Hardware Components
Arduino Nano
X 1
pH Sensor
X 1
TDS Sensor
X 1
Turbidity Sensor
X 1
Temperature Sensor
X 1
w5100
X 1
Radio-Frequency Transceiver Module
X 1
Software Apps and online services
Arduino IDE
Ubidots Cloud Server
Ubidots Android Mobile App
details

Figure 1.1 Schematic Diagram of a Public Water Supply.jpg

INTRODUCTION

IoT is a thriving trend as the technology of internet is expanding exponentially especially with the recently developed 5G network which promises greater speed. In recent years, there have been many researches on developing IoT water quality monitoring systems in various fields, from aquaculture to rivers and sampled drinking waters. IoT is different from conventional monitoring systems because the sensors take measurements automatically without the need of human intervention and it also has the capability to store and upload the data to a cloud server in which users could access and interact with at anytime and anywhere with internet access.

This project is to design and develop a system that is able to conduct real-time water quality monitoring system, upload the data to cloud platform, display the result data to users in graphical format and make relative deductive reasoning to determine the water quality based on measured data. With the implementation of this IoT water quality monitoring system, the public including society residents and eateries could easily keep an eye on the water they consume daily as well as detect any undesirable conditions with the water promptly. This hardware system would apply a microcontroller as the heart of the embedded system, five sensors (pH, turbidity, TDS, temperature and voltage) and an RF module for transmission of data signals. A software application would be developed as a cloud platform for users to view and control the data.

PROBLEM STATEMENT

Water quality monitoring is important as there is a growing concern that the drinking water quality is deteriorating due to contamination of water bodies from industrial waste, sewage, wastewater, chemical pesticides and fertilizers. Although public water systems install water purifying treatments and monitoring systems, water coming out from the treatment plants could be safe but water is easily contaminated along distribution network due to household plumbing and service lines. Malaysia’s water supply does not contain E.coli bacteria anymore and is safe for drinking (Malaymail, 2018). However, most Malaysians do not drink directly from tap water as the water sometimes contain bad smell, taste and is even brown which is caused by rusty pipelines. Therefore, the locals usually install water filters and often boil water before drinking. However, filtering and boiling water do not completely eliminate all bacteria as substances like lead, nitrates, and pesticides are not affected (WebMD, 2020). Sediments could also accumulate and microorganisms would grow in water in storage tanks as shown in Figure 1.3 below. This results in stagnation of water. Stagnation is a slow process in which the deposits and bacteria cause water to be separated into layers. Stagnant water further attracts insects and crustaceans (Henderson, 2015). There are also rare and usually uncontrollable contaminations due to dead animals or even dead bodies but could have been detected earlier if there were water monitoring systems installed. A dead body was discovered in a water tank which served some 200 condominium residents in Kuala Lumpur. They drank and bathed with the water for five days until the body was found (Baker, 2015).

 

Figure 1.  Dirty water storage tank due to deposits and sedimentation (Stara water hygiene, 2020)

The conventional water quality monitoring is carried out by collecting water samples and sending them to laboratories for testing. This process is slow, expensive and wastes manpower. To cope with the problems stated above, a real-time water quality monitoring system is implemented to check the water quality using various sensors.

AIM AND OBJECTIVE

In this project, the aim is to develop a real-time water quality monitoring system in water storage tanks that can be implemented in society, residential areas and restaurant and food service industry by utilizing Internet of Things technology. The objectives of the project are:

  1. Design and develop an embedded system architecture to perform real-time water quality monitoring based on parameters such as pH, turbidity, temperature and Total Dissolved Solids (TDS).
  2. Integrating IoT into real-time water quality monitoring system to allow users to observe water quality remotely and alerts users through electronic devices such as smartphones or laptops, when water quality is poor.
  3. Develop GUI to display the water quality in a graphical format for greater visual interactions.

SCOPE

The scope of this study is to develop an embedded system that is able to perform real-time water quality in water storage tanks with the integration of IoT. This project is separated into two parts in which the first part is on developing the hardware of the system and the second part is implementing IoT into the system by creating a GUI for users to view data and control particular sensors.

BLOCK DIAGRAM

FLOW CHART

PROTOTYPE DEVELOPMENT

The hardware prototype developed consists of two subsystems: sensor subsystem and receiver subsystem.

  •  Sensor subsystem prototype: A water resistant junction box was used to place all electronic components to protect them from water ingress or water splashed around the prototype. The PCB, batteries and sensor modules are able to fit in the junction box as shown in Figure, though there is limited space for the sensor module breakout board but the selected junction box was the best bargain given the amount of cost allocated for this project.

 

Figure 2 : Electronic hardware system in junction box

Based on Figure 2, two batteries arranged in parallel connection are located at the top of the box and and a 5V USB boost converter will power up the PCB from the Arduino Nano located at the centre of the box. The right side of the box is where the sensor module breakout boards are placed. Six holes of different sizes were drilled to allow the four sensor probes and antenna of nRF24L01 to pass through the junction box as well as to place the main switch for the electronic system. The size of holes depend on the diameter of the probes and wires and the holes were later sealed with silicone sealant and hot glue to prevent water from entering into the box.

In order to place the box on the float with even weight distribution, the box was adjusted to be placed in the middle and above an acrylic sheet. Four L-brackets were used to fasten the junction box and acrylic sheet. The L-brackets were directly screwed and fixed in place using electric screwdriver. Next, six nylon cable ties were used to fasten the acrylic sheet to the PVC float. As for the float, PVC pipe was cut into four segments based on the dimensions calculated and joined by 90º PVC elbows glued using PVC solvent cement. After that, four holes of different sizes were drilled on the acrylic sheet to allow the pH, temperature, TDS and turbidity probes to pass through and immerse in water. The probes were then fixed and glued especially the turbidity sensor as its top is not waterproof. The final prototype of the sensor subsystem is shown in front, top and side views in Figures 3 to 5 below.

 

Figure 3: Sensor Subsystem Prototype Front View

 

Figure 4: Sensor Subsystem Prototype Side View

 

Figure 5: Sensor Subsystem Prototype Top View

 

  • Receiver Subsystem Prototype :  The receiver subsystem is placed indoor next to the router which consists of Arduino Ethernet shield with Arduino Mega powered by 5 V adapter as shown in Figure 4.16. The two-way communication is through the RF module and data received by this subsystem will be uploaded to the cloud via the Ethernet connection from the RJ45 Ethernet cable.

Figure 6: Receiver Subsystem Prototype

PROTOTYPE PERFORMANCE

  • Data Upload and Monitoring On Ubidots Cloud: The receiver subsystem is designed to work such that when data from sensor subsystem is received and internet connection is available, it would upload the data to Ubidots cloud. The data will be stored in Ubidots database and is displayed via the graphical user interface (GUI) or dashboard and can be accessed through the Ubidots website or its mobile application.  The number of variables created for this project in the cloud are 12 in which five variables (purple colured) are real-time sensor data and the other five variables are for backup sensor data (green coloured) whilst the remaining two are log real-time data state (yellow coloured) and time interval (red coloured). Figure 7 below shows the variables created in the cloud, where each variable is issued a unique API key so that the sensor data will be stored to the correct variable. The time and date at the time of upload will be captured.

 

Figure 7: Ubidots cloud database

The dashboard is where the data will be visible to users and displayed in graphical format where the duration range of data is modifiable. Figure 8 shows the snapshot of dashboard for displaying real-time or latest. These static dashboard views are from the Ubidots website viewed from laptop.

 

Figure 8:  Snapshot of dashboard for displaying real-time (latest) data

  • User Request to Log Real-Time Data or Change Time Interval (Ubidots Mobile Application) : User may also perform the similar operations earlier (view graphical data or modify user request) by accessing the Ubidots mobile application from mobile phone.

Figure 10: Snapshot of dashboard accessed through Ubidots mobile application

CONCLUSIONS

In conclusion, this project has successfully developed an Internet of Things water quality monitoring system in water storage tank that can monitor four water quality parameters, i.e. pH, temperature, TDS and turbidity. This system is able to capture the data of these parameters at real-time and allow user to monitor at any time while being remotely away from the water storage tank. The two-way communication between the sensor subsystem placed in the tank and the receiver subsystem placed indoor is made possible by using RF modules with maximum transmission range of 1 km in open space. The sensor subsystem uses Arduino Nano as the microcontroller due to its compact size and lightweight while also being able to support the software development of the sensors used. On the other hand, the receiver subsystem uses Arduino Mega with Ethernet shield to receive sensor data and upload to cloud server.

The IoT platform used in this project is Ubidots because it supports 4,000 dots per day that is more than enough for the normal operation of the developed system. The system will log five sensor data (four water quality parameters and battery voltage data) every 20 minutes by default. Additional features such as real-time notification in the case of failing water quality, preview of historical data in graphical format and user request to control the data logging as well as request to change time interval have also been implemented successfully. The monitoring and controlling of system could also be made via Ubidots mobile application accessed from mobile phone.

A problem related to the pH sensor was encountered when deploying the prototype for data collection. To sum up, all objectives in this project have been achieved successfully. The developed system is able to perform real-time water quality monitoring, alert user when water quality fails, its system settings can be modified by users and the historical data can be tracked and monitored via cloud platform and mobile application.

Figure 1.1 Schematic Diagram of a Public Water Supply.jpg

INTRODUCTION

IoT is a thriving trend as the technology of internet is expanding exponentially especially with the recently developed 5G network which promises greater speed. In recent years, there have been many researches on developing IoT water quality monitoring systems in various fields, from aquaculture to rivers and sampled drinking waters. IoT is different from conventional monitoring systems because the sensors take measurements automatically without the need of human intervention and it also has the capability to store and upload the data to a cloud server in which users could access and interact with at anytime and anywhere with internet access.

This project is to design and develop a system that is able to conduct real-time water quality monitoring system, upload the data to cloud platform, display the result data to users in graphical format and make relative deductive reasoning to determine the water quality based on measured data. With the implementation of this IoT water quality monitoring system, the public including society residents and eateries could easily keep an eye on the water they consume daily as well as detect any undesirable conditions with the water promptly. This hardware system would apply a microcontroller as the heart of the embedded system, five sensors (pH, turbidity, TDS, temperature and voltage) and an RF module for transmission of data signals. A software application would be developed as a cloud platform for users to view and control the data.

PROBLEM STATEMENT

Water quality monitoring is important as there is a growing concern that the drinking water quality is deteriorating due to contamination of water bodies from industrial waste, sewage, wastewater, chemical pesticides and fertilizers. Although public water systems install water purifying treatments and monitoring systems, water coming out from the treatment plants could be safe but water is easily contaminated along distribution network due to household plumbing and service lines. Malaysia’s water supply does not contain E.coli bacteria anymore and is safe for drinking (Malaymail, 2018). However, most Malaysians do not drink directly from tap water as the water sometimes contain bad smell, taste and is even brown which is caused by rusty pipelines. Therefore, the locals usually install water filters and often boil water before drinking. However, filtering and boiling water do not completely eliminate all bacteria as substances like lead, nitrates, and pesticides are not affected (WebMD, 2020). Sediments could also accumulate and microorganisms would grow in water in storage tanks as shown in Figure 1.3 below. This results in stagnation of water. Stagnation is a slow process in which the deposits and bacteria cause water to be separated into layers. Stagnant water further attracts insects and crustaceans (Henderson, 2015). There are also rare and usually uncontrollable contaminations due to dead animals or even dead bodies but could have been detected earlier if there were water monitoring systems installed. A dead body was discovered in a water tank which served some 200 condominium residents in Kuala Lumpur. They drank and bathed with the water for five days until the body was found (Baker, 2015).

 

Figure 1.  Dirty water storage tank due to deposits and sedimentation (Stara water hygiene, 2020)

The conventional water quality monitoring is carried out by collecting water samples and sending them to laboratories for testing. This process is slow, expensive and wastes manpower. To cope with the problems stated above, a real-time water quality monitoring system is implemented to check the water quality using various sensors.

AIM AND OBJECTIVE

In this project, the aim is to develop a real-time water quality monitoring system in water storage tanks that can be implemented in society, residential areas and restaurant and food service industry by utilizing Internet of Things technology. The objectives of the project are:

  1. Design and develop an embedded system architecture to perform real-time water quality monitoring based on parameters such as pH, turbidity, temperature and Total Dissolved Solids (TDS).
  2. Integrating IoT into real-time water quality monitoring system to allow users to observe water quality remotely and alerts users through electronic devices such as smartphones or laptops, when water quality is poor.
  3. Develop GUI to display the water quality in a graphical format for greater visual interactions.

SCOPE

The scope of this study is to develop an embedded system that is able to perform real-time water quality in water storage tanks with the integration of IoT. This project is separated into two parts in which the first part is on developing the hardware of the system and the second part is implementing IoT into the system by creating a GUI for users to view data and control particular sensors.

BLOCK DIAGRAM

FLOW CHART

PROTOTYPE DEVELOPMENT

The hardware prototype developed consists of two subsystems: sensor subsystem and receiver subsystem.

  •  Sensor subsystem prototype: A water resistant junction box was used to place all electronic components to protect them from water ingress or water splashed around the prototype. The PCB, batteries and sensor modules are able to fit in the junction box as shown in Figure, though there is limited space for the sensor module breakout board but the selected junction box was the best bargain given the amount of cost allocated for this project.

 

Figure 2 : Electronic hardware system in junction box

Based on Figure 2, two batteries arranged in parallel connection are located at the top of the box and and a 5V USB boost converter will power up the PCB from the Arduino Nano located at the centre of the box. The right side of the box is where the sensor module breakout boards are placed. Six holes of different sizes were drilled to allow the four sensor probes and antenna of nRF24L01 to pass through the junction box as well as to place the main switch for the electronic system. The size of holes depend on the diameter of the probes and wires and the holes were later sealed with silicone sealant and hot glue to prevent water from entering into the box.

In order to place the box on the float with even weight distribution, the box was adjusted to be placed in the middle and above an acrylic sheet. Four L-brackets were used to fasten the junction box and acrylic sheet. The L-brackets were directly screwed and fixed in place using electric screwdriver. Next, six nylon cable ties were used to fasten the acrylic sheet to the PVC float. As for the float, PVC pipe was cut into four segments based on the dimensions calculated and joined by 90º PVC elbows glued using PVC solvent cement. After that, four holes of different sizes were drilled on the acrylic sheet to allow the pH, temperature, TDS and turbidity probes to pass through and immerse in water. The probes were then fixed and glued especially the turbidity sensor as its top is not waterproof. The final prototype of the sensor subsystem is shown in front, top and side views in Figures 3 to 5 below.

 

Figure 3: Sensor Subsystem Prototype Front View

 

Figure 4: Sensor Subsystem Prototype Side View

 

Figure 5: Sensor Subsystem Prototype Top View

 

  • Receiver Subsystem Prototype :  The receiver subsystem is placed indoor next to the router which consists of Arduino Ethernet shield with Arduino Mega powered by 5 V adapter as shown in Figure 4.16. The two-way communication is through the RF module and data received by this subsystem will be uploaded to the cloud via the Ethernet connection from the RJ45 Ethernet cable.

Figure 6: Receiver Subsystem Prototype

PROTOTYPE PERFORMANCE

  • Data Upload and Monitoring On Ubidots Cloud: The receiver subsystem is designed to work such that when data from sensor subsystem is received and internet connection is available, it would upload the data to Ubidots cloud. The data will be stored in Ubidots database and is displayed via the graphical user interface (GUI) or dashboard and can be accessed through the Ubidots website or its mobile application.  The number of variables created for this project in the cloud are 12 in which five variables (purple colured) are real-time sensor data and the other five variables are for backup sensor data (green coloured) whilst the remaining two are log real-time data state (yellow coloured) and time interval (red coloured). Figure 7 below shows the variables created in the cloud, where each variable is issued a unique API key so that the sensor data will be stored to the correct variable. The time and date at the time of upload will be captured.

 

Figure 7: Ubidots cloud database

The dashboard is where the data will be visible to users and displayed in graphical format where the duration range of data is modifiable. Figure 8 shows the snapshot of dashboard for displaying real-time or latest. These static dashboard views are from the Ubidots website viewed from laptop.

 

Figure 8:  Snapshot of dashboard for displaying real-time (latest) data

  • User Request to Log Real-Time Data or Change Time Interval (Ubidots Mobile Application) : User may also perform the similar operations earlier (view graphical data or modify user request) by accessing the Ubidots mobile application from mobile phone.

Figure 10: Snapshot of dashboard accessed through Ubidots mobile application

CONCLUSIONS

In conclusion, this project has successfully developed an Internet of Things water quality monitoring system in water storage tank that can monitor four water quality parameters, i.e. pH, temperature, TDS and turbidity. This system is able to capture the data of these parameters at real-time and allow user to monitor at any time while being remotely away from the water storage tank. The two-way communication between the sensor subsystem placed in the tank and the receiver subsystem placed indoor is made possible by using RF modules with maximum transmission range of 1 km in open space. The sensor subsystem uses Arduino Nano as the microcontroller due to its compact size and lightweight while also being able to support the software development of the sensors used. On the other hand, the receiver subsystem uses Arduino Mega with Ethernet shield to receive sensor data and upload to cloud server.

The IoT platform used in this project is Ubidots because it supports 4,000 dots per day that is more than enough for the normal operation of the developed system. The system will log five sensor data (four water quality parameters and battery voltage data) every 20 minutes by default. Additional features such as real-time notification in the case of failing water quality, preview of historical data in graphical format and user request to control the data logging as well as request to change time interval have also been implemented successfully. The monitoring and controlling of system could also be made via Ubidots mobile application accessed from mobile phone.

A problem related to the pH sensor was encountered when deploying the prototype for data collection. To sum up, all objectives in this project have been achieved successfully. The developed system is able to perform real-time water quality monitoring, alert user when water quality fails, its system settings can be modified by users and the historical data can be tracked and monitored via cloud platform and mobile application.

COMMENTS

Please Login to comment
  Subscribe  
Notify of