## 4 Proposed MCA-IoT Design
### MCA-IoT Supervisory Software Development Phases and Implementation
```
1:Intra-Cluster Setup:
2:for each cluster \(i\) in set \(C\)do
3:\(pair(CH_{i},N_{i})\)
4:\(trust(CH_{i},CH_{i})\)\(\triangleright\) since a cluster head is a master in its own cluster
5:\(secure(CH_{i},N_{i})\)
6:endfor
7:
8:Inter-Cluster Setup:
9:for each initiating cluster head \(CH_{i}\) in set \(C\)do
10:\(trust(CH_{i},CH_{i+1})\)\(\triangleright\) where \(CH_{i+1}\) is the next-hop relay
11:\(pair(CH_{i},CH_{i+1})\)
12:endfor
13:
14:Adding New Cluster:
15:functionAddNewCluster(\(new\_cluster\))
16: Add \(new\_cluster\) to set \(C\)
17: Perform intra-cluster setup for \(new\_cluster\)
18:endfunction
```  
**Algorithm 2** Bluetooth sensor network setup  
```
1:Set \(R\) of all cluster heads in the sensing network
2:Data transfer until it reaches the central base or sink station
3:Let \(RT_{CH_{i}}\) be the routing table of cluster head \(CH_{i}\), mapping cluster head IDs to MAC addresses and static IP addresses. 4:Let \(NH_{CH_{i}}\) be the next-hop cluster head selected by cluster head \(CH_{i}\). 5:Let \(D_{CH_{i}}\) be the distance between cluster head \(CH_{i}\) and the next-hop cluster head. 6:Initialization:
7:for each cluster head \(CH_{i}\) in set \(R\)do
8: Initialize routing table: \(RT_{CH_{i}}=\{(ID_{j},MAC_{j},IP_{j})\mid\text{for all }j\}\)
9:endfor
10:
11:functionHopData(\(CH_{i}\))
12: Check routing table: \(NH_{CH_{i}}=RT_{CH_{i}}(ID_{NH_{i}})\)
13:if\(NH_{CH_{i}}\) is down or out of service then
14: Select next-hop cluster head with same distance: \(NH_{CH_{i}}=\arg\min_{j}\{D_{CH_{i}},\;s.t.\;RT_{CH_{i}}(ID_{j})\) is available\(\}\)
15: Trigger cron job to set up Bluetooth connection: \(Setup Bluetooth(CH_{i},NH_{CH_{i}})\)
16:endif
17: Transfer data to \(NH_{CH_{i}}\)
18:endfunction
19:
20:The process continues until the data hit the central base or sink station. ## 5 Experimental Setup, Results, and Discussion

The MCA-IoT technology was deployed and evaluated with a six-cluster configuration, as depicted in Figure 10, under both indoor and on-farm environments, demonstrating scalability. BLE-based intra- and inter-cluster distances were determined to be 5 m using the theoretical approach outlined in Sections 3-5, following the methodology proposed

Figure 14: Proposed MCA-IoT technology in full indoor and outdoor operation modes. by the authors of [10] to mitigate potential packet drops. The LoRa-based communication distances measured were 2.1 km for line-of-sight (LoS) and 1.5 km for non-line-of-sight (NLoS) scenarios. However, since the LoRa base station was deployed on the farm, these distances were considered insignificant for our experimental setup. ### Experimental Setup

The on-farm deployment schematic, which incorporates equidistant inter- and intra-cluster placements based on the power optimization framework described in Section 3, is illustrated in Figure 15. While the distance remains constant, BLE technology performance may vary due to environmental factors such as physical obstructions, dust concentration, and interference from other wireless technologies like Wi-Fi and ZigBee [10; 50]. In our case, a 5-m distance was chosen, aligning with the threshold range for stable BLE connectivity and minimal interference observed in Tarkwa, Ghana, where the range was between 5 and 6 m. This selection is consistent with the sensing coverage requirements for agricultural soil proposed in [19; 31]. The 5-m distance ensures optimal range overlap, comprehensive farm coverage, and reliable connectivity, particularly when battery power falls below 30% of its rated capacity. The setup and deployment of the MCA-IoT network followed a four-step process:

1. **Deployment of Static Nodes:** Static nodes were positioned based on the cluster quality estimation technique from [18]. BLE radio RSSI levels were estimated, and all network components were powered by solar-rechargeable power banks. These were installed on stands elevated above the crops to prevent shading, ensuring adequate sunlight exposure. Soil moisture sensors were installed in the soil before activating the MCA-IoT network. 2.