Implementation and Evaluation of Open-Source Hardware to Monitor Water Quality in Precision Aquaculture

Precision aquaculture is a new field that allows farmers to have better control over aquaculture processes, facilitating decision-making and improving efficiency. The implementation and evaluation of a low-cost water-quality monitoring system based on open-source hardware, which is easy to rebuild for scientific applications, is reported in this paper. The proposed system measures temperature, dissolved oxygen, and pH, taking records and sending information through a wireless protocol (ZigBee) to a graphical user interface which can display information numerically and graphically, as well as simultaneously storing the information in a database. These variables are very important for aquaculture, as they have a direct influence on critical culture parameters such as growth and survival. Although it is a low-cost system, it offers good quality data and demonstrates efficiency for its use in precision aquaculture.


Introduction
Over the last four decades, aquaculture has become the fastest-growing agroindustry worldwide [1]. The global production of fish continues to grow slower than the population (mainly as fishing remains almost stable, at around 80 million MT). In this context, aquaculture has contributed more day by day, with a production of around 80 million MT (110 million MT, if aquatic plants are considered) having been reported by the FAO in 2018, with an associated value of approximately 243.5 billion dollars. This has increased the availability of aquatic food for human consumption from 10 kg per capita in 1960 to more than 20.2 kg per capita in 2015 [2]. The accelerated growth of aquaculture has made the necessary design and development of production systems with new technologies into a field known as "precision aquaculture" (or PAq). These technologies are capable of assisting aquafarmers in decision-making, including in intensified systems [3]. PAq can be considered as the application of information technologies (software and hardware) into the field of aquaculture biology, in order to provide support to the production systems. In developing countries, it is very relevant to facilitate access to such technologies, adapting them to the regional situation at accessible costs.

Materials and Methods
The low-cost water-quality monitoring system was designed and evaluated at the Aquaculture Laboratory of the Department of Agricultural and Veterinary Science of the Instituto Tecnológico de Sonora, sited in Ciudad Obregón, Sonora, México (27.48° 29′ 2.1″ N, 109.93° 56′ 1.9″ W). Briefly, the system consists of an open-source platform for hardware development with a network of wireless sensors of temperature, dissolved oxygen, and pH sensors. The system was adapted using software on a desktop computer using a serial port based on a depurator (USB serial converter). Figure 1 shows the model used for the monitoring of water-quality variables. The information generated by the sensors was read every minute and stored every 5 min; complete measurement of all three variables took about 3 s.

Hardware
The hardware design was based on the platforms Iteaduino/Arduino. The Arduino chip consists of a microcontroller with easy-to-use hardware and software. These platforms have the particularity of being open-code systems which work in a programing language similar to c++ [21]. In the present study, the platforms Iteaduino/Arduino version Mega were used; with an ATmega 2560 chip (specification sheet 2560, Atmel). Using open code from Arduino, the chip utilized was 100% compatible, having the same characteristics and with the same number of i/o pins, a wide pulse modulator with 8-bit resolution, 16 MHz oscillator crystal, universal serial communication port (UART), and 256 KB of flash memory, among other specifications. Figure 2 shows a picture of the platform and the depurator used. The depurator was manufactured by Atlas Scientific and its function was introducing the information to the computer and receiving instructions from the software; it works as a simple converter (from USB to serial). With the depurator, it is possible to power external modules which require 5 or 3 volts of direct current. The pins Rx and Tx shown in Figure 2 are connected to a wireless transceiver ZigBee, which is a key part of the WSN. The transceiver was fed 3 V from the depurator module. For appropriate functioning, the sensors were calibrated as recommended by the manufacturers, comparing them with commercial equipment limited to continuous automatic monitoring (data logging). Electrodes were installed completely vertically with the use of a two-inch PVC tube and fastened with a plastic belt to ensure the immobility of sensors and at the same measurement point, as shown in Figure 3.

Hardware
The hardware design was based on the platforms Iteaduino/Arduino. The Arduino chip consists of a microcontroller with easy-to-use hardware and software. These platforms have the particularity of being open-code systems which work in a programing language similar to c++ [21]. In the present study, the platforms Iteaduino/Arduino version Mega were used; with an ATmega 2560 chip (specification sheet 2560, Atmel). Using open code from Arduino, the chip utilized was 100% compatible, having the same characteristics and with the same number of i/o pins, a wide pulse modulator with 8-bit resolution, 16 MHz oscillator crystal, universal serial communication port (UART), and 256 KB of flash memory, among other specifications. Figure 2 shows a picture of the platform and the depurator used. The depurator was manufactured by Atlas Scientific and its function was introducing the information to the computer and receiving instructions from the software; it works as a simple converter (from USB to serial). With the depurator, it is possible to power external modules which require 5 or 3 volts of direct current. The pins Rx and Tx shown in Figure 2 are connected to a wireless transceiver ZigBee, which is a key part of the WSN. The transceiver was fed 3 V from the depurator module. For appropriate functioning, the sensors were calibrated as recommended by the manufacturers, comparing them with commercial equipment limited to continuous automatic monitoring (data logging). Electrodes were installed completely vertically with the use of a two-inch PVC tube and fastened with a plastic belt to ensure the immobility of sensors and at the same measurement point, as shown in Figure 3.

Dissolved Oxygen (DO)
In the present study, a kit sensor for DO was used. It consists of an analogue passive galvanic dissolved oxygen probe and an embedded circuit with the capacity for two communication protocols: universal asynchronous port receptor/transmitter (UART) and I 2 C inter-integrated circuit. The DO sensor can read in a range from 0.01 to +35.99 mg L −1 with a precision of ±0.2 mg L −1 . The kit can compensate for temperature, salinity, and atmospheric pressure, its operation voltage is from 3.3 V to 5.0 V, and it is compatible with any microprocessor supporting UART communication. It needs to be calibrated once a year, depending on the operation conditions and use time. The calibration was done using a reference solution with 0 mg L −1 of DO [22].

PH
The analogue passive pH electrode connected to the embedded circuit for monitoring the pH in the system was similar to that used for DO, in that it supports both the UART and I 2 C communication protocols. It can read in a range from 0.001 to 14.000 with a precision of ± 0.02; additionally, it is possible to read temperature dependently or independently and, in this case, to have a better precision and accuracy, it was programmed to consider the dependence of pH on temperature [23]. Its operation voltage is from 3.3-5.0 V and it is compatible with any microprocessor supporting UART communication. Calibration may be done once a year and it has a flexible calibration protocol with one, two, or three points, using well-known standard solutions.

Dissolved Oxygen (DO)
In the present study, a kit sensor for DO was used. It consists of an analogue passive galvanic dissolved oxygen probe and an embedded circuit with the capacity for two communication protocols: universal asynchronous port receptor/transmitter (UART) and I 2 C inter-integrated circuit. The DO sensor can read in a range from 0.01 to +35.99 mg L −1 with a precision of ±0.2 mg L −1 . The kit can compensate for temperature, salinity, and atmospheric pressure, its operation voltage is from 3.3 V to 5.0 V, and it is compatible with any microprocessor supporting UART communication. It needs to be calibrated once a year, depending on the operation conditions and use time. The calibration was done using a reference solution with 0 mg L −1 of DO [22].

PH
The analogue passive pH electrode connected to the embedded circuit for monitoring the pH in the system was similar to that used for DO, in that it supports both the UART and I 2 C communication protocols. It can read in a range from 0.001 to 14.000 with a precision of ± 0.02; additionally, it is possible to read temperature dependently or independently and, in this case, to have a better precision and accuracy, it was programmed to consider the dependence of pH on temperature [23]. Its operation voltage is from 3.3-5.0 V and it is compatible with any microprocessor supporting UART communication. Calibration may be done once a year and it has a flexible calibration protocol with one, two, or three points, using well-known standard solutions.

Dissolved Oxygen (DO)
In the present study, a kit sensor for DO was used. It consists of an analogue passive galvanic dissolved oxygen probe and an embedded circuit with the capacity for two communication protocols: universal asynchronous port receptor/transmitter (UART) and I 2 C inter-integrated circuit. The DO sensor can read in a range from 0.01 to +35.99 mg L −1 with a precision of ±0.2 mg L −1 . The kit can compensate for temperature, salinity, and atmospheric pressure, its operation voltage is from 3.3 V to 5.0 V, and it is compatible with any microprocessor supporting UART communication. It needs to be calibrated once a year, depending on the operation conditions and use time. The calibration was done using a reference solution with 0 mg L −1 of DO [22].

PH
The analogue passive pH electrode connected to the embedded circuit for monitoring the pH in the system was similar to that used for DO, in that it supports both the UART and I 2 C communication protocols. It can read in a range from 0.001 to 14.000 with a precision of ± 0.02; additionally, it is possible to read temperature dependently or independently and, in this case, to have a better precision and accuracy, it was programmed to consider the dependence of pH on temperature [23]. Its operation voltage is from 3.3-5.0 V and it is compatible with any microprocessor supporting UART Sensors 2020, 20, 6112 5 of 15 communication. Calibration may be done once a year and it has a flexible calibration protocol with one, two, or three points, using well-known standard solutions. For the present study, it was calibrated at three points-4.0, 7.0, and 10.0-to ensure precise measurement [22].

Temperature
In order to monitor this variable, a digital sensor tolerant of aggressive environments and any type of climatic condition (considering international standards and protection grade) was used (IP 68). These characteristics make the sensor adequate for use while submerged in either fresh or marine water. It reads in a range from -20 • C to 133 • C with a precision of ± 1 • C. Its operation voltage is 3-5 V direct current, as in the case of the other sensors. Communication with the microcontroller was carried out through the protocol UART configured for a transmission velocity of 9600 [22].

Software
The proposed water-quality monitoring system reads the values of the sensors through a graphical user interface (GUI) software, which is responsible for calling them and establishing a water-quality database. This permits access to analyses of future information, helping to recognize the conditions of the culture. The data reads are also graphed. The GUI was designed and programmed in the C# language, with the objective of having user-friendly, easy-to-use software. When the program is run, the connection is first carried out and the WSN is identified. When a wireless signal is available, the data is sent to the computer to be captured by the program and displayed in a numerical way, graphed, and stored, as shown in the flow diagram of Figure 4. For the present study, it was calibrated at three points-4.0, 7.0, and 10.0-to ensure precise measurement [22].

Temperature
In order to monitor this variable, a digital sensor tolerant of aggressive environments and any type of climatic condition (considering international standards and protection grade) was used (IP 68). These characteristics make the sensor adequate for use while submerged in either fresh or marine water. It reads in a range from -20 °C to 133 °C with a precision of ± 1 °C . Its operation voltage is 3-5 V direct current, as in the case of the other sensors. Communication with the microcontroller was carried out through the protocol UART configured for a transmission velocity of 9600 [22].

Software
The proposed water-quality monitoring system reads the values of the sensors through a graphical user interface (GUI) software, which is responsible for calling them and establishing a water-quality database. This permits access to analyses of future information, helping to recognize the conditions of the culture. The data reads are also graphed. The GUI was designed and programmed in the C# language, with the objective of having user-friendly, easy-to-use software. When the program is run, the connection is first carried out and the WSN is identified. When a wireless signal is available, the data is sent to the computer to be captured by the program and displayed in a numerical way, graphed, and stored, as shown in the flow diagram of Figure 4.

Performance Assessment
The LC reference equipment was installed in an 8 L aquarium with marine water and an air pump (RESUN AC-9602). This small system was chosen, in order to have better control and to ensure the same water quality throughout the aquarium. The reference equipment consisted of a pH meter (HANNA Instruments HI98128) and a multiparameter sensor for DO and temperature (YSI 551). With this equipment, 10 reads were taken per day (at different hours, in order to have randomized samples). To evaluate the efficiency and reliability of the system, four tests were performed: validation, operation continuity, reproducibility, and reliability. The validation test was done by comparison of the results randomly recorded by the commercial equipment with those obtained with the LC by means of an analysis of variance (ANOVA) of repeated measurements (P = 0.05, RMANOVA) using the software Sigma Plot for Windows version 12.0. The operation continuity test was done by maintaining the equipment in continuous operation for a long time, in order to evaluate its performance at present and provide a basis for further improvements. The reproducibility test consisted of the evaluation of three similar LC systems, in order to confirm the reproducibility of their reads and to detect whether significant differences were found among them, by means of one-way ANOVA (P = 0.05). Finally, the reliability test consisted of an evaluation of the sensitivity, resolution, precision, and accuracy of the equipment, analyzing each variable independently. For the sensibility analysis, Equation (1) (proposed by [24]) was used, where m is the dependent variable, determined by the least squares method, and σ is the standard deviation. The precision of any instrument is determined by the standard deviation of the reads for each variable and the deviation coefficient. Equations (3)-(5) were used to evaluate the precision of our equipment, while Equation (6) determined the accuracy of the data capture. Figure 5 shows the normal distribution of the reads, which indicates the characteristics of the instrument [24].
Sensors 2020, 20, x; doi: FOR PEER REVIEW www.mdpi.com/journal/sensors the dependent variable, determined by the least squares method, and σ is the standard deviation. The precision of any instrument is determined by the standard deviation of the reads for each variable and the deviation coefficient. Equations (3)-(5)Equation (3); Equation (4); Equation (5); were used to evaluate the precision of our equipment, while Equation (6) determined the accuracy of the data capture. Figure  5 shows the normal distribution of the reads, which indicates the characteristics of the instrument [24].

Results
The data of the validation test showed no significant differences in any of the measured variables. The mean temperature of the reference equipment was 24.02 • C, while that in the proposed system was 24.05 • C, giving a non-significant difference of 0.03 • C. In the case of dissolved oxygen, the trend was similar, with a mean value of 7.14 mg L −1 in the reference equipment and 7.13 mgL −1 in the proposed system. For pH, the difference was a little greater (0.06), with a mean of 8.18 in the reference equipment and 8.24 in the proposed system. Table 1 shows the values recorded for each variable in the reference equipment and the proposed system. The highest coefficient of variation was observed for DO, with 17.72% to 18.19% of variation, which indicates that those sensors were a little more unstable, due to the water characteristics and the effect of temperature on this parameter. The pH standard deviation in the proposed system was ± 0.11; a similar value of ± 0.21 when using a wireless water-quality monitor has been reported [25].  Table 2 shows the results of repetitive tests; no statistically significant differences were found between them (P < 0.05). A list of the utilized parts is presented in Table 3. It was fulfilled with the aim of developing a system with a low budget. The proposed system had an overall cost of 455€, in comparison to 1030€ with a similar system on the market (commercial price from personal communication with a local store); this represents a difference of 56% (580€). With the proposed system, there is a cost of approximate 150€ per variable measured. The proposed water-quality monitoring system, therefore, meets the requirement of a low-cost system, due to its price. Furthermore, it enables data logging. As can be seen from a comparison with commercially available equipment, its resolution and accuracy are sufficient for qualitative water-quality monitoring. In general, there is no other related equipment to compare with that presented in this study; however, it could be compared to other recent low-cost systems made with similar hardware, where costs can be compared [26][27][28]. Information stored in the database can be processed and displayed as a graph, from which the user can understand the status of an aquaculture system in a better way, and can correct problems or make decisions as soon as possible. Figure 6 shows these results in a graphical way, showing that the application of both systems in aquaculture is feasible and gives reliable information. The comparison between the reference equipment against the proposed LC OSH system follows the same pattern: the differences in the median values between groups are not great enough to exclude the possibility that the difference is due to random sampling variability and statistically significant differences (P < 0.05) were determined by Student's t-tests.  For Figure 7a-c , n = 38 samples were taken completely at random and a positive linear correlation was obtained with the reference equipment, where it can be seen that the measurement of dissolved oxygen (Figure 7a) showed very good agreement, obtaining r 2 = 0.81; the LC-OSH system average was 4.84 mg L −1 , while that for the reference equipment was 4.82 mg L −1 , representing a difference of only 0.5%. In a similar way, the measurement of pH obtained r 2 = 0.72, with an average of 8.26 for the low-cost proposed system and 8.13 for the reference equipment, a difference of 1.5% between their averages. In the case of temperature, r 2 = 0.97 was obtained, with an average temperature of 26.13 C for the low-cost proposed system and 26.09 C for the reference equipment; thus, their difference was 0.2%. Reference equipment LC -OSH For Figure 7a-c, n = 38 samples were taken completely at random and a positive linear correlation was obtained with the reference equipment, where it can be seen that the measurement of dissolved oxygen (Figure 7a) showed very good agreement, obtaining r 2 = 0.81; the LC-OSH system average was 4.84 mg L −1 , while that for the reference equipment was 4.82 mg L −1 , representing a difference of only 0.5%. In a similar way, the measurement of pH obtained r 2 = 0.72, with an average of 8.26 for the low-cost proposed system and 8.13 for the reference equipment, a difference of 1.5% between their averages. In the case of temperature, r 2 = 0.97 was obtained, with an average temperature of 26.13 • C for the low-cost proposed system and 26.09 • C for the reference equipment; thus, their difference was 0.2%.   Figure 8 shows the results of the operation continuity test (reads of DO, temperature, and pH over 5 days), which demonstrate the sturdiness of the proposed LC OSH system, as the equipment worked continuously over 30 days without any problems. This is a very important finding as, in aquaculture, the production cycles are very long (up to one year), and the equipment must work without interruption. The maximum value recorded for dissolved oxygen was 8.3 mgL −1 and the minimum was 8.0 mgL −1 ; therefore, it can be noted that the dissolved oxygen was always in a ± 0.3 (maximum-minimum) range, where the oxygen source (blower) was never shut down. It can be noted that, as the temperature increases, oxygen decreases, and vice versa; such variation is due to the solubility of dissolved oxygen being inversely proportional to the temperature [29][30][31].  Figure 8 shows the results of the operation continuity test (reads of DO, temperature, and pH over 5 days), which demonstrate the sturdiness of the proposed LC OSH system, as the equipment worked continuously over 30 days without any problems. This is a very important finding as, in aquaculture, the production cycles are very long (up to one year), and the equipment must work without interruption. The maximum value recorded for dissolved oxygen was 8.3 mgL −1 and the minimum was 8.0 mgL −1 ; therefore, it can be noted that the dissolved oxygen was always in a ± 0.3 (maximum-minimum) range, where the oxygen source (blower) was never shut down. It can be noted that, as the temperature increases, oxygen decreases, and vice versa; such variation is due to the solubility of dissolved oxygen being inversely proportional to the temperature [29][30][31].
Regarding the repeatability test, the statistical analysis showed no significant differences among repetitions in any of the three parameters measured by the proposed LC OSH system. The mean temperatures were 23.66, 23.72, and 23.86 • C for repetitions 1, 2, and 3, respectively. For dissolved oxygen, the means were 6.44, 6.95, and 6.85 mg L −1 for the three repetitions; while, for pH, the mean values were 8.05, 8.37, and 7.94.
For the reliability test (precision, accuracy, and sensibility), the results showed a precision of 0.106 mg L −1 and a coefficient of variation (C.V.) of 0.42% for DO. For pH, the precision was 0.242 and the C.V. was 2.6%. In the case of temperature, the precision was 0.106 • C and the C.V. was 0.421%. Table 4 lists the results for the three parameters.  Regarding the repeatability test, the statistical analysis showed no significant differences among repetitions in any of the three parameters measured by the proposed LC OSH system. The mean temperatures were 23.66, 23.72, and 23.86 °C for repetitions 1, 2, and 3, respectively. For dissolved oxygen, the means were 6.44, 6.95, and 6.85 mg L −1 for the three repetitions; while, for pH, the mean values were 8.05, 8.37, and 7.94.
For the reliability test (precision, accuracy, and sensibility), the results showed a precision of 0.106 mg L −1 and a coefficient of variation (C.V.) of 0.42% for DO. For pH, the precision was 0.242 and the C.V. was 2.6%. In the case of temperature, the precision was 0.106 °C and the C.V. was 0.421%. Table 4 lists the results for the three parameters. Table 4. Reliability (precision, accuracy, and sensibility) of the proposed low-cost water-quality system (σ is standard deviation and C.V. coefficient of variation).

Temperature
Dissolved The above results indicate that the designed equipment can be used as a reliable tool in aquaculture, as the reads were very near to those considered as the true accepted value.  Table 4. Reliability (precision, accuracy, and sensibility) of the proposed low-cost water-quality system (σ is standard deviation and C.V. coefficient of variation).

Temperature
Dissolved Oxygen pH The above results indicate that the designed equipment can be used as a reliable tool in aquaculture, as the reads were very near to those considered as the true accepted value.

Discussion
The novelty of the proposed system mainly consists of the application of open-source hardware, which provides new opportunities for the research of in situ sensing in aquaculture systems with high precision and the behavior of cultured organisms (e.g., crustaceans, fish, and shellfish). The system allows for continuous recording and storing of water physicochemical variables for metrological traceability in precision aquaculture applications. The designed low-cost equipment can provide useful information, including under harsh aquaculture environments; therefore, more consideration in care and handling are required. A growing tendency in the development of instruments such as the proposed LC system to evaluate water quality has been observed worldwide, due to the problems faced by modern aquaculture; mainly those related to hygiene and environmental care. In developing countries, as is the case in Latin America, the innovation or development of different monitoring systems using open platforms (software or hardware) is of great interest, as they are cheaper [31] and can represent savings between 30-60% [26,30,32]; in addition, they have great potential to advance food security [33].
There are currently several ways to feed aquaculture crops, one of which considers the physicochemical variables of water-especially temperature and dissolved oxygen-as they have an effect on the food intake of organisms [34]. For this reason, different platforms have been developed to supply feed based on sensors [35][36][37] and so the proposed LC OSH monitoring system could be very useful for the development of automatic feeders. There are some very important challenges for the improvement of such systems, one of them being calibration: the programming codes could be made even more robust, such that the system can detect patterns associated with the need for re-calibration. The energy used for the evaluation of the proposed LC OSH system was provided by a local electricity supplier; however, some farms in the region do not have access to the electrical grid, due to their geographical location (i.e., difficulty of access or being a large distance from cities) [38] and, so, it would be appropriate to consider, in the future, powering these systems with solar energy or rechargeable batteries using solar energy. Another challenge is access to the Internet, as mentioned above. The locations of farms make Internet connection complicated although, due to technological advances in communications, there are now more and more tools available for connecting to the Internet [39], which would be excellent, for example, for adding the proposed LC OSH system to the IoT.
Some feasible improvements to the proposed LC OSH system could be: (1) the inclusion of a monitor of water-quality index, a tool which provides a general overview of the state of contamination of the water column, that can positively help to manage the farm for a better production response [4,5,[39][40][41][42][43]; (2) the incorporation of more water-quality electrodes, such as conductivity, turbidity, and ion-selective electrodes; (3) furthermore, the addition of ion-selective electrodes (e.g., Mg, K, Ca, P, and Na) can be very useful in low-salinity cultures where the ionic balance is a key aspect-for example, some physiological and metabolic functions of shrimp, such as osmoregulation, have been directly related to Mg and K ions [44,45]; and (4) the inclusion of a module for the generation of early alerts, which are essential for farmers.

Conclusions
In this paper, the implementation of a low-cost open-source hardware system for monitoring and recording water-quality variables for aquaculture production was presented and evaluated. The proposed system was evaluated based on a comparative study assessing the measurement quality in terms of statistical analyses and comparison with commercial equipment. The results demonstrated that the data quality of the proposed system is appropriate for its use in aquaculture, with no statistically significant differences found between the proposed LC OSH system and a commercial system. The results obtained showed that the implemented system is not only a low-cost tool, but it is also precise and reliable. Considering the cost of the components, it also has a very good resolution and accuracy. These values can be used by researchers as a basis for developing remote-monitoring systems and automatic feeders based on sensors, as it is relatively easy-to-use measuring system for precision aquaculture with low cost, allowing its access to low-budget farmers.