# Water IoT Monitoring System for Aquaponics Health and Fishery Applications
## 5 In-pond WaterMon Sensor Design and Feasibility
#### 4.2.2 Overview Design  
The design of the monitoring system has been thought to be implemented on a four-layer PCB board especially designed for the purposes of this work. In Figure 4, the Fipy I2C connection is serially connected to the different sensors and the analog to signal converters. I2C, or the Inter-Integrated-Circuit protocol, is a synchronous, multi-controller/multi-target, packet-switched, single-ended, serial communication bus. It is widely used for attaching lower-speed peripheral ICs to processors and microcontrollers in short-distance, intra-board communication. These devices have been configured by software to be switched on, read a measure from a sensor, and switch it off to go to the next device to collect its measurement. The sensor is selected by using a 74 HC237 decoder multiplexer [30] and programmed in order to follow a specific order for the data collection within the sensors. The connection of the keypad to the I2C is oriented to write in the system the adequate calibration, which will be further explained in Section 5.1. In addition, the LCD connection will allow the visualisation of the information for every step of the calibration or the monitoring process. WaterMon allows the monitoring of 11 different water quality metrics, including all of those indicated in Table 3. WaterMon has been designed to provide connectivity to LoRa, LoRaWAN, and the new 5G networks by supporting the novel IoT technologies, LTE-M and NB-IoT, and low-profile technologies such as WiFi and Bluetooth. For the implementation of the LoRa protocol, we have selected the parameters shown in Table 5.  
Figure 4: Overview Design of WaterMon System. \begin{table}
\begin{tabular}{l l} \hline region = LoRa.EU868 & selection of 868 MHz as carrier frequency, the default channel is established in 868.1 MHz \\ bandwidth = LoRa.BW\_125 KHZ & selection of a bandwidth of 125 kHz \\ sf = 7 & sets the desired spreading factor; accepts values between 7 and 12 \\ Device\_class = LoRa.CLASS\_C & Class C devices extend Class A by keeping the receive windows open, unless they are transmitting \\ coding\_rate = LoRa.CODING\_4\_5 & the default coding rate is 4/5 \\ power\_mode = LoRa.ALWAYS\_ON & LoRa protocol is always listening \\ rx\_iq = False & the use of IQ inversion allows mitigating interference between up- and downlink \\ LORA\_PAYLOAD\_SIZE = 240 & payload size is configured at 240 bytes \\ LORA\_TX\_POWER = 7 & this value establishes a modulation FSK, with 2 dBm \\ \hline \end{tabular}
\end{table} 
Table 5: Parameters for LoRa configuration. The previous design has been originally prototyped in a lab-based implementation to test the feasibility of the sensor. Figure 5 shows an image captured with the early prototype achieved in the context of the project where five different water monitoring probes have been implemented as an early-stage feasibility (DO, EC, temperature, ORP, and pH). From this early prototype, a fully functional optimised version of the prototype in a printed circuit board (PCB) was designed to achieve a better performance and next to a final product. Figure 6 shows a screenshot of some of the layers available in the prototyped sensor. This board has been squeezed in 20 \(\times\) 14 cm to minimize fabrication costs. Furthermore, after testing the methodology using the virtualised 3D version of the PCB, the manufacturing was carried out by an external company, and the result is a fully functional sensor board. Afterwards, all the sensor components were soldered into the PCB, creating a fully functional prototype. The water monitoring probes were not attached before being physically inserted in liquid (as shown in the pictures) so as to not cause any damage, and thus, we put this on hold to perform the deployment of the probes in an industrially relevant scenario. The device allows the installation of 1 to 11 sensor probes, thus allowing for the customization of four different types of field sensors considered in Table 3 of this document (Type A, B, A + B, minimal A + B). Figure 5: Early Prototype.