# Optical Camera Communication as an Enabling Technology for Microalgae Cultivation +
## 4 Methodology
### Plant Distribution Study  
This section describes the preliminary study of the best plant distribution for a real case study. In this case, it is intended to locate 12 custom containers of 150 \(\times\) 50 \(\times\) 9 cm (height by width by depth) in a 300 \(\times\) 200 \(\times\) 300 cm empty room. These containers must be placed in individual racks capable of holding up to 4 containers, two at the top and two at the bottom. In terms of communication performance, those cases must satisfy the following derived constraints. The top photobioreactors will fill the upper half of the image and the lower ones the lower half. Consequently, the camera should always point to the shelf's vertical centre, and it will be aligned with respect to the centre (in the vertical dimension). In this way, the transfer rate is ensured to be equal for each reactor, with the number of vertical pixels equal to half of the image's vertical resolution (Equation (33)). The minimum pixel width of any reactor was set to 30 pixels (Equation (34)). This value was selected after conducting preliminary experimental tests. Finally, it must be highlighted that the sensor's aspect ratio relates both the vertical and the horizontal \(FoV\), aspect\({}_{\text{ratio}}\); thus, altering one of them will influence the other. To properly address this analysis, it is necessary to select a camera as an example. The camera selected is the PiCamera v2, detailed in Table 1. Using this camera with an exposure time of 57 \(\upmu\)s and attending to the previously stated conditions, the maximum baud rate achievable is approximately 717 (Bd/reactor) per available channel. Considering three independent communication channels, red, green and blue, the maximum baud rate is 2151 (Bd/reactor). This value is obtained by combining Equations (15), (16), (17) and (33) into Equation (36). The cut-off frequency was computed using [PERSON]'s algorithm and is approximately 8213 Hz. \[h_{\text{rei}}=H_{p}\cdot\frac{h_{\text{res}}}{\text{FoV}_{V}}= \frac{h_{\text{res}}}{2}\quad(\text{pixels}) \tag{33}\] \[w_{\text{rei}}=W_{p}\cdot\frac{w_{\text{res}}}{\text{FoV}_{H}} \geq 30\quad(\text{pixels})\] (34) \[\text{where :}\quad\text{AoV}_{H}=\text{AoV}_{V}\cdot\text{aspect}_{ \text{ratio}} \tag{35}\]  
\[R_{\text{b}}=S_{\text{packet}}\cdot\frac{fps}{2}=\frac{h_{\text{roi}}}{h_{ \text{s}}\cdot 2}\cdot\frac{fps}{2}=\frac{h_{\text{res}}}{4}\cdot\frac{f_{ \text{3 dB}}\cdot t_{\text{s}}}{2}\cdot\frac{fps}{2} \tag{36}\]  
Taking into account all these starting requirements, three different cases are proposed. Those cases are shown in Figure 5. In the first case, Case I, the camera is perfectly aligned with the shelf's centre. In Case II, the camera is shifted on the y-axis, and it views the rack from the side. In the last case (Case III), another rack is included, forming a corridor, and the camera is aligned to its centre. In the remainder of this section, the procedure for calculating the metrics for each case is detailed. In all the cases, the restrictions mentioned above were used to compute the camera's location by optimising the SUR quantity. For clarification, Figure 5 shows the geometrical definitions, variables and relations over the scenario's top and side view. The variables \(d_{cam,i}\) are the camera's relative distance from the shelf, \(h_{shelf}\), \(l_{shelf}\) the shelf's height and length, respectively, and \(h_{cont}\), \(l_{cont}\) the container's height and length, respectively.