# Energy-Efficient IoT-Based Light Control System in Smart Indoor Agriculture
## 5 Results and Discussion
### Network Performance Evaluation  
After showing that the control method works, it is necessary to see if the data transmission in the constructed network is good enough to ensure that the measured sensor values and the computed control values reach their destination and prove the efficiency of the overall system. The network was evaluated in terms of data transmission quality, including the amount of packet loss and the delay in packet delivery. It was also evaluated in terms of the energy consumed by the nodes for computation, data sending, and listening (waiting for data). To do so, the system was simulated for 10,000 s under the conditions listed in Table 1, and the evaluation metrics were computed for a network size varying from 10 to 60 nodes. The packet loss ratio (PLR) is computed by Equation (3):  
\[PLR=\left(1-\frac{\sum Received\ packets}{\sum Sent\ packets}\right)100 \tag{3}\]  
the obtained results are shown in Figure 12, where it can be seen that the packet loss ratio increases with the network size. This graph shows that there is no big difference between the three RPL OFs, but the MRHOF-energy OF shows the highest packet loss ratio because it basically chooses the forwarding nodes based on their energy consumption and not based on the success of packet transmission like the MRHOF-ETX. The end-to-end delay or the latency is computed by Equation (4):  
\[Delay=\sum_{i=1}^{n}(RT_{i}-ST_{i}) \tag{4}\]  
where \(RT_{i}\) is the packet receiving time of the node \(i\) and \(ST_{i}\) is its packet sending time. Similarly, the time of packet delivery also increases with the network size; this is because the packets pass through a higher number of forwarding nodes before reaching their destination as shown in Figure 13. The objective function OF0 performs better in this case since it is designed to choose the shortest path to the destination, which reduces the number of forwarding nodes for the packets. A high packet loss ratio and delay can occur in the case of large size networks; see, for instance, the 60 nodes case in Figures 12 and 13. To see if this affects the control method and changes the light conditions in the growth chambers, another simulation with 60 nodes was performed. The obtained light measurements that were sent from the clients and received by the server are shown in Figure 14, while the control values sent from the server to the clients are plotted in Figure 15. Notice that the control process was not affected in this case, and all the measured light intensities converge to the desired values. The energy is computed by the Energest tool (Powertrace in Contiki); the resulting energy consumption value is the sum of the amounts consumed by the microcontroller  
Figure 11: The communication sequence to the server during the light control process. in the CPU processing mode, CPU low-power mode, data transmission mode, and data listening mode. The total energy consumption of the network naturally increases with the number of nodes, as shown in Figure 16. In this case, the objective functions OF0 and MRHOF-energy perform better than MRHOF-ETX. The reasons for this are that the MRHOF-ETX calculation method is computationally more expensive than the other OFs and may consume more energy; also, the routes chosen by the MRHOF-ETX are not necessarily the shortest ones but the ones that ensure the packet delivery. Figures 17 and 18 show the evolution of the energy consumption over time for the 10 and 60 nodes cases, respectively. It can be seen that the energy consumption stabilizes after a certain time when the network configuration is finished, the routes are established, and the computation time spent on the routing process decreases. For small networks (Figure 17), all the OFs give the same performance after network stabilization, in terms of energy consumption, while the difference between them appears in large networks  
Figure 16: Total energy consumption of all the nodes depending on the size of the network. Figure 14: PAR light measurements sent from the clients to the server, 60 nodes case.