## 4 Results and Discussion
### Results of the Fish Behaviour Sensors
In this case, instead of representing the _Vout_ of the sensor we process the data with the code (see Figure 20) to read this sensor. As this presence sensor gives qualitative data a threshold value must be set. In the database, it is considered that the fish are present if the _Vout_ is higher than 1.5 V, and the state of variable is 1. Consequently, when the value of the _Vout_ received is lower than 1.5 V the state of variable is set on 0. In the first scenario, Figure 19a, the data after being transformed by the algorithm can be seen in Figure 21. In this case, the state of the variable fish presence changes from 0 to 1 periodically, indicating the pass of the fish shoal close to the presence sensor. Thus, it is possible to estimate the shoal mean velocity (MV) by considering that the shoal swims in a circle and estimating that the diameter of this circle is 10% of the tank diameter. The MV will therefore be given by Equation (4):  
\[MV\;(\frac{\text{m}}{\text{s}})=\frac{(\diameter{Tank}\;(\text{m})\times 0.9)\times \pi}{\textit{Time between intervals}\;(\text{s})} \tag{4}\]  
Nevertheless, in scenario 2 it is not possible to measure the fish MV with this methodology. In this case, it is possible to estimate the variations in the velocity using the variations in the _Vout_. Different fish velocities require different frequencies of propulsion. The greater the movement, the faster the changes in illumination received by the LDR. In this case, it will be impossible to establish the MV; but the system can give information about if the MV increase or decrease. Three tests were done in a tank with fish swimming at different velocities. The data from scenario 1 and scenario 2 corresponds to fish swimming at slower velocity than in scenario 3. The frequency of sensed data in these experiments is the maximum available by the system, 1 data each 0.33 s. The _Vout_ data of the three scenarios are presented in Figure 22. We can see that in scenario 1 and 2 there is an oscillation similar to a sine pattern between the maximum and minimum _Vout_ values almost constant. However, in scenario 3 this sine pattern is not visible. This is because the flashes produced by the fish scales illuminate the LDR for very short periods. The LDR needs a little time exposed to the light to reach the maximum value and in scenario 3 the flashes are shorter than this period. Then, the LDR is not able to reach the maximum value reached in the other two scenarios. The best way to differentiate between scenarios is to consider the number of peaks in the _Vout_ that appear over 15 s. While in scenarios 1 and 2 the number of peaks is equal to 5 in scenario 3 the number of peaks is 11. Therefore, the number of peaks in _Vout_ over 15 s is a good indicator of MV (IMV); see Equation (5). When the MV increases the number of peaks will increase. Figure 17.0  
Figure 17.1 Data gathered by the fish presence sensor. Figure 17.2 Fish shoal distribution in tested scenarios and LDR location. Figure 17.3 Code for presence sensor. Figure 17.4 State of variable fish presence of one sensor in different scenarios. Finally, the results of the sensor employed to detect the feed falling are presented. For the calibration of this sensor, pictures of the drainage tube without pellets and with pellets are analyzed. The histograms of those pictures were obtained using a Matlab library. First, we analyze the red, green, and blue histograms to compare the values of the pictures without feed and pictures with feed. The blue histogram is the one that shows the highest differences between both situations. Specifically, in the blue histogram, the region with the highest differences, the RI, is the region of blitheness values (BV) between 130 and 150. The \(\sum\)RI of different pictures as the % of pixels in the RI can be seen in Figure 17.5 It is possible to see that in Figure 23, pictures 1 to 4 present values lower than 25% while pictures 5 to 8 have values higher than 50%. Thus, the threshold for this sensor will be the \(\sum\)RI value of 30%.