Water Quality Monitoring System Based on the Internet of Things (IoT) for Vannamei Shrimp Farming

- As Internet of Things (IoT) technology develops, water quality monitoring systems for Vannamei shrimp farms have become more inventive and straightforward. The prototype IoT system monitors and controls the pool using sensors that can measure water quality parameters, such as temperature, pH, and salinity. The research aimed to design an automated water quality monitoring system for Vannamei shrimp aquaculture. The research used the E-4052C sensor, DS18B20 sensor, and DFRobot V1.0 sensor as data transmitting hardware (transmitter) and the receiving hardware microcontroller NodeMCU ESP32 as data processing, management, and control system tools. Then, the system used a Wi-Fi network to transfer data from the microcontroller to the Message Queue Telemetry Transport (MQTT) server as a data cloud. Several software programs, including Telegram, Node-Red, and ThingSpeak, help Android devices display real-time data. Test results for the accuracy of the sensor’s reading on water pH are 99.71, with an error rate of 0.29%. Meanwhile, the accuracy of the temperature sensor is 98.03 with an error rate of 1.7%. On the other hand, the accuracy of the salinity sensor is 99.49, with an error rate of 0.41%. The results indicate that all sensors have excellent performance. The real-time monitoring display and Android Telegram notification functions are good, and the automatic water quality monitoring tool is successfully operating in the Vannamei shrimp


I. INTRODUCTION
Recently, the growing significance of Internet of Things (IoT) systems, covering many applications, becomes increasingly important and is recognized as an essential component in the implementation of the city's visionary concept (Tran-Dang et al., 2020) in various sectors, including smart cities (Zanella et al., 2014), a network infrastructure (grids) (Saleem et al., 2019), factories (Errichiello & Marasco, 2014), and farms (Nayyar & Puri, 2016).The Wi-Fi network enables the interconnection and interoperability of IoT-enabled physical and virtual entities to create intelligent services and informed decision-making for monitoring, controlling, and managing purposes (Bucci et al., 2020).It is the most crucial network infrastructure used to develop IoT applications.The pervasive IoT-based wireless sensors that can remotely monitor and report on conditions in the field, climate, water quality, and seed drive the development of innovative farming practices.The basic IoT in agriculture is a simple system that allows farmers to control pumps and manage soil moisture and temperature with smart devices.This system allows efficient resource management, such as regulating the water quality needs for nutrient solutions and controlling the water parameters, such as salinity, pH, and electrical conductivity (Qazi et al., 2022).
As water is continuously circulated, or nutrient solution is substituted with a new solution to maintain seed quality parameters (Haris et al., 2021), the last approach establishes a monitoring system that faces a grand challenge with its unreliability and inefficiency regarding economy, environment, and society (Atzori et al., 2010).Water quality is an essential factor in supporting the success of Vannamei shrimp farming (Intan et al., 2020).It helps with fish maintenance management (Toruan & Galina, 2023) and analyzes optimal parameters for shrimp farming (Capelo et al., 2021).Using IoT helps shrimp farmers to work more efficiently to enhance the quality of shrimp water (Pontón et al., 2023), including measuring pH, salinity, temperature, and brightness, which is necessary for the aquaculture regime and requires a control system to help shrimp to survive (Bahri et al., 2020).The daily routine of shrimp farmers is to determine the water parameters that affect the growth of fish and shrimp by using a handheld meter for each parameter, while others give a sample of pond water to a laboratory for testing.However, this process is time-consuming, and the results may not be as accurate as real-time measurements at the pond site.
Developing and growing Vannamei shrimp requires attention to quality seed, feeding, and water quality, such as a temperature of 28-30 0 C, water PH of 7-8.5, and water salinity of 10-30 ppt.Furthermore, the productivity of pond is determined by the quality of the water, including Nitrate (0.0277−0.0500 mg/l), Phosphate (0.0032−0.0217 mg/l), Dissolved Oxygen (5.4−6.85 mg/l), Ammonia (NH3), and suspended organic content (Supito, 2017).So, shrimp productivity, monitoring in-situ water quality, and accurate data stored on the Internet are urgent for farmers who need to manage shrimp ponds more easily.The IoT innovation empowers real-time information collected from the farm field utilizing sensors and various electronic components.Furthermore, the IoT controls the things associated with it and exchanges the information over the network (Zulkifli et al., 2022).
Monitoring-based IoT using a pH sensor, temperature sensor, and salinity sensor is the application of IoT technology in the aquaculture sector.It is highly recommended in assisting the implementation of pond cultivation in South Konawe district, where the potential pond cultivation is 7652.32 ha (Ernawati et al., 2020).Challenges to implementing pond aquaculture in the South Konawe area include low environmental capacity, logistical difficulties due to the remote location, and water supply changes and increased demand (Surya et al., 2023).
The main problem that often occurs when aquaculture production fails is poor water quality.Fish farming requires regular maintenance and manual monitoring to keep fish safe and increase yields.Poor water quality in shrimp ponds is manifested in the presence of dead shrimp, algae die-off, abnormal swimming behavior of shrimp, and rapid changes in water color.Therefore, water quality control during maintenance is essential because farmers cannot know if shrimp are growing properly until production is finished.They also cannot know if salinity is rising or falling or if water temperature is rising or falling.Hence, service and maintenance can be maximized if supported by IoT.Given the limited use of IoT in current technology, especially aquaculture, the research aims to improve IoT-based technology, i.e., fisheries monitoring development.The device will monitor pond water quality based on temperature, pH value, and salinity, which aquaculture operators can view remotely.
A pond water quality monitoring system that reports water pH at any time is designed to maintain salinity conditions using a Total Dissolved Solid (TDS) sensor to combine fresh water and sea water pumps with Arduino data management via Short Message Service (SMS) (Pratama et al., 2019).However, it is a waste of cellular credit when sending alerts continuously (Binti Mazalan, 2019).For this reason, IoT-based monitoring development with ESP 32 Dev Kit as the processing media and a Wi-Fi module or web server is required to control and monitor water quality in shrimp ponds automatically.Hence, the owner does not have to spend a lot of money and be at the pond as the measurements are taken online in real-time.

II. METHODS
The schematic drawing of the proposed project is composed of two parts: hardware and software.The hardware portion, depicted in Figure 1, has sensors that assist in measuring the values in real-time.Another component is the NodeMCU ESP32, which transforms analog values into digital values.The Liquid Crystal Display (LCD) displays the sensor output, and the Wi-Fi module links the hardware and software.The water quality parameters are checked separately and updated on the cloud server.Then, their values are displayed on the MyMQTT and Android mobile.
The hardware system of the wiring design of the IoT-based water quality monitoring tool is presented in Figure 2.This tool uses a pH sensor E-4052C, temperature sensor DS18B20 (Zhao et al., 2022;Nurazizah et al., 2017), Gravity DFRobot Analog salinity Sensor V1.0 (Zhao et al., 2022), and an LCD connected to the NodeMCU ESP32 (Ahmad et al., 2021) as a microcontroller that processes input, output, and communication of the whole system.It follows the protocol design shown in Figure 3. Analog pH Sensor E-4052C and Gravity DFRobot Analog Salinity Sensor V1.0 measure water pH and salinity.Those are specially designed for the Arduino series as its features have easy communication and built-in functions.
The design system block diagram in Figure 3 consists of a circuit block of input, process, and output.The E-4052C pH sensor, DS18B20 temperature sensor, and TDS V1.0 Gravity sensor serve as input, and NodeMCU ESP32 serves as a microcontroller.As the Message Queue Telemetry Transport (MQTT) client, the sensors read acid-base levels (pH), temperature, and water salinity and send them to NodeMCU ESP32.Then, the ESP32 controller acts as a server to handle the sensor readings, read the value, and upload it to the cloud.It acts as a topic subscriber, manages the received data, collects and connects to the Wi-Fi network, and sends it to MQTT receivers (Azzedin & Alhazmi, 2023).
On the other side, the topology of MQTT Broker displayed in Figure 4 consists of the MyMQTT database, which supports Node-Red as an interface between the microcontroller and IoT and conveys values, graphics, and notifications about water conditions.The MQTT Broker acts as a central hub that enables communication between MQTT clients.Specifically, it receives messages published by clients, filters the news by topic, and distributes them to subscribers.When the sensor detects the occurrence of  (Pasika & Gandla, 2020).It can also be displayed manually on LCD and the Arduino IDE serial computer monitor screen (Zulkifli et al., 2022).
System calibration, testing, and analysis are performed on the E-4052C pH sensor, DS18B20 sensor, and DFRobot Gravity V1.0 TDS sensor using NodeMCU ESP32 as a microcontroller with a resistance analog value range of 0 to 4096/12 bits.To calibrate the E-4052C pH sensor, the researchers use two water samples at pH 4.01 and pH 6.68 to determine the minimum and maximum voltage.Then, the researchers convert the analog values into digital sensor voltage values for each sample of the aqueous solution (see Table 1).
The calibration of pH sensor E-4052C is conducted using the average voltage of standardized water samples at pH 4.01 and pH 6.68 values, as shown in Table 1.It compares the average voltage of standardized water samples measurements obtained using pH sensor E-4052C with the pH values of the sample water displayed in Equation 1.The instrument calibration value is determined to be 0.266. (1) The pH of the water is manually measured with a pH meter to assess the accuracy of the data produced by the pH sensor E-4052C.The results of this test are displayed in Table 2. From the E-4052C pH sensor test results, it can be seen that the average percentage error is 0.29%.The result is less than 5% for the E-4052C sensor, so the instrument is functioning successfully and correctly.
The core functionality of the DS18B20 is its direct-to-digital temperature sensor, which can operate without an external power supply or can also be powered via an external supply on a Voltage Drain to Drain (VDD) pin.The sensor communicates via a 1-wire interface, so only one wire (and ground) from a central microprocessor needs to be connected to a DS18B20 sensor.The sensor cables are immersed in water to test them.The thermistor indicates temperature, an element with variable resistance.Nevertheless, it is protected behind the metal housing of the sensor and has no direct contact with the cooling water.When the metal case is immersed in water, the temperature sensor detects the water temperature and displays the approximate value.
The test of the DS18B20 temperature sensor in the aquarium of the Fisheries Laboratory of Halu Oleo University is carried out by comparing the measurement results with a manual water thermometer.The DS18B20 temperature sensor is connected to red and green Light Emitting Diode (LED) lights.The red LED light is on when the water temperature is above 32°C and below 28°C.Meanwhile, the green LED light is on when the temperature is between 28 and 32°C.The results of temperature measurement using   the DS18B20 temperature sensor from the pool with the error presentation are shown in Table 3.According to the testing results, the DS18B20 sensor functions correctly as a water temperature monitoring system since the percentage error obtained is 1.7% or less than 5%.
The calibration process for the DFRobot Gravity V1.0 sensor involves determining the salinity value based on the Analog Digital Converter (ADC) sensor value.It is achieved by converting the ADC sensor value to digital using a linear equation.Three different salinity water samples, such as 0 ppt, 30 ppt, and 34 ppt from a refractometer, are used for calibration.
In Table 4, the salinity value read by the refractometer is represented by 'Y', and the ADC value of the DFRobot Gravity V1.0 sensor is represented by 'X'.The calculation of the DFRobot calibration using the linear equation is represented by Equation 2, where 'a' and 'b' are constants determined by Equations 3 and 4.

,
(2) The researchers use three water samples with different salinity levels, as presented in column Y, and the ADC values displayed in column X in Table 4.After performing mathematical calculations on the X and Y values, such as X 2 , Y 2 , and XY , the results are displayed in Table 4. Substituting the data from Table 4 into Equations ( 3) and ( 4), the researchers find that 'a' is 0.013059 and 'b' is -4.61854.Therefore, the simple linear regression Equation ( 2) is transformed into Equation ( 5). (5) The test results of the conductivity/TDS sensor and error presentation are presented in Table 5.From the percentage error of the DFRobot Conductivity/ TDS sensor, the result is 0.41% or less than 5%.Hence, it can function successfully and appropriately in the water salinity tool.

III. RESULTS AND DISCUSSIONS
The large pond requires a newly developed model that can continuously monitor water quality.Built using an integrated Wi-Fi module in the NodeMCU and IoT devices, the system enables internet connectivity and sends sensor data measurements to the cloud.Readings of water's physical and chemical properties in ponds are displayed on smartphones, which can be accessed anytime, allowing the farmer to control and treat Vannamei shrimp properly.It is essential to monitor the operating system remotely from anywhere worldwide.Intelligent monitoring of water quality using IoT involves the integration of Internet of Things (IoT) devices and sensors to continuously monitor various parameters related to water quality.Watching at all times increases the reliability of the system.The improvement of the water-acceptable values is observed.If the threshold is exceeded or falls below, an alarm signal is triggered and sent to the mobile phone as a telegram message.IoT in sensible water high-quality monitoring includes deploying sensors and IoT units to continually screen a range of parameters associated with water quality, enabling  The program works as long as the on button is pressed and the Wi-Fi network and MQTT broker are connected to the Internet.The MyMQTT database that Node-Red supports acts as an interface between the microcontroller and the IoT, conveys information about the water quality status of the Vannamei shrimp pond, and displays notifications on a dashboard.Node-Red and Telegram's MQTT protocol monitoring testing uses the publish/subscribe concept and deployment, including program testing, sensor testing, IoT-based data delivery testing, and data testing on servers and notifications to users.The tool monitors water quality via LCD (displaying manual sensor readings) and Android (displaying sensor readings, real-time graphs, and notifications).MQTT is a simple and lightweight messaging protocol.As a messaging protocol, MQTT is a public/subscription structure intended to be open and easy to implement.Single servers can support hundreds of remote clients.
The Microcontroller Unit (MCU) is connected to the sensors.Then, the Arduino application is the tool for further processing on a PC.Arduino Integrated Development Environment (IDE) is software for programming various microcontrollers such as Arduino and NodeMCU ESP32.Arduino IDE uses the C/C++ (Avr-g++) programming language and compiler.Programs and sketches written in the Arduino IDE can be compiled and uploaded directly to an Arduino board (Fezari & Al Dahoud, 2018).
The NodeMCU ESP32 serves as an MQTT server, handling received data, subscribing to topics, gathering sensor data, connecting to the network, and transmitting it to MQTT receivers.When sensors detect power consumption, the data is processed and sent via the MQTT protocol to be displayed on various platforms such as MyMQTT, an Android mobile application, or an LCD screen.Functional testing of the system is also conducted.For instance, Figure 5 displays the ThingSpeak application, while Figure 6 illustrates Node-Red.Additionally, the manually printed sensor value on an LCD display is depicted in Figure 7.It shows the Arduino IDE serial monitor screen displaying water temperature, pH, and salinity information.Furthermore, Figure 8 showcases the Telegram application as an implementation of the IoT protocol MQTT.graphically displayed, accessible via a web browser on smartphones, or Personal Computers (PCs)/laptops (Artiyasa et al., 2020).
Furthermore, Node-Red is a browser-based tool for creating IoT applications, often used in conjunction with the MQTT protocol.Node-Red includes Node.js, enabling it to function effectively both at the network's edge and in the cloud (Abdullah & Mazalan, 2022).Data sent by sensor nodes, such as the pH sensor E-4052C, temperature sensor DS18B20, and Gravity DFRobot Analog Salinity Sensor V1.0, to the cloud can be managed by the MQTT gateway node in the middleware.
In addition to using ThingSpeak and Node Red, the water quality monitoring system is created using the chat feature available on Telegram dislayed in Figure 8, which controls the relay modules.The bot system on Telegram is used as a transmitter and receiver of messages that control relay modules connected to electrical devices.Apart from using ThingSpeak, the water quality monitoring system utilizes the chat feature available on Telegram to control the relay module.The bot system on Telegram serves as a message transmitter and receiver, allowing farmers to control a relay module connected to their smartphone.
After validation and successful testing of the monitoring system tool, it is then deployed in the shrimp pond.Data are collected by placing the sensor probe into the Vannamei shrimp pond water.The sensor will read and detect the values of salinity, pH, and water temperature.The serial monitor screen will display the sensor reading data in the form of pH, salinity, and water temperature values.The results can be monitored on the Node-RED dashboard, MyMQTT, and Telegram.For example, the researchers present data collected at 11 am from November 2 to November 11, 2022.The data displayed in Table 6 shows the results of a realtime water quality monitoring assessment conducted using IoT at the Vannamei shrimp pond in Pamandati Village, South Konawe Regency, Southeast Sulawesi Province.
The measurement data show that the system built functions well and can be used easily by farmers.Applying IoT technology, the water quality monitoring device is a cost-effective and efficient system designed to monitor the water quality of the Vannamei shrimp pond.Using IoT to monitor water quality in Vannamei shrimp can benefit farmers significantly, including improved water quality management, cost savings, and increased productivity.IoT is used in many applications, such as environmental monitoring, precision agriculture, animal tracking, and water quality management.IoT devices require a reliable internet connection to transfer data to the cloud and regular maintenance to function properly.However, issues such as the availability and maintenance of the Internet network require the government's attention to develop a more optimal monitoring system for shrimp farmers and ensure that it is widely used.
The advantage of applying the IoT concept to the fishing sector is the possibility of collecting large amounts of data using connected sensors and systems that can be controlled and activated automatically.It optimizes productivity and allows farmers to save time when they cannot complete important tasks.In addition, accurate information from the IoT will improve productivity in fisheries, especially in complex daily operations such as Vannamei shrimp tanks.On the other hand, precision agriculture aquaculture focuses on optimizing and improving agricultural processes to achieve maximum productivity and minimum costs.Therefore, more sensors and smarter systems are required to meet these expectations.

IV. CONCLUSIONS
An IoT-based monitoring system can remotely monitor and manage water quality parameters in the Vannamei shrimp pool by providing real-time data on water temperature, pH, salinity, and other water quality parameters.The system consists of sensors that measure water quality parameters and transmit data to a central platform that farmers can access from Further research can be developed by incorporating additional sensors such as Dissolved Oxygen (DO) sensors, turbidity sensors, ammonia sensors, and others.Even though the Vannamei shrimp pond water quality monitoring tool has been made with minimal errors, preventive measures have not been automatically implemented by this tool system.Farmers still need to take actions to reduce the amount of water or perform other necessary tasks to maintain the survival of their shrimp.Additionally, reading the salinity, temperature, and pH values of the water heavily depends on the quality of the Internet network around the shrimp pond.

Figure 1
Figure 1 Hardware of Water Quality Monitoring Tool

Figure 3
Figure 3 Protocol Design Block of Message Queue Telemetry Transport (MQTT) Diagram Figure 5 Graphic Display of Water Quality Monitoring on ThingSpeak

Table 1
The E-4052C Voltage Sensor on Solution of Buffer Powder

Table 2
Results of Water pH Sensor Test

Table 3
Results of Water Temperature Sensor Test

Table 4
Calibration of DFRobot Gravity Sensor

Table 5
Results of Water Salinity Test real-time monitoring, analysis, and preservation of water quality.

Table 6
Water Quality Observation Data IoT-based monitoring systems can also optimize resource utilization and improve the efficiency and sustainability of the aquaculture industry by detecting whether sensor readings are above or below thresholds.If the sensor value exceeds the threshold, the affected user is notified and can take appropriate action.The tool displays water quality manually via LCD and Android smartphones, displaying sensor readings, real-time graphics, and notifications.The IoT-based shrimp pond monitoring tool is effectively built and operable according to sensor error beliefs, graphs, and real-time monitor displays.Test results for pH, temperature, and salinity sensors show sensor error rates of 0.29%, 1.7%, and 0.41%.The results are less than 5%.The data collected using this tool have a reliability of over 95% for the measurement results.Hence, the IoT can monitor and adjust water quality parameters to optimize shrimp growth.