Available online at www.sciencedirect.com
ScienceDirect
Available online at www.sciencedirect.com Procedia Computer Science 00 (2018) 000–000
ScienceDirect
www.elsevier.com/locate/procedia
Procedia Computer Science 124 (2017) 698–705
4th Information Systems International Conference 2017, ISICO 2017, 6-8 November 2017, Bali, Indonesia
Design and Implementation of Real-Time Mobile-based Water Temperature Monitoring System Paul B. Bokingkito Jr.a*, Orven E. Llantosb Mindanao State University – Buug, Datu Panas, Buug, Zamboanga Sibugay 7009, Philippines Mindanao State University – Iligan Institute of Technology, Tibanga, Iligan City 9200, Philippines a
b
Abstract In this age of international trade and competition, the aquaculture industry needs to plan and implement a technology that will address issues concerning global food security. In modern aquaculture management, a remote water quality monitoring and computer-controlled intensive culture is the future trend in aquaculture. The objective of this research is to design and develop a real-time mobile-based water temperature monitoring system capable of decreasing the reliance on manpower at the monitoring site to reduce the cost and to assess fish production cycle and fish grow-out system. The system implementation resulted in a monitoring system that collects the current water temperature from the core-controller in real-time. Also, the system provides and displays information that includes normal range, maximum, minimum, average and findings of the collected temperatures. The results obtained in this study has shown the ability of data acquisition in the remote and real-time detection of water temperature accurately and efficiently. It provides decision support to help and guide fisher folks in avoiding distress to fish and obtaining the optimum water temperature range. © 2018 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017.
Keywords: water temperature monitoring; cloud computing; fog computing; RESTful API; mobile; IOT
*
Corresponding author. Tel.: +0-000-000-0000 ; fax: +0-000-000-0000 . E-mail address:
[email protected]
1877-0509 © 2018 The Authors. Published by Elsevier B.V.
Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017.
1877-0509 © 2018 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017 10.1016/j.procs.2017.12.207
2
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
699
1. Introduction Aquaculture in the Philippines contributes significantly to the country’s food security, employment, and foreign exchange generation. Aquaculture is growing much faster than capture fisheries. However, according to the Fisheries and Aquaculture Department of the Food and Agriculture Organization of the United Nations, the global position of the Philippines in aquaculture production has fallen steadily from 4th place in 1985 to 12th place today [1]. The Philippines now contributes only a little over one percent of global farmed fish production compared to five percent previously [2]. In Lake Sebu, Southern Philippines, several cases of catastrophic massive fish kill has been reported in 2016 and in February 2017 that caused up to 50 tons of fish went to waste leading to an increased in prices of Tilapia as a result of lack of supply [3, 4, 5]. The sudden changes in the weather and temperature affecting water quality are the cause of the fish kill. Thus, the incident disclosed the Bureau of Fisheries and Aquatic Resources to monitor the water quality of the lake. Water quality monitoring plays an important role in aquaculture to ensure sustainable good water quality [6]. In several studies on the development of water quality monitoring system, the temperature is considered as one of the significant water parameter [7, 8].Water temperature has an important part in determining the distribution of aquatic organisms, physicochemical water characteristics, and rates of ecological processes such as nutrient cycling [9]. Also, water temperature is a key water quality variable because it influences all other water quality parameters such as dissolved oxygen concentrations [10]. In this age of international trade and increasing global population, the aquaculture industry needs to plan and implement a technology that will address issues concerning global food security [11]. In modern aquaculture management, a remote water quality monitoring and computer-controlled intensive culture is the future trend in aquaculture [12]. Water quality monitoring determines the goodness of water for specific purposes. The water quality tests give information about the health of the water resources. One of the technological revolutions of computing and communications is the Internet of Things (IoT). It is a smart interconnected device that sense, interpret and react to the environment due to the combination of the internet and embedded sensors system [13, 14]. The challenged for this emerging technology is how to craft a system that collects and monitors water temperature of a water resource in real-time. The objective of this study is to design and develop an efficient and cost effective real-time mobile-based water temperature monitoring system that could aid the aquaculture farmers in the improvement of the aquaculture industry. The Representational State Transfer (REST) architectural design is used to connect and collects real-time water temperature that consists sensor and core-controller, database server and RESTful APIs. In general, the system could provide information that includes normal range, maximum, minimum, average and findings of the collected temperatures that provide decision support to help and guide fisher folks in avoiding distress to fish and obtaining the optimum water temperature range. Also, the system could display the water temperature being monitored continuously in real time directly to the stakeholders’ mobile devices and collects long-term of data. 2. Methodology 2.1. Requirements Elicitation 2.1.1. Tools and Instruments In this study, the main instruments for the water temperature monitoring are determined. Primarily, the chosen main components, the core controller and temperature node are the Raspberry Pi 3 Model B and DS18B20 Digital Temperature respectively as shown in Fig. 1. Raspberry Pi is run on LINUX kernel by the use of keyboard and monitors wherein LINUX OS specifically Raspbian is booted onto the Raspberry Pi [14]. The waterproof DS18B20 Digital temperature sensor is used to detect the water temperature. The DS18B20 Digital Temperature provides 9 to
700
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
3
12 bits temperature readings which indicate the temperature of the device and the absolute accuracy is specifically +/-0.5C from 10C to +85C [15]. a)
b)
Fig. 1. (a) Raspberry Pi 3 Model B; (b) DS18B20 Digital Temperature.
The temperature collected is sent from the DS18B20 over a 1- Wire interface, so that only one wire needs to be connected from the Rpi to a DS18B20. In addition, the power for reading, writing, and performing temperature conversions are derived from the data line itself with no need for an external power source. Thus, it is simple to use the DS18B20 with the Rpi microprocessor. 2.1.2. Water Temperature Criteria The water temperature criteria are investigated specifically the case of Tilapia fish. Water temperature is a key water quality variable because it influences all other water quality variables and aquatic organisms [10]. The temperature of the water affects the activity, behavior, feeding, growth, and reproduction of the fishes [8]. Tilapia are thermophilic fish and known to tolerate a wide range of water temperature [16]. The temperature range for a normal development, reproduction, and growth of Tilapia is within 20-35 ºC, with the optimum range for growth within 24-32 ºC [17]. In addition, tilapia stop feeding below 16 ºC and cannot tolerate heat above 40 ºC. Therefore, the water resource must have a temperature within the normal range of 20-35 ºC. 2.2. System Design In this study, the design of the water temperature monitoring system consists of four main layers as shown in Fig. 2. The layers are the sensing, network, middleware, and application.
Fig. 2. Block Diagram
The four layers on the block diagram are the following. First, the sensing layer, mainly used for collecting the real-time temperature with the Raspberry-Pi interfaced with a digital temperature sensor. Basically, the monitoring location is the aquatic resource of an aquaculture farmer. The Second is the network layer, responsible for performing the basic functions of data and information transmission as well as the interconnection of systems and cloud platforms. The data from the sensor and the retrieval of data by the stakeholders are made possible by
4
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
701
telecommunication networks available in their respective area. The third is the middleware layer, a set of sublayers in the cloud for the management of data, PostgreSQL and RESTful APIs which are interposed between the network layer and the application layer. And lastly, the application layer provides functions where users can access using their mobile devices to the real-time temperature sensed by the digital water temperature. 2.3. Implementation In this study, the programming/scripting language used in the development are Python, HTML and CSS, PHP and JavaScript. Also, JavaScript Object Notation or JSON is used to represent the data from/to the resource. In addition, the Heroku cloud application platform is used in this study. 2.3.1. Water Temperature Sensor The instruments needed for the temperature sensing are installed. The DS18B20 digital water temperature is connected to Rpi as shown in the Fig. 3. The 3v3 pin is connected from the Rpi up to the positive rail and a ground pin to the ground rail. The 4.7k resistor is used as a pull-up for the data-line and is required to keep the data transfer stable and to successfully read the temperature from the device [15].
Fig. 3. Rpi and Digital Sensor Connection
The water temperature monitoring program is coded and implemented using Python run in the Rpi core controller in order to send the real-time water temperature read from the sensor to the RESTful API server. The temperature is collected on the Rpi with the digital temperature sensor. First, the Rpi is turned on to initiate the monitoring system, the URL is indicated using the HTTP URL created from Heroku. The headers and authentication with the username and password are also specified to conform data security. The current system date and time is set with the current temperature read through the digital sensor. Then, the system request POST API to insert and create a new current temperature sent using the corresponding data represented in JSON to the RESTful API URL. And the flow of collecting the temperature repeats whenever the device is turned on. 2.3.2. Database server The selection of the database depends on the requirements of the system. A database that performs well on single writes and multiple reads would be the ideal candidate for storing sensor data [18]. In the study conducted by Phan (2013), the comparison of the performance of databases showed good results for NoSQL in write performance and wins over SQL in terms of scalability [19]. However, in the study of Veen (2012), PostgreSQL performs best than other NoSQL databases when multiple clients are used. Also, in the study of Rudolf (2017), PostgreSQL is a better overall choice than other NoSQL and SQL databases on its performance comparison [20]. Therefore, PostgreSQL is used in this study, a database ideal in this system with multiple mobile platforms and stakeholders. The PostgreSQL database is used to store and retrieve data by means of REST API as shown in Fig. 4. The stored procedures and functions are utilized as a security layer to carry out operations that would take queries from the API for SQL processing within the database [21]. Also, it allows the database to reuse as other activities of the system can interact directly with the stored procedures instead of duplicating the code.
702
Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000 Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705
5
Fig. 4. Database Server
The database created includes two tables the temperature and user account respectively. The temperature table consists four attributes for the id, current date and time and the water temperature perceived from the digital sensor. Also, the user account table consists two attributes for the username and password necessary for the authentication on the RESTful API server. In addition, there are three stored procedures created specifically the userpass(), newtemp() and gettemp(). The stored procedures are called to perform their respective functions. The userpass() function is called to verify whether the account exists, newtemp() function is called to insert or create a current temperature record and the gettemp() function is called to retrieve temperature records from the database. 2.3.3. RESTful API Server Interactions between components, interfaces, applications, and protocols were implemented by RESTful APIs using python. REST server provides access to the resources and a REST client accesses and modifies the REST resources [22]. The RESTful web services use HTTP protocol methods for the operations they perform [23]. In this study, two methods are used, the GET and POST to retrieve and insert detected temperature respectively. Each app on the devices shared the same API to request data represented in JSON as shown in Fig. 5. With this architecture being applied to mobile devices the primary constraints of mobile computing could be resolved by moving the business logic such as complex operations and computations to the cloud. Thus, it makes the apps become relatively lightweight UI layers.
Fig. 5. RESTful API Server
These APIs allow interoperability that is used in Rpi using Python programming, Android, iOS and Windows platforms. There are three web services functionalities created for the RESTful API Web server shown in Table 1. The HTTP methods are used to implement the concept of REST architecture. The URL or Uniform Resource Locator provides data resource represented in JSON and a type of HTTP Methods. Table 1. RESTful API HTTP Methods. HTTP Methods
URL
Operations
GET
/temp
Get the current water temperature record.
GET
/temp/fromdate/fromtime
Get a list of water temperature in the
6
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
POST
/todate/totime
duration of the specified date and time.
/temp
Insert a current record for the water temperature.
703
2.4. Mobile Application The real-time water temperature monitoring system is implemented in an open access mobile-web to obtain interoperability in various platforms such as mobile and PC. The current temperature is displayed on the user interface with the latest water temperature monitored by the sensor and updated automatically based on the latest temperature recorded. Also, the visualization is set by default, a day behind the current date and time. The data is then represented using a graphical curve visualization used to analyze the water temperature criteria. Basically, the stakeholders used an application to browse the mobile-web through downloading the app at google playstore or using the URL. Sample UI is shown in Fig. 6.
Fig. 6. Mobile Web App UI
2.5. Model Sampling The water resources used for the experiment includes cold and warm water that ranges between 8-50 ºC respectively. The warm water is used to test the water temperature above the normal range. As well as the cold water is used to test the water temperature below the normal range. Accordingly, the temperature range for a normal development, reproduction, and growth, in the case of Tilapia is within 20-35 ºC [17]. Four models, water sampling with different duration of date and time, and water temperature are considered to assess the quality and reliability of the system. The four sampling models are shown in Table 2. Table 2. Sample Model Testing. Sampling Model
Description
Duration
I
Contains water temperature (ºC) > 35 ºC
Date: 5/10/2017 Time: 08:00:00 09:00:00
II
Contains water temperature (ºC) within 20 - 35 ºC
Date: 5/10/2017 Time: 09:00:00 10:30:00
III
Contains water temperature (ºC) < 20 ºC
Date: 5/10/2017 Time: 10:30:00 11:00:00
IV
Contains water temperature (ºC) < 20 and > 35 ºC
Date: 5/10/2017 Time: 11:00:00 12:30:00
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
704
7
3. Results and Discussion The testing and deployment were performed in an artificial water resource sample to test the quality and reliability of the water temperature monitoring system. The experiment test occurred during the 10th day of the month of May 2017. In this experiment, the monitoring system automatically collects the water temperature once every other two minutes. Each model used in the experiment are visualized using the graph to determine the fluctuation of the water temperature. The results of the sampling models are shown in Fig. 7. a)
b)
c)
d)
Fig. 7. (a) Model I Visualization; (b) Model II Visualization; (c) Model III Visualization; (d) Model IV Visualization.
In a comparison of the results, it shows that Model I and Model IV reaches above the normal range of 35 ºC. Model III and Model IV reaches lesser than the normal range of 20 ºC. Among the models, Model II ranges the normal range within 20-35 ºC with the average of 29.202 ºC. These models test the system that helps and guide aquaculture farmers to avoid distress to fish and to obtain the optimum temperature range for a good reproduction and growth of the fishes. The maximum, minimum, normal range and average temperature were recorded. These data are essential for the analysis of the water temperature resource. The details of the results are shown in Table 3. Table 3. Model Testing Results. Model
Normal Range
Maximum Temperature (ºC)
Minimum Temperature (ºC)
Average
Findings
I
20-35 ºC
50.375
27.937
35.488
Rises above normal range
II
20-35 ºC
31.812
27.375
29.202
Normal Temperature range
III
20-35 ºC
29.687
8.000
21.018
Reaches below normal range
IV
20-35 ºC
42.312
18.562
29.042
Rises and reaches above and below normal range
In general, the occurrences of similar scenarios of the actual environment on the artificial water resource is able to be handled by the system. Therefore, this experiment has shown the promise of data acquisition in the remote and real-time detection of water temperature.
8
Paul B. Bokingkito et al. / Procedia Computer Science 124 (2017) 698–705 Paul B. Bokingkito Jr. and Orven E. Llantos / Procedia Computer Science 00 (2018) 000–000
705
4. Conclusion This study discussed the concept of developing a monitoring system that can monitor the water temperature of a water resource to be used as the basis for the water analysis essential for the water quality in an aquaculture industry. The overall goal of the study was to develop a water monitoring system using Cloud computing with RESTful API architecture that monitors the water temperature in real-time. The results obtained in the design and development clearly suggests that with the proper selection of the appropriate instruments for the water temperature sensors, the water monitoring system can assess the fisher folks in real-time water temperature monitoring efficiently in low-cost. The water analysis could also aid in preventing inevitable water environment occurrences, decision-making, proper planning and management of aquaculture industry. Aside from the water temperature, other parameters for the water quality such as dissolved oxygen, pH, ammonia, nitrates, salinity, and alkalinity could also help the fisher folks monitor and analyze the quality of the water. This system could potentially be improved if these parameters are added to the monitoring system. For future works, the researchers plan to integrate a water quality index classification to provide an efficient decision support by using fuzzy logic inference system. References [1] FAO, “Food and Agriculture Organization of the United Nations,” FAO, 2017. [Online]. Available: http://www.fao.org/fishery/countrysector/naso_philippines. [Accessed 6 February 2017]. [2] PHILMINAQ, “Water Quality Criteria and Standards for Freshwater and Marine Aquaculture,” [Online]. Available: http://aquaculture.asia/files/PMNQ%20WQ%20standard%202.pdf. [Accessed 28 April 2017]. [3] Sunstar, “Sunstar News,” 28 June 2016. [Online]. Available: http://www.sunstar.com.ph/davao/local-news/2016/06/28/p39-m-tilapiadestroyed-lake-sebu-fish-kill-482081. [Accessed 8 May 2017]. [4] A. Roa, “Inquirer.net,” Inquirer, 3 February 2017. [Online]. Available: http://newsinfo.inquirer.net/867812/in-the-know-fish-kill-in-lakesebu. [Accessed 8 May 2017]. [5] E. Colcol, “GMA News Online,” GMA Network, 6 October 2016. [Online]. Available: http://www.gmanetwork.com/news/news/regions/584005/fish-kill-affects-lake-sebu/story/. [Accessed 8 May 2017]. [6] B. Ngueku, “Water monitoring in fish ponds,” International Journal of Fisheries and Aquatic Studies, vol. 2, pp. 32-32, 2014. [7] L. Swann, “A Fish Farmer's Guide to Understanding Water Quality,” [Online]. Available: https://www.extension.purdue.edu/extmedia/as/as503.html. [Accessed 28 April 2017]. [8] J. Kwak, A. St-Hilaire, F. Chebana and G. Kim, “Summer Season Water Temperature Modeling under the Climate Change: Case Study for Fourchue River, Quebec, Canada,” Water, vol. 9, no. 5, p. 346, 2017. [9] WMO, “Planning Of Water-Quality Monitoring Systems,” 2013. [Online]. Available: http://www.wmo.int/ pages/prog/hwrp/publications/ Technical_report_series/TR-No3water_quality_monitoring_systems.pdf. [Accessed June 2017]. [10] C. E. Boyd and C. Tucker, “Water Temperature in Aquaculture,” Pond Aquaculture Water Quality Management”, Alabama, Springer Science & Business Media, 1998, p. 88. [11] X. Zhou, “FAO Aquaculture Newsletter,” Feeding Global Aquaculture Growth, pp. 6-8, April 2017. [12] X. Zhu, D. Li, D. He, J. Wang, D. Ma and F. Li, “A remote wireless system for water quality online monitoring in intensive fish culture,” Computers and Electronics in Agriculture, vol. 71, no. 1, pp. S3-S9, April 2010. [13] T. Harris, “Cloud Computing – An Overview,” 2010. [Online]. Available: http://south.cattelecom.com/rtso/Technologies/CloudComputing/Cloud-Computing-Overview.pdf. [Accessed 2 May 2017]. [14] M. Ibrahim, A. Elgamri, S. Babiker and A. Mohamed, “Internet of Things based Smart Environmental Monitoring using the Raspberry-Pi Computer,” Digital Information Processing and Communications (ICDIPC), 2015. [15] “Maxim Integrated,” 2017. [Online]. Available: https://www.maximintegrated.com/en/products/analog/sensors-and-sensorinterface/DS18B20.html. [Accessed 2 May 2017]. [16] P.H Skelton, “A Complete Guide of the Freshwater Fishes of Southern Africa,” Southern Book Publishers, Halfway House, 2001, p. 231. [17] A.-F. M. El-Sayed, “Environmental Requirements - Temperature,” Tilapia Culture, Egypt, CABI Publishing, 2005, pp. 34-38. [18] J. S. v. d. Veen, B. v. d. Waaij and R. J. Meijer, “Sensor Data Storage Performance: SQL or NoSQL, Physical or Virtual,” IEEE Fifth International Conference on Cloud Computing, pp. 431-438, 2012. [19] T. A. M. Phan, “Cloud Databases for Internet-of-Things Data,” Technical University of Denmark, 2013. [20] C. Rudolf, “SQL, noSQL or newSQL – comparison and applicability for Smart Spaces,” Network Architectures and Services, 2017. [21] C. Kern, A. Kesavan and N. Daswani, “Foundations of Security: What Every Programmer Needs to Know”, Apress, 2007. [22] T. Fredrich, “RESTful Service Best Practices,” 29 May 2012. [Online]. Available: http://www.restapitutorial.com/media/RESTful_Best_Practices-v1_1.pdf. [Accessed 5 May 2017]. [23] R. T. Fielding, “REST,”, Architectural Styles and the Design of Network-based Software Architectures,2000. [Online]. Available: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm. [Accessed 5 May 2017].