Pest infestation is one of the main causes of declining productivity in chili (Capsicum annuum L.) cultivation, while conventional monitoring still relies on manual visual inspection that is subjective, time-consuming, and prone to delayed detection. This study aims to design and implement an Internet of Things (IoT) based real-time pest monitoring system that integrates an image sensor and a soil moisture sensor on chili plants. The system is built around an ESP32 microcontroller and an ESP32-CAM module that captures leaf images, which are analyzed on a server using the You Only Look Once version 8 (YOLOv8) object detection model, while a capacitive soil moisture sensor monitors the growing-media condition. The detection model was trained on a Pest Detection dataset from Roboflow Universe consisting of 38,449 images across 28 pest classes, using 40 epochs and an input size of 480 pixels. Evaluation on 1,612 test images produced a precision of 0.853, a recall of 0.735, an mAP@0.5 of 0.778, an mAP@0.5:0.95 of 0.606, and an F1-score of approximately 0.79. A dedicated eight-stage image pre-processing pipeline was applied to reduce the domain gap between the high-quality training images and the lower-quality ESP32-CAM production images, and all sensor data were transmitted to the server with an average latency below two seconds. The results show that the integration of visual detection and environmental sensing produces an accurate and responsive early-warning system that is suitable for low-cost smart-farming deployment.
Copyrights © 2026