Development of Remote Sensing Data Collection and Management Platform via Internet

Recently, the technology of the Internet of Things (IoT) has been widely used in many disciplines such as remote sensing and control via the Internet in various industries. However, it is still difficult to find solutions directly from an appropriate textbook for learners. For this reason, this paper aims to provide a platform for remote sensing data collection from different locations. The proposed system presents a case study to collect and monitor sensed data, e.g., temperature and humidity, with Wi-Fi modules. The human interface using Visual C# is designed to control the Wi-Fi module that can transmit data up to a distance of 200 m. The collected data can be transmitted to the server via the Message Queueing Telemetry Transport (MQTT) protocol. Once the data is received, it is then uploaded to the MySQL database. Therefore, the historical data from the cloud can be viewed and monitored on line by the PHP dynamic data management system. Experimental results verify that the proposed platform is feasible for practical applications in terms of robust, stable, and fast responses.


Introduction
Nowadays, techniques using cyber-physical systems, the Internet of Things (IoT), cloud computing, and so forth are widely applied to industry 4.0-based manufacturing systems in various industries. (1)(2)(3) With the rapid development of wireless communication technologies, especially Wi-Fi technology, the Internet can be connected with a WLAN network and a wireless access point up to a 100 m range. (4)(5)(6)(7) Moreover, cloud computing has become an increasingly important technology recently. Therefore, the system integration with these technologies is an indispensable issue currently.
There have been many related research studies based on the above techniques in recent years. For example, a room monitoring system using a ZigBee communication module and a sensor module was proposed. (8) It can monitor temperature, humidity, O 2 and CO 2 levels, and atmospheric pressure so that the indoor air quality can be monitored and efficiently controlled using a ZigBee module. In 2016, a home automation system was developed on the basis of ESP8266 with Wi-Fi, TCP/IP stack, and microcontroller capability. (9) Its mobile or web app communicates through the microprocessor via the Message Queueing Telemetry Transport (MQTT) protocol. However, for the aforementioned techniques, the data management mechanism with the user interface still requires further development.
The purpose of this study is to provide a set of guidelines for building a platform that can achieve multiple remote sensing data collection and monitoring via the Internet using Wi-Fi modules and the MQTT protocol. (10)(11)(12)(13)(14)(15)(16)(17)(18) The proposed system allows different users to log in their own account and perform real-time monitoring, collection, and management of data. The Visual C#-based data acquisition system and graphical user interface (GUI) are designed to receive real-time data from remote temperature and humidity sensors. (19)(20)(21)(22)(23)(24)

System Structure
In this study, two clients (Company A and Company B) are assumed to be working with the same server at the same time. The system structure is shown in Fig. 1 to mainly consist of Wi-Fi modules, a Visual C# user interface, a data acquisition system in the server, and the MySQL database. Note that the Wi-Fi modules Linkit 7688 and Esp8266 represent Company A and Company B, respectively. Also, the Linkit 7688 and Esp8266 modules are combined with different temperature and humidity sensor modules.
On the basis of the MQTT protocol, the collected data (temperature and humidity) can be transmitted to the server from Wi-Fi modules via the Internet. The server subscribes all device topics and collects the data to be uploaded to the MySQL database. The GUI is designed to show real-time data.
The hardware modules used to set up the proposed system structure are listed as follows. a. Synology DS215+ is a high-performance server with which a client can communicate using Php, MySQL, MQTT Broker, and so forth. b. Esp 8266-07 is an integrated Wi-Fi chip with a 32-bit MCU, standard digital peripheral interfaces, ADC, and so forth. c. Linkit Smart 7688 is a Wi-Fi module with GPIO, I²C, I²S, SPI, UART, PWM, an ethernet socket, a 32 MB flash, a 128 MB DDR2 memory, and so forth. d. DHT11 is a temperature and humidity sensor complex with a calibrated digital signal output. The communication process is in the single-bus data format used between the MCU and the DHT11 sensor. e. SI7021 is a humidity and temperature sensor with an analog-to-digital converter, signal processing, calibration data, and an I²C interface. The software packages used to control the proposed system structure are listed as follows. a. The MQTT protocol is a machine-to-machine (M2M) and IoT connectivity protocol based on TCP/IP for building the network connectivity. b. NodeMCU is an open source IoT platform that includes firmware running on the ESP8266 Wi-Fi SoC from Espressif Systems, as shown in Fig. 2(a). The firmware uses the Lua programming language. The development environment of NodeMCU is ESPlorer, which is an integrated development environment (IDE) for ESP8266 developers, as shown in Fig. 2(b). c. OpenWrt is an embedded operating system based on Linux. In Linkit Smart 7688, it can be developed and programmed with Python software, as shown in Fig. 2(c).

Esp8266 with peripheral circuit
Esp8266 with a peripheral circuit is shown in Fig. 3. The USB type-C adapter connects with the USB charger, and LD1117 (low drop fixed and adjustable positive voltage regulator) receives 5 V from the USB charger and thus supplies 3.3 V to Esp8266 and DHT11 (temperature and humidity module).
GPIO 12 in Esp8266 connects with DHT11 (pin 2) to receive the data. To display the communication status, Esp8266 connects two LED lights; the red LED light indicates a successful connection between Esp8266 and the MQTT broker, and the yellow LED light shows that Esp8266 is transmitting the data.

Linkit Smart 7688 with peripheral circuit
Linkit Smart 7688 uses the USB charger to provide 3.3 V for itself and SI7021 (humidity and temperature sensor). The yellow and red LED lights are used to indicate the connection status between the MQTT broker and the data transmission system. In Fig. 4, the GPIO4 and GPIO5 of Linkit Smart 7688 connect with the SCL and SDA of SI7021 to transmit the data.

System Software
The proposed system software contains the graphical GUI, Visual C# programming, Wi-Fi module programming, and server programming. On the basis of the MQTT protocol, the topic published/subscribed for every device is shown in Fig. 5. Assume two clients, i.e., user-Company A and user-Company B, are working at this system, where Esp8266 is installed for user-Company A and Linkit Smart 7688 is installed for user-Company B. The transmission data format used among the devices is the JavaScript Object Notation (JSON) format. The human-readable text made up of attribute-value pairs and array data types is used to transmit data objects. For example, the data "{"id":ID, "action":"Auto", "temp":temperature, "humi":humidy}" and the command "{"id":ID, "action":"Auto"}" use the JSON format. The system software is illustrated as follows.

Wi-Fi module programming
The Wi-Fi module is used to publish the collected data (temperature and humidity) to the MQTT broker (server). The flowchart of Esp8266 programming shown in Fig. 6  Otherwise, go back to step (d). h. Collect the data from the DHT11 sensor. i. Publish the data to the server and user interface, and then turn on the yellow LED with a delay period of (fre*1000) ms. Go back to step (d).

Linkit Smart 7688 programming
The flowchart of Linkit Smart 7688 programming shown in Fig. 7    f. Receive the command. g. Check if the command ["id"] = "NCUT-2" is received. If yes, go to the next step. Otherwise, go back to step (d). h. Collect the data from the SI7021 sensor. i. Publish the data to the server and user interface, and then turn on the yellow LED with a delay period of (fre*1000) ms. Go back to step (d).

Server programming
Server programming uses the Python software package for data communication. The flowchart shown in Fig. 8 is briefly described as follows.
a. Connect with the MySQL server. b. Connect with the MQTT Broker. c. Subscribe every topic. d. Start to receive the data from every client. e. Check if the data is received. If yes, go to the next step. Otherwise, go back to step (c). f. Send the data by data ["id"] to the designated database. Next, go back to step (c).

Visual C# programming
Visual C# programming is used to transmit control signals and monitor the collected data. The main procedure is briefly described as follows, and its flowchart is shown in Fig. 9.
a. Log in with an authorized account. b. Check if the account is correct. If yes, go to the next step. Otherwise, go back to step (a). c. Check if the file for setting exists. If yes, load the setting data. Otherwise, create a new file and load the setting. d. Check if the "Start to receive" button is pressed. If yes, go to the next step. Otherwise, continue the same procedure until the "Start to receive" button is pressed. e. Receive the data from Wi-Fi modules. Three parallel operation branches are then working independently as follows. Branch (1)

Performance Results
The proposed system supports two clients (Company A and Company B) in this case study. Every client is provided the Wi-Fi module, temperature-and humidity-sensing module, and GUI operation panel.

Connection between user interface and Wi-Fi module
The first step to implement the proposed system is to connect the client interface (Visual C#) with the Wi-Fi module via the MQTT protocol. After logging in the account, the connection will be operated immediately whenever the Wi-Fi module is ready. In Fig. 10(a), the client (Company A) logs in its account and monitors the data received from Esp8266 with DHT11. In Fig. 10(b), the client (Company B) logs in its account and monitors the data received from Linkit Smart 7688 with SI7021. It is known that the sensor SI7021 has a higher accuracy than the sensor DHT11. Therefore, under the same environment in the laboratory room, note that Fig. 10(b) shows a better performance result than Fig. 10(a), especially in terms of humidity. The data tables generated from Esp8266 with DHT11 and Linkit Smart 7688 with SI7021 are shown in Figs. 10(c) and 10(d), respectively.
The historical data at 5/21 is shown in Fig. 11. Note that the air conditioner was turned off at 15:10-15:20; thus, the graph presented a smooth curve.

Data upload to server
When the server is operated, the data can be collected and sent to the MySQL dat abase im mediately. I n Fig. 12, ever y Wi-Fi module (Esp8266, Company A; Linkit Smart 7688, Company B) transmits the data to the server. Next, the server then uploads

Conclusions
In this paper, a real-time remote sensing data collection and monitoring system using the Wi-Fi module-based Visual C# graphical interface in a case study is presented. The illustrative techniques effectively integrate data transmission systems with Wi-Fi modules, a server via the MQTT, MySQL database, and website-based GUI. This means that all clients can be allowed to work independently at the same time, and thus all data can be collected using the same server. Additionally, the website can provide a real-time data monitoring and history tracking capability. In reality, it presents a sufficient background required for Industry 4.0 applications in various industrial disciplines.