Sie sind auf Seite 1von 23

WATER QUALITY MONITORING SYSTEM WITH IOT

ROSE NEEZAR BIN ROSE ZAIDI

UNIVERSITI TEKNOLOGI MALAYSIA


WATER QUALITY MONITORING SYSTEM WITH IOT

ROSE NEEZAR BIN ROSE ZAIDI

A project report submitted in partial fulfilment of the


requirements for the award of the degree of
Master of Engineering (Mechatronics and Automatic Control)

Faculty of Electrical Engineering


Universiti Teknologi Malaysia

JUNE 2018
iii

Thanks to ALLAH S.W.T and his Prophet Muhammad S.A.W.

Especially dedicated to my beloved mother who have prayed, supported, encouraged,


guided and inspired me throughout my journey of education.
iv

ACKNOWLEDGEMENT

First and foremost, “Syukur Alhamdulillah” to Allah, the Most Gracious and
Most Merciful for ensuring myself to be healthy to carry out my study and to
complete this project.

Secondly, I would like to express my warmest gratitude to my project


supervisor, Assoc Prof Ir Dr Mohd Ridzuan Ahmad for his guidance, professional
advice, encouragement and support throughout the period in completing this project.
His remarkable ideas and suggestions will be much appreciated in the long run of my
career.

My sincere appreciation also goes to my family especially my mother


Rafidah Binti Othman who has been so tolerant and supportive in all years either
morally or financially. Thanks for her continuous encouragement, love and
emotional supports that she had given to me all this while.

I also would like to gratefully thank to all my lecturers and all my friends
who had given me helps technically and mentally throughout my journey in
completing my project.
v

ABSTRACT

This project proposed an improved method to provide an early detection


system at Semangar water treatment plant as many pollution cases occurred within
the past years had left many housing area without water supply for days. The solution
is based on the idea of developing an alert system, and also a real time database that
can store data ammonia, turbidity and pH. The approach has several notable merits,
namely cost efficient, not changing the existing system as it only act as an additional
feature and higher safety. The idea is proven based on two subsystems. First the early
detection system is based on notification through a mobile application. It provides
user with notification every time the ammonia reading is above 2 parts per million
threshold. Second, The real time database saves the ammonia parameter reading data
every 10 seconds in Google Spreadsheet. The current reading of the chemicals can
also be viewed using a web server which can then be connected through a mobile
application. Database application is not only by Google Spreadsheet but also using
Firebase application which can also be viewed through the mobile application. The
method proposed in this project can be used for any water treatment plant in
Malaysia that’s requires data to be stored and view at any given time.
vi

ABSTRAK

Projek ini mencadangkan penambahbaikan kaedah untuk menyediakan sistem


pengesanan awal pada loji rawatan air Semangar kerana banyak kes pencemaran
yang berlaku dalam tahun-tahun yang lalu telah menyebabkan banyak kawasan
perumahan tanpa bekalan air selama beberapa hari. Penyelesaian ini didasarkan pada
idea untuk membangunkan sistem amaran, dan juga pangkalan data masa nyata yang
boleh menyimpan data ammonia, kekeruhan dan pH. Pendekatan ini mempunyai
beberapa merit yang jelas, iaitu kos yang efisien, tidak mengubah sistem yang sedia
ada kerana ia hanya bertindak sebagai ciri tambahan dan keselamatan yang lebih
tinggi. Idea ini terbukti berdasarkan dua subsistem. Pertama sistem pengesanan awal
didasarkan kepada pemberitahuan melalui aplikasi mudah alih. Ia memberikan
pengguna pemberitahuan setiap kali bacaan ammonia melebihi 2 bahagian per juta
ambang. Kedua, pangkalan data masa nyata menyimpan data bacaan parameter
ammonia setiap 10 saat dalam Google Spreadsheet. Bacaan bahan kimia semasa juga
boleh dilihat menggunakan pelayan web yang kemudiannya boleh dihubungkan
melalui aplikasi mudah alih. Aplikasi pangkalan data bukan sahaja oleh Google
Spreadsheet tetapi juga menggunakan aplikasi Firebase yang juga dapat dilihat
melalui aplikasi mudah alih. Kaedah yang dicadangkan dalam projek ini boleh
digunakan untuk mana-mana loji rawatan air di Malaysia yang memerlukan data
yang akan disimpan dan dilihat pada bila-bila masa.
vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF ABBREVIATIONS xiii
LIST OF APPENDICES xiv

1 INTRODUCTION 1
1.1 Introduction 1
1.2 Motivation of Study 1
1.3 Problem Statement 2
1.4 Research Objectives 3
1.5 Research Scopes 3
1.6 Thesis Outline 4

2 LITERATURE REVIEW 6
2.1 Introduction 6
2.2 Technologies within IoT 7
2.2.1 Zigbee Protocol in Internet of Things 8
viii

2.2.2 WiFi Protocol in Internet of Things 8


2.2.3 Comparison between WiFi and Zigbee Protocol 10
2.3 Platforms used with Internet of Things 10
2.3.1 Arduino in Internet of Things 11
2.3.2 Raspberry Pi in Internet of Things 11
2.3.3 Mobile Application in Internet of Things 12
2.4 Cloud Computing Databases 12
2.4.1 SQL Databases 13
2.4.2 NoSQL Databases 14
2.4.3 Comparison between SQL and NoSQL 15
2.5 Applications in Internet of Things 18
2.5.1 Case Study 1: Real-Time Monitoring via Patch- 18
Type Piezoelectric Force Sensors for Internet of
Things Based Logistics
2.5.2 Case Study 2: Real-Time Safety Early Warning 21
System for Cross Passage Construction in Yangtze
Riverbed Metro Tunnel Based on The Internet of
Things
2.5.3 Case Study 3: Internet of Things Enabled Real 25
Time Water Quality Monitoring System
2.5.4 Case study 4: Architecting an IoT-Enabled 29
Platform for Precision Agriculture and Ecological
Monitoring
2.5.5 Case study 5: IoT and iTV for 34
Interconnection, Monitoring, and Automation
of Common Areas of Residents
2.6 Case Study synthesize 38
2.7 Limitation of Past Researches 39
2.8 Summary 39

3 RESEARCH METHODOLOGY 40
3.1 Introduction 40
3.2 Design Specification 42
3.3 Hardware Specification 43
ix

3.4 Internet of Things: IFTTT 44


3.5 Internet of Things: Firebase 48
3.6 Summary 50

4 RESULTS AND DISCUSSION 51


4.1 Introduction 51
4.2 Real Time Database with IFTTT 51
4.3 Push Notification with IFTTT 53
4.4 Web Server with Firebase 54
4.5 Firebase Database 55
4.6 Mobile Application with Firebase 56
4.7 Summary 58

5 CONCLUSION AND RECOMMENDATION 59


5.1 Conclusion 59
5.2 Future work and Recommendation 60

REFERENCES 61
APPENDICES 65
x

LIST OF TABLES

TABLE NO. TITLE PAGE

2.1 Comparison between ZigBee and WiFi protocol 9


2.2 Comparison between SQL and NoSQL 16
2.3 Case study classification 38
3.1 Design specification 41
3.2 Hardware specification 42
3.3 Middleware comparison 45
xi

LIST OF FIGURES

FIGURE NO. TITLE PAGE

2.1 IoT architecture 7


2.2 Block diagram of the WSN system 9
2.3 System architecture of Arduino and Raspberry Pi 12
2.4 Diagram of framework 13
2.5 SELECT queries comparison of SQL and NoSQL 17
2.6 INSERT queries comparison of SQL and NoSQL 17
2.7 Patch type piezoelectric sensor 19
2.8 Micro controller with Bluetooth and its block diagram 19
2.9 In-vehicle Infotainment System showing the App (iTape) 20
and the online cloud monitoring
2.10 Architecture of an Iot-based safety early warning system 21
2.11 FBG at freezing pipes for frozen soil and at segment surface 22
2.12 Safety information transmitting layer 22
2.13 RFID location 23
2.14 Real-time tracking result in Iot based safety early warning 24
system
2.15 Circuit diagram of the system 26
2.16 Database layout of Ubidots cloud database application 27
2.17 Widgets for parameter monitoring 28
2.18 Alert events of Ubidots 29
2.19 Message sent from cloud database to smart phone 29
2.20 Context view of agriculture employing Iot technology 31
2.21 Illustration of sensor data to JSON API 31
xii

2.22 System components from implementation perspective 32


2.23 Smart agriculture node 33
2.24 Sensor data of the IoT node at the field 34
2.25 Smart residents Architecture 35
2.26 Sensor data stored in channels by ThingSpeak 36
2.27 Smart resident application interface 37
2.28 Smart resident inspect the temperature sensor data 37
3.1 Flowchart of the overall project 41
3.2 Overall architecture of IoT implementation 44
3.3 IFTTT setup 46
3.4 CRUD function 47
3.5 Flowchart of connecting to Firebase 48
3.6 Firebase database 49
3.7 Podfile connecting to Firebase 50
4.1 Online database via google spreadsheets 52
4.2 Push notification of the device 53
4.3 Web server html file 54
4.4 Web server 55
4.5 Firebase database 56
4.6 Overall application layout 57
xiii

LIST OF ABBREVIATIONS

IoT - Internet of Things


WQI - Water Quality Index
ML - Machine Learning
IFTTT - If This Then That
ESP32 - Espressif 32 bit architecture
RMSE - Root Mean Square Error
MLP - Multilayer Perceptron
GB - Gigabytes
MB - Megabyte
ROM - Read Only Memory
PWM - Pulse Width Modulation
CRUD - Create Read Update Delete
BLE - Bluetooth Low Energy
LED - Light Emitting Diode
xiv

LIST OF APPENDICES

APPENDIX TITLE PAGES

A Arduino code for IFTTT 65


B Arduino code for Firebase 69
CHAPTER 1

INTRODUCTION

1.1 Background of study

The purpose of this project is to translate the information given from the
sensor reading towards the internet for cloud computing and classify the data based
on capacitance reading from ammonia. Water is an essential natural resources for all
human kind. But rapid development projects and human activities has caused
contamination to the water resources. In today’s technology, the method used to test
the water quality is to have operators perform the duty of collecting a sample of the
water resources a few times per day and conduct the testing for the sample in a lab.
This process is tedious and time consuming as it does not monitor the water
resources continuously but only at certain time frame of the day. Furthermore, this
can cause problems if a contamination were to occur during the time when testing
was not being conducted. Internet of Things (IoT) technologies provide a solution to
this as it can monitor the water quality at all times and bring about data which can be
used for analysis purposes in real time on the cloud. This system can provide an early
warning system for which if a contamination were to occur [1].
2

1.2 Motivation of Study

Water is an essential part of life. Contaminated water is also the leading cause
of death, higher than any act of violence including war. In Malaysia, water treatment
plants supply the water supply to the residential and industrial areas. If the water
treatment plants were to be closed, the said areas will not have any water. The water
treatment plants will be closed due to polluted water from the river. Valves controls
the flow of water connecting the water treatment plant and the said areas. If the valve
is closed before the contaminated water reach the water tank then said areas would
still have water. What this project do to solve this problem is to create an early
monitoring system with cloud computing in order to prevent the valves from being
closed too late.
.

1.3 Problem Statement

The main problem with the IoT is the storage system. A typical IoT device
can accumulate thousands of data, thus a large storage systems needed. Notification
on how to use push is also a topic of discussion. When to alert user based on the
water status is also a problem that needs to be solved.

Current practices implemented at the water treatment plant is also an issue


when doing this project. The way things work now with respect to checking the
water source status whether it is high in ammonia content or not is that technicians
check the site every 2 hours. If the water is deemed high in ammonia, there would be
no real treatment to it, the plant would need to stop operation and allow the water to
naturally lower its ammonia content.
3

The water treatment plants purpose was only to get the chemical compound
reading of the water and sent it to Bakal Setia Air Johor (BAKAJ), for BAKAJ is the
one that decides what the next step is going to be taken. Stopping the plant operation
requires BAKAJ approval even if the technician confirms the water is polluted.
BAKAJ action is not immediate when they receive information knowing that the
water is polluted. They would wait around a few hours to half a day to really confirm
the water is polluted then only they would instruct the water treatment plant to stop
operation. With the time wasted, polluted water would already be in the residential
water supply tank thus would prevent people from getting their water. This project
needs to close this gap to prevent this situation from ever happening again.

1.4 Research Objectives

The objective of this project can be divided into three main objectives that are:
i. To implement real time cloud computing database function onto the
existing device to allow for backlogging capability.
ii. To implement an alerting system for when the water condition is declared
polluted based on ammonia level from the sensor.
iii. To compare between Firebase and IFTTT middleware based on their
features.

1.5 Research Scope

The scopes of this project are:


i. ESP32 is used to read from micro-fludic sensor based on capacitance
value.
4

ii. Middleware IFTTT with WiFi protocol is used to bridge the sensor and
cloud communication.
iii. Real time database and alerting notification can be viewed through
mobile phones.
iv. Experiment is done in a lab environment with controlled (100 mililitre
syringe) amount of water test samples.
v. Apple development program was used as the mobile platform.
.

1.6 Thesis Outline

This thesis consists of five chapters. Chapter 1 introduces the motivation of


the study, problem statement, objective of this project, scope of project and the
overall thesis outline.

Chapter 2 focuses on literature reviews related to this project based on


journals and other references. An introduction on IoT and databases was explained
based on their applications towards data storage and monitoring features.

Chapter 3 mainly discussed the methodology of the project. The method to


connect to If This Then That (IFTTT) server then use the notification feature and
Google Spreadsheet database. Web server used to connect to the IOS application for
Firebase was also discussed and explained.

Chapter 4 presents the results of the project. The discussion focused on the
difference in features provided by the IFTTT and Firebase. The result of the project
is based largely on the finished application and the features ability in fulfilling the
objectives of this project.
5

Chapter 5 concludes the project as a whole. The recommendation for future


works was also suggested in this.
REFERENCES

[1] T. Perumal, N. Sulaiman, and C. Y. Leong, “Internet of Things ( IoT )


Enabled Water Monitoring System,” 2015 IEEE 4th Glob. Conf. Consum.
Electron. Internet, pp. 86–87, 2015.

[2] S. Madakam, R. Ramaswamy, and S. Tripathi, “Internet of Things (IoT): A


Literature Review,” J. Comput. Commun., vol. 3, no. 5, pp. 164–173, 2015.

[3] C.-W. Tsai, C.-F. Lai, and A. V. Vasilakos, “Future Internet of Things: open
issues and challenges,” Wirel. Networks, vol. 20, no. 8, pp. 2201–2217, 2014.

[4] J. E. Ibarra-Esquer, F. F. González-Navarro, B. L. Flores-Rios, L. Burtseva,


and M. A. Astorga-Vargas, “Tracking the evolution of the internet of things
concept across different application domains,” Sensors (Switzerland), vol. 17,
no. 6, pp. 1–24, 2017.

[5] H. Y. Kim and J. M. Kim, “A load balancing scheme based on deep-learning


in IoT,” Cluster Comput., vol. 20, no. 1, pp. 873–878, 2017.

[6] X. Yi, Z. Jia, N. Chen, W. Zhu, and Z. Wu, “The research and
implementation of ZigBee protocol-based internet of things embedded
system,” 2010 2nd Int. Symp. Inf. Eng. Electron. Commer. IEEC 2010, pp.
341–344, 2010.

[7] Chunxiao Fan, Zhigang Wen, Fan Wang, and Yuexin Wu, “A middleware of
Internet of Things (IoT) based on ZigBee and RFID,” IET Int. Conf.
Commun. Technol. Appl. (ICCTA 2011), pp. 732–736, 2011.

[8] H. G. C. Ferreira, E. Dias Canedo, and R. T. De Sousa, “IoT architecture to


enable intercommunication through REST API and UPnP using IP, ZigBee
and arduino,” Int. Conf. Wirel. Mob. Comput. Netw. Commun., pp. 53–60,
2013.
62

[9] T. Thaker, “ESP8266 based implementation of wireless sensor network with


Linux based web-server,” 2016 Symp. Colossal Data Anal. Networking,
CDAN 2016, 2016.

[10] R. K. Kodali and A. Naikoti, “ECDH based security model for IoT using
ESP8266,” 2016 Int. Conf. Control Instrum. Commun. Comput. Technol.
ICCICCT 2016, pp. 629–633, 2016.

[11] G. Barbon, M. Margolis, F. Palumbo, F. Raimondi, and N. Weldin, “Taking


Arduino to the Internet of Things: The ASIP programming model,” Comput.
Commun., vol. 89–90, pp. 128–140, 2016.

[12] B. Jo and Z. Baloch, “Internet of things-based arduino intelligent monitoring


and cluster analysis of seasonal variation in physicochemical parameters of
Jungnangcheon, an urban stream,” Water (Switzerland), vol. 9, no. 3, 2017.

[13] M. Ibrahim, A. Elgamri, S. Babiker, and A. Mohamed, “Internet of things


based smart environmental monitoring using the Raspberry-Pi computer,”
2015 Fifth Int. Conf. Digit. Inf. Process. Commun., pp. 159–164, 2015.

[14] S. Chang and K. Jeong, “A mobile application for fine dust monitoring
system,” Proc. - 18th IEEE Int. Conf. Mob. Data Manag. MDM 2017, pp.
336–339, 2017.

[15] A. Joseph, B. Shrestha, A. Joseph, K. J. Singh, and K. R. P, “Web and


Android based Automation using IoT Web and Android based Automation
using IoT,” IEEE Int. Conf. Collab. Comput. Networking, Appl. Work ,pp.
214-228, 2017.

[16] D. Bruneo, S. Distefano, F. Longo, G. Merlino, A. Puliafito, and A. Zaia,


“Head in a Cloud : an Approach for Arduino YUN Virtualization,” Proc.
2017 5th ICT Int. Student Proj. Conf. ICT-ISPC 2017, pp. 120–134, 2017.
63

[17] H. Fatima and K. Wasnik, “Comparison of Sql , Nosql and New Sql
Databases in Light of Internet of Things – a Survey,” Procedia Comput. Sci.,
vol. 110, no. January, pp. 2–5, 2016.

[18] S. Rautmare and D. M. Bhalerao, “MySQL and NoSQL database comparison


for IoT application,” 2016 IEEE Int. Conf. Adv. Comput. Appl. ICACA 2016,
pp. 235–238, 2016.

[19] P. T. A. Mai, J. K. Nurminen, and M. Di Francesco, “Cloud databases for


internet-of-things data,” Proc. - 2014 IEEE Int. Conf. Internet Things, iThings
2014, 2014 IEEE Int. Conf. Green Comput. Commun. GreenCom 2014 2014
IEEE Int. Conf. Cyber-Physical-Social Comput. CPS 20, no. iThings, pp.
117–124, 2014.

[20] Y. J. Heo, S. M. Oh, W. S. Chin, and J. W. Jang, “A lightweight platform


implementation for Internet of things,” Proc. - 2015 Int. Conf. Futur. Internet
Things Cloud, FiCloud 2015 2015 Int. Conf. Open Big Data, OBD 2015, pp.
526–531, 2015.

[21] A. Daramas, S. Pattarakitsophon, K. Eiumtrakul, T. Tantidham, and N.


Tamkittikhun, “HIVE: Home Automation System for Intrusion Detection,”
Proc. 2016 5th ICT Int. Student Proj. Conf. ICT-ISPC 2016, pp. 101–104,
2016.

[22] J. Boman, J. Taylor, and A. Ngu, “Flexible IoT Middleware for Integration of
Things and Applications,” Proc. 10th IEEE Int. Conf. Collab. Comput.
Networking, Appl. Work., pp. 481–488, 2014.

[23] M. A. G. Maureira and L. Teernstra, “ThingSpeak – an API and Web Service


for the Internet of Things,” 2011 Fifth Int. Conf. Digit. Inf. Process.
Commun., pp. 140–149, 2011.

[24] C. H. Chuang, W. C. Weng, W. J. Chang, and D. H. Lee, “Real-time


monitoring via patch-type piezoelectric force sensors for Internet of Thing in
64

logistics,” 2016 IEEE 11th Annu. Int. Conf. Nano/Micro Eng. Mol. Syst.
NEMS 2016, vol. 17, no. 8, pp. 325–328, 2016.

[25] L. Y. Ding et al., “Real-time safety early warning system for cross passage
construction in Yangtze Riverbed Metro Tunnel based on the internet of
things,” Autom. Constr., vol. 36, pp. 25–37, 2013.

[26] S. Geetha and S. Gouthami, “Internet of things enabled real time water
quality monitoring system,” Smart Water, vol. 2, no. 1, p. 1, 2016.

[27] F. Karim, F. Karim, and A. Frihida, “Monitoring system using web of things
in precision agriculture,” Procedia Comput. Sci., vol. 110, pp. 402–409,
2017.

[28] T. Popović, N. Latinović, A. Pešić, Ž. Zečević, B. Krstajić, and S.


Djukanović, “Architecting an IoT-enabled platform for precision agriculture
and ecological monitoring: A case study,” Comput. Electron. Agric., vol. 140,
pp. 255–265, 2017.

[29] H. Sánchez, C. González-Contreras, J. Agudo, and M. Macías, “IoT and iTV


for Interconnection, Monitoring, and Automation of Common Areas of
Residents,” Appl. Sci., vol. 7, no. 7, p. 696, 2017.

[30] M. Di Francesco, N. Li, M. Raj, and S. K. Das, “A storage infrastructure for


heterogeneous and multimedia data in the Internet of Things,” Proc. - 2012
IEEE Int. Conf. Green Comput. Commun. GreenCom 2012, Conf. Internet
Things, iThings 2012 Conf. Cyber, Phys. Soc. Comput. CPSCom 2012, pp.
26–33, 2012.

Das könnte Ihnen auch gefallen