# An IoT-Based System for Efficient Detection of Cotton Pest
## 3 Results and Discussion
### Testbed Results
#### 3.1.2 Scenario 2 Results  
As a proof of concept, experiments were carried out on houseflies and then mosquitos in the control environment. Experiments in the second scenario involved two prototype boxes consisting of type A and type B sensors separately. As mentioned earlier, two types of sensors for this experiment were chosen. The type \"A\" sensor with a light-emitting range of about thirty centimeters, which could detect nearby insects and reduce input power; however, its sensitivity was better than a relatively large sensor. It could also sense  
Figure 7: (**A**) Grain moths detected in the transparent box every 10 min. (**B**) Three types of insect detection through an A-type sensor. relatively small insects. On the other hand, the type B model was capable of detecting insects a larger distance and with high energy. Its range was about 150 cm along with better sensitivity than others in terms of range. The reason to use the two types (A and B) of sensors was to observe both near and far distances and to determine which sensor could be more useful for this purpose. Nevertheless, it was realized that both types had their benefits and both at the same time should be used. The experiments were conducted in a controlled indoor environment, which lasted for several days, and every trial lasted about 6 to 8 h. The experiments were performed on house moths/flies during the day and on mosquitoes at night so that it could be determined if the sensor was also useful for other insects, and the results were very satisfactory. Figures 8A and 9 show the results of experiments on mosquitos and flies, respectively. The figures show time on the X-axis, while on the Y-axis, the number of times flies or mosquitoes are detected by the sensors is shown. A sensor could detect any mosquito or bee multiple times. After many experiments, it was concluded that an accurate and efficient sensor could be created that would be able to detect even the smallest and fastest insects. The data received from this system could be observed from anywhere through web technologies. The results of the experiments showed that small infrared sensors were more effective than larger ones, and this performance could be optimized in the future. It was also observed that the behavior of sensors and insects in the actual field is different than in the controlled environment; for example, when the prototype was tested in the aquarium, the flying insects did not fly normally. So far, no other technologies have been utilized but other techniques such as digital image processing and artificial intelligence (AI) could be very helpful in this work. These technologies could be used to identify insect species. Because large insects have a good and large reflective index, they are easily detected by sensors. With the sensitivity of the best sensor, accurate results would inevitably be obtained. The proposed sensor's energy consumption was very low and it could be used for several days without charging the battery. In our case, six sensors on one battery were run. If one battery per sensor were used, the battery would have to be re-charged. Nevertheless, a worst-case scenario was considered in this prototype to accumulate energy first. In the field, the data were sensed, recorded, and moved immediately to the user and remote machine. The distinctive potential of the flying insect monitoring and detecting sensor prototype was its real-time behavior. This technical innovation gave the freedom to  
Figure 8: (**A**) Mosquito detection in a controlled environment. (**B**) Three types of insect detection through B sensor prototypes. (Numbers are every 10 min). make pest monitoring much more controlled and effective. It also allowed for minimizing pesticides, and if required, it could be carried out in a more targeted way. Harmful environmental impacts would be reduced, and it would provide environmentally friendly, accurate, and cost-effective pest monitoring and control.