# New Protocol and Architecture for a Wastewater Treatment System Intended for Irrigation
## 2 Materials and Methods
### Node Description  
In this subsection, the description of the characteristics of the node, the sensors, and the actuators are performed.  
In our proposed system, the nodes are deployed throughout the expanse of the canals, both for urban areas and farming areas. The quantity of nodes depends on the number of canals and their specific needs. The employed nodes are Arduino Mega 2560 [12]. The node has 16 analog input pins and 54 digital input/output pins, allowing for connecting many sensors to one single node. Moreover, it provides a universal serial bus (USB) connection, 4 universal asynchronous receiver-transmitter (UART) serial ports, a power jack, a 16 MHz crystal oscillator, an in-circuit serial programming (ICSP) header, and a reset button. However, as the node does not provide an integrated wireless interface, it is necessary to incorporate wireless modules. The nodes can be provided with long-range wide area network (LoRaWAN) connectivity by employing the module F8L10D-N [13] which transmits in the 868 Mhz band.  
The sensor used to monitor water quality will be used to monitor turbidity and conductivity. For the detection of turbidity, optical sensors are used, while for conductivity monitoring, inductive sensors are used. The turbidity sensor is based on that presented in [14]. It is made with two light emitting diodes (LED) that emit at different wavelengths and two light detectors. One of the LEDs has a maximum wavelength of 612-625 nm and the other of 850 nm. The light detectors are a light-dependent resistor (LDR) that responds to the visible light of the first LED and a photodiode that responds to the infrared (IR) light of the second LED. The turbidity sensor is placed before and after the application of the filters to treat the water. The LEDs are powered at 3.3 V using the 3.3 V output voltage.  
The conductivity sensor is based on the prototype described in [10]. It is composed of two copper coils. The first coil is powered with a sine wave and the second coil is induced. The induced voltage depends on the conductivity of the water. The powered coil is powered with the Arduino using an analog output (PWM) pin. The generated voltage in the induced coil is measured. Both the turbidity sensor and the conductivity sensor are connected to the same node. They are placed before and after the filters and will monitor the correct operation of the wastewater treatment filters by registering the changes in water quality. Additionally, we use a sensor to detect the presence of hydrocarbon in the water. The sensor is based on the photoluminescence effect linked to the hydrocarbons. In the design of the sensor, different light colors are used to excite the molecules of a hydrocarbon. The light source is an LED and a photodetector is used as a receptor of the emitted light.  
In order to execute the actions determined by the system, some nodes need to include an actuator. As an actuator connected to an Arduino node, a linear actuator can be utilized. The linear actuator is a device that converts the rotational motion of a low-voltage direct current (DC) motor into linear motion. This device can be utilized to open and close the gate for controlling the water in the canal.