Next Article in Journal
Smart Automation for Residential Spaces with PLC-ESP32 Architecture
Previous Article in Journal
Web Application Protection Optimization Through Coraza WAF: Performance Assessment Against OWASP Risks in Reverse Proxy Configurations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

IoT System for Monitoring and Controlling Microclimates in a Fruit Fly Breeding Chamber †

by
Luigi O. Freire
1,*,
Jessica N. Castillo
1,
E. Freddy Robalino
2,3,
Luis Antonio Flores
2,4 and
Danilo Fabricio Trujillo
4,5
1
Universidad Técnica de Cotopaxi, Latacunga 050108, Ecuador
2
Facultad de Ingeniería en Sistemas, Electrónica e Industrial (FISEI), Universidad Técnica de Ambato, Av. Los Chasquis y Río Payamino, Ambato 180207, Ecuador
3
Universidad Nacional de Trujillo (UNT), Av. Juan Pablo II s/n, Trujillo 13008, Peru
4
Facultad de Ingeniería Eléctrica y Electrónica (FIEE), Escuela Politécnica Nacional, Quito 170525, Ecuador
5
Facultad de Diseño y Arquitectura (FDA), Universidad Técnica de Ambato, Av. Los Chasquis y Río Payamino, Ambato 180207, Ecuador
*
Author to whom correspondence should be addressed.
Presented at the XXXIII Conference on Electrical and Electronic Engineering, Quito, Ecuador, 11–14 November 2025.
Eng. Proc. 2025, 115(1), 2; https://doi.org/10.3390/engproc2025115002
Published: 17 November 2025
(This article belongs to the Proceedings of The XXXIII Conference on Electrical and Electronic Engineering)

Abstract

Controlling the microclimate is vital in fruit fly breeding. This project develops an automated IoT system for monitoring and controlling temperature and relative humidity in chambers, optimizing processes through accessible and flexible technology. It uses a multi-layer system starting with the application layer with the ESP32 for data acquisition and actuator control. The second layer is the network layer, and the perception layer uses VisionFive2 with MQTT and HTTP protocols for communication, as well as NodeRed for flow orchestration and MySQL for data management and storage. In the validation, there are absolute errors of ±0.434 °C and ±0.5 RH, which are values within the acceptable ranges for these applications.

1. Introduction

Controlling environmental conditions in a given setting is vital to the success of studies on fruit fly breeding, specifically Anastrepha, a pest that has had a significant impact on crops in Latin America. By controlling temperature and relative humidity, rearing chambers allow for analysis of larval stages, fertility, longevity, and host types. In other cases, they enable the development of biological control programs and sterile insect techniques (SIT). Precision control will eliminate variability in these climate chamber systems, giving greater consistency to the process [1,2,3].
In recent years, the Internet of Things (IoT) has gained relevance in the technological field, becoming a key tool in automation and enabling optimal management through intelligent systems in the areas of agriculture, livestock, and environmental control [4,5,6]. The ability to process and collect data in real time leads to automatic decision-making, resulting in the optimization of resources, reducing human intervention and, therefore, errors, as well as providing traceability of production conditions [7,8,9].
The use of platforms and development boards based on RISC-V architecture offers broad integration with microcontrollers (ESP32), stream orchestration platforms such as Node-Red, and database systems (MySQL) offers great flexibility in hardware integration as well as communication protocols [10,11,12].
Similar systems have been used in the control of smart bird cages [13], monitoring of electrical generation and distribution systems [14,15,16], smart irrigation control [17,18], among other applications, have demonstrated that the optimization of resources such as energy [19] and error reduction are feasible with the integration of processes with the cloud [20,21,22].
Lightweight protocols such as MQTT and CoAP are solid options for efficient communication between IoT applications, as they offer low energy consumption and high reliability in distributed sensor networks [23,24,25,26]. This is relevant because insect farming processes require minimal maintenance intervention and guarantee continuous operation.
Likewise, the incorporation of AI can anticipate adjustments for unwanted fluctuations in temperature and relative humidity [27,28,29,30]. Several studies, such as environmental control in aquaculture or intelligent compost management, support the technological potential of these applications, substantially improving productivity and product quality [31,32,33].
This proposal develops an IoT system for monitoring and controlling temperature and relative humidity in fruit fly breeding chambers using the ESPS32 as a data acquisition card, NodeRed for flow orchestration, MYSQL for data management, and VisionFive2 as a processor. This maintains a local and remotely accessible graphical interface, ensuring continuous operation and contributing to the automation and modernization of phytosanitary programs in Ecuador.
Unlike commercial models, this proposal integrates two control variables: temperature and relative humidity, as well as historical data management and an intuitive interface with local or remote accessibility. These features allow for a response to external factors that alter the experiment, such as power failures and climatic variations, enabling the validation of conditions and avoiding the repetition of the experiment due to external factors [5,33].

2. System Design

The design of the IoT monitoring and control system is based on three layers, presenting a functional separation and future scalability, ensuring interoperability between heterogeneous hardware, as shown in Figure 1.
Although similar solutions exist on the commercial market, this proposal tailors its development to the specific needs of the experiment with a system featuring an intuitive interface for operation and a control system that ensures minimal variation in the microclimate, as well as autonomy, which avoids constant monitoring [6,22].

2.1. Perception Layer (Edge)

This layer is at the data acquisition level, in this case temperature and relative humidity.
Sensor: SHT32, digital sensor with accuracy of ±0.3 °C and ±2% RH, long term stable, internal temperature compensation.
Data acquisition: ESP32 microcontroller, dual-core processor, Wi-Fi connectivity
Local preprocessing: the microcontroller executes filtering routines that reduce noise, improving data reliability.
This layer is defined as Edge because it allows data acquisition and preprocessing locally using the ESP32. This happens before the information is transmitted to the network, ensuring speed and reliability [10].

2.2. Network Layer

The sensor nodes and cameras are connected to the central server via a 2.4 GHz wireless Wi-Fi network.
The MQTT protocol was selected because it allows for the exchange of information, in addition to its low bandwidth consumption and its ability to tolerate temporary interruptions [24,25]. Complementing this, the HTTP protocol was also selected for tasks such as configuration, testing, and validation.
The VisionFive2 card acts as a server where a MosquittoMQTT Broker organizes the data so that information flows asynchronously and flexibly through a publish/subscribe scheme. Additionally, it incorporates a mechanism for automatic reconnection QOS1, making message integrity robust [23].

2.3. Application Layer

In this layer, logical orchestration is implemented using Node-Red, which facilitates the integration of systems for controlling temperature and relative humidity variables. It also allows for the management of automatic notifications in the event of unwanted deviations, enabling autonomous operation in real time [23].
The integration of processes for data management, variable monitoring, and control is fundamental to the operation of the system. Node-Red establishes the flow of input and output data (sensors/actuators) and operations based on data. This orchestration engine is based on node architecture, which allows for scalability, implementation of logical functions, control algorithms, and real-time analysis.
The information collected is stored in a MySQL database hosted on VisionFive2, allowing users to access historical data through graphs or CSV files. It is also designed to send notifications in case of critical deviations, ensuring greater process reliability.
The sensor nodes and cameras are connected via a 2.4 GHz wireless WiFi network.

2.4. Experimental Environment

The breeding chamber is a technological conversion of a conventional panoramic refrigerator. The modification allows for controlled microclimates to be obtained for the breeding of fruit flies. It has features that guarantee stable temperature, relative humidity, and air circulation, maintaining optimal conditions at each stage of the fly’s development.
The chamber has a capacity of 1.5 cubic meters and an adjustable working range of 0 to 30 °C with an error of ±0.3 °C, temperatures recorded in the areas affected by the pest, as well as adjustable relative humidity between 40% and 90 ± 2%, which prevents dehydration or the proliferation of fungi.
Figure 2 shows the layout of the temperature and relative humidity sensor.

2.5. Control System

The heat source is a 250 W ceramic electric resistance controlled by a solid state relay. This resistance is located on the outside and connected to the inside of the chamber by a ventilation duct.
Humidification is provided by a 2.4 MHz ultrasonic generator, which is regulated by a PID to prevent condensation peaks. This is shown in Figure 2.

3. Results

The main objective of this work is to validate the accuracy and autonomy of the IoT system in order to maintain stable microclimates.
The performance of the IoT system in monitoring and controlling the temperature and relative humidity of the breeding chamber is verified by the stability of the microclimate generated and the reliability of data transmission and storage.
The data measured and stored by the system were compared with the HTC-1 thermohygrometer. The comparison was made at different levels of temperature and relative humidity.
Table 1 shows the comparison of readings between the desired value and the values measured with two temperature devices.
Table 2 shows the comparison between the desired value and the values measured with two relative humidity devices.
The relative error is calculated using the values obtained, as shown in Figure 3. the mean absolute error is 0.434 °C in temperature and a mean relative error of 4.8%, while the mean absolute error is 0.5%RH and a mean relative error of 0.78%, data that confirm that the microclimates generated are within the accepted ranges [3].
Once the errors have been calculated, consistency tests are carried out over a period of time, showing the evolution of temperature and relative humidity in 20 s intervals, as shown in Figure 4.
Other variables necessary in the process are shown in Table 3. The performance indicators show that the MQTT response time handles messages quickly for real-time application, averaging 180 ms. Energy consumption is 12.4 kWh, which varies depending on the desired microclimate value. However, consumption is moderate. Finally, the WiFi reconnection time averages 3.5 s, which is acceptable since it is a non-critical application.

4. Conclusions

The IoT system shows acceptable control of temperature and relative humidity variables with absolute errors of ±0.434 °C and ±0.5 HR, respectively. Based on previous studies, this variation is acceptable, guaranteeing optimal conditions and reducing the variability of the climatic environment for fly breeding.
As the hardware and software are open source, the response times in the message package are adequate, as it is not a critical process, with average responses of 180 ms in the MQTT protocol and an average of 3.5 s in WiFi reconnection times. Consumption also shows that the operation of these technological proposals is sustainable in terms of the responses they will provide to the management of certain pests.
One of the main contributions is the development of an intuitive interface that allows historical data management with local and remote access, improving the traceability of the experiment. The control systems implemented reduce the variability of the microclimates generated, ensuring optimal and consistent conditions for fruit fly breeding. Additionally, the robustness of communication and autonomy of the system
The multi-layer architecture allows for flexible and scalable integration with real-time monitoring capabilities, database management for historical monitoring, and notifications of possible critical deviations that could affect the experiment.
The system can be improved. The limitations identified focus on the dependence on a stable and continuous power supply, as well as variables such as atmospheric pressure, CO2 concentration, and lighting levels. For future developments, we propose the incorporation of real climate curves, improving the capacity for advanced phytosanitary applications.

Author Contributions

Conceptualization, L.O.F.; methodology, L.O.F., J.N.C., E.F.R., and L.A.F.; formal analysis, D.F.T.; research, L.O.F. and J.N.C.; resources, J.N.C., E.F.R.; writing of the original draft, L.O.F. and J.N.C.; writing: review and editing, E.F.R., L.O.F., and D.F.T.; visualization, L.O.F. and J.N.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Lovett, G.M.; Burns, D.A.; Driscoll, C.T.; Jenkins, J.C.; Mitchell, M.J.; Rustad, L.; Shanley, J.B.; Likens, G.E.; Haeuber, R. Who needs environmental monitoring? Front. Ecol. Environ. 2007, 5, 253–260. [Google Scholar] [CrossRef]
  2. Kirkhorn, S.R.; Schenker, M.B. Current Health Effects of Agricultural Work: Respiratory Disease, Cancer, Reproductive Effects, Musculoskeletal Injuries, and Pesticide–Related Illnesses. J. Agric. Saf. Health 2002, 8, 16. [Google Scholar] [CrossRef]
  3. Jacome, E.; Jácome, C.J.; Bayancela, S.; Freire, L.O. Technological Reconversion of a Climatic Chamber for the Artificial Rearing of Fruit Flies of the Species (Anastrepha striata). Smart Innov. Syst. Technol. 2024, 372, 573–580. [Google Scholar] [CrossRef]
  4. Pamula, A.S.P.; Ravilla, A.; Madiraju, S.V.H. Applications of the Internet of Things (IoT) in Real-Time Monitoring of Contaminants in the Air, Water, and Soil. Eng. Proc. 2022, 27, 26. [Google Scholar] [CrossRef]
  5. Al-Fuqaha, A.; Guizani, M.; Aledhari, M.; Ayyash, M. Internet of Things: A Survey on Enabling Technologies, Protocols, and Applications. IEEE Commun. Surv. Tutor. 2015, 17, 2347–2376. [Google Scholar] [CrossRef]
  6. Hosny, K.M.; Magdi, A.; Salah, A.; El-Komy, O.; Lashin, N.A. Internet of Things Applications Using Raspberry-Pi: A Survey. Int. J. Electr. Comput. Eng. 2023, 13, 902–910. [Google Scholar] [CrossRef]
  7. Mohiuddin, M.; Islam, M.S.; Shanjida, S. Internet of Things (IoT)-Based Smart Agriculture Irrigation and Monitoring System Using Ubidots Server. Eng. Proc. 2024, 82, 99. [Google Scholar] [CrossRef]
  8. Behera, T.M.; Mohapatra, S.K.; Samal, U.C.; Khan, M.S.; Daneshmand, M.; Gandomi, A.H. I-SEP: An Improved Routing Protocol for Heterogeneous WSN for IoT-Based Environmental Monitoring. IEEE Internet Things J. 2019, 7, 710–717. [Google Scholar] [CrossRef]
  9. Rajalakshmi, P.; Mahalakshmi, S.D. IOT Based Crop-Field Monitoring and Irrigation Automation. In Proceedings of the 10th International Conference on Intelligent Systems and Control (ISCO), Coimbatore, India, 7–8 January 2016; pp. 1–6. [Google Scholar]
  10. Jo, R.S.; Lu, M.; Raman, V.; Then, P.H.H. Design and Implementation of IoT-enabled Compost Monitoring System. In Proceedings of the IEEE 9th Symposium on Computer Applications & Industrial Electronics (ISCAIE), Kota Kinabalu, Malaysia, 27–28 April 2019; pp. 27–28. [Google Scholar] [CrossRef]
  11. de Melo, G.C.G.; Torres, I.C.; de Araújo, Í.B.Q.; Brito, D.B.; Barboza, E.A. A Low-Cost IoT System for Real-Time Monitoring of Climatic Variables and Photovoltaic Generation for Smart Grid Application. Sensors 2021, 21, 3293. [Google Scholar] [CrossRef]
  12. Vacacela, S.G.; Freire, L.O. Implementation of a Network of Wireless Weather Stations Using a Protocol Stack. In Intelligent Manufacturing and Energy Sustainability; Smart Innovation, Systems and Technologies (SIST); Springer: Singapore, 2021; Volume 213. [Google Scholar] [CrossRef]
  13. Mulyono, A.; Suriadikusumah, A.; Harriyanto, R.; Djuwansah, M.R. Soil Quality under Agroforestry Trees Pattern in Upper Citarum Watershed, Indonesia. J. Ecol. Eng. 2019, 20, 203–213. [Google Scholar] [CrossRef]
  14. Chandra, A.A.; Jannif, N.I.; Prakash, S.; Padiachy, V. Cloud Based Real-time Monitoring and Control of Diesel Generator using the IoT Technology. In Proceedings of the 20th International Conference on Electrical Machines and Systems (ICEMS), Sydney, Australia, 11–14 August 2017. [Google Scholar] [CrossRef]
  15. Memon, G.S.; Jaffer, S.S.; Zaidi, S.; Sheikh, M.M.; Jabbar, M.U.; Ahad, A. An IOT-Enabled Generator for Power Monitoring and Load Management with Power Factor Improvement. Eng. Proc. 2021, 12, 33. [Google Scholar] [CrossRef]
  16. Khan, M.A.; Waqas, A.; Khand, Q.U.; Khan, S. Context Aware Fuel Monitoring System for Cellular Sites. Int. J. Adv. Comput. Sci. Appl. 2017, 8, 281–285. [Google Scholar] [CrossRef]
  17. Mhaned, A.; Mouatassim, S.; Haji, M.E.; Benhra, J. Low-Cost Smart Irrigation System Based on Internet of Things and Fuzzy Logic. In Smart Applications and Data Analysis; Communications in Computer and Information Science; Springer: Cham, Switzerland, 2022; pp. 78–89. [Google Scholar] [CrossRef]
  18. Mhaned, A.; Salma, M.; Mounia, E.H.; Jamal, B. Contribution to Smart Irrigation Based on Internet of Things and Artificial Intelligence. In Proceedings of the 6th International Conference on Big Data and Internet of Things, Tangier, Morocco, 25–27 October 2022; Lecture Notes in Networks and Systems. pp. 537–549. [Google Scholar] [CrossRef]
  19. Castillo, J.N.; Carrillo, G.G.; Freire, L.O.; Culqui, J. Fusion of Data and Modeling Techniques in Power Quality Compensation Using SAPF. Fusion Pract. Appl. 2024, 16, 8–21. [Google Scholar]
  20. Al Noman, A.; Baidya, P.; Hossain, M.A.; Dev, P.; Saha, K.; Hossain, M.L. Design and Implementation IoT-Driven Distribution Transformer Health Monitoring System for the Smart Power Grid. Eng. Proc. 2025, 87, 27. [Google Scholar] [CrossRef]
  21. Nie, X.; Fan, T.; Wang, B.; Li, Z.; Shankar, A.; Manickam, A. Big Data Analytics and IoT in Operation Safety Management in Under Water Management. Comput. Commun. 2020, 154, 188–196. [Google Scholar] [CrossRef]
  22. Safara, F.; Souri, A.; Baker, T.; Al Ridhawi, I.; Aloqaily, M. PriNergy: A Priority-Based Energy-Efficient Routing Method for IoT Systems. J. Supercomput. 2020, 76, 8609–8626. [Google Scholar] [CrossRef]
  23. Aleesha, M.; Laseena, C.A. MQTT Protocol for Resource Constrained IoT Applications: A Review. In Proceedings of the International Conference on Systems, Energy and Environment 2022 (ICSEE 2022), Kerala, India, 5–6 August 2022; SSRN Electronic Journal: Rochester, NY, USA, 2022. [Google Scholar] [CrossRef]
  24. Bormann, C.; Castellani, A.P.; Shelby, Z. CoAP: An Application Protocol for Billions of Tiny Internet Nodes. IEEE Internet Comput. 2012, 16, 62–67. [Google Scholar] [CrossRef]
  25. Naik, N. Choice of Effective Messaging Protocols for IoT Systems: MQTT, CoAP, AMQP and HTTP. In Proceedings of the 2017 IEEE International Symposium on Systems Engineering (ISSE), Vienna, Austria, 11–13 October 2017. [Google Scholar] [CrossRef]
  26. Gupta, P.; Indhra, M. A Survey of Application Layer Protocols for Internet of Things. In Proceedings of the International Conference on Communication, Information and Computing Technology (ICCICT), Mumbai, India, 25–27 June 2021. [Google Scholar] [CrossRef]
  27. Fouguira, S.; Ammar, E.; Haji, M.E.; Benhra, J. Internet of Things and Predictive Artificial Intelligence for SmartComposting Process in the Context of Circular Economy. Eng. Proc. 2025, 97, 16. [Google Scholar] [CrossRef]
  28. Han, Y.; Du, Z.; Hu, X.; Li, Y.; Cai, D.; Fan, J.; Geng, Z. Production Prediction Modeling of Food Waste Anaerobic Digestion for Resources Saving Based on SMOTE-LSTM. Appl. Energy 2023, 352, 122024. [Google Scholar] [CrossRef]
  29. Porras, J.; Navarrete, L.; Castillo, J.N.; Freire, L.O. Pressure Control of a Compressed Air System Based on Hardware in the Loop. In Digital Technologies and Applications; Lecture Notes in Networks and Systems (LNNS); Springer: Cham, Switzerland, 2023; Volume 669. [Google Scholar] [CrossRef]
  30. Wojcieszak, D.; Zaborowicz, M.; Przybyl, J.; Boniecki, P.; Jedrus, A. Assessment of the Content of Dry Matter and Dry Organic Matter in Compost with Neural Modelling Methods. Agriculture 2021, 11, 307. [Google Scholar] [CrossRef]
  31. Fouguira, S.; Benhra, J.; El Haji, M.; Ammar, E. Optimization of Olive Oil Extraction Wastes Co-Composting Procedure Based on Bioprocessing Parameters. Heliyon 2023, 181, e107040. [Google Scholar] [CrossRef] [PubMed]
  32. Meng, X.; Liu, B.; Zhang, H.; Wu, J.; Yuan, X.; Cui, Z. Co-composting of the Biogas Residues and Spent Mushroom Substrate: Physicochemical Properties and Maturity Assessment. Bioresour. Technol. 2019, 276, 281–287. [Google Scholar] [CrossRef] [PubMed]
  33. Parra, L.; Sendra, S.; García, L.; Lloret, J. Design and Deployment of Low-Cost Sensors for Monitoring the Water Quality and Fish Behavior in Aquaculture Tanks during the Feeding Process. Sensors 2018, 18, 750. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Architecture of the IoT system with multiple breeding cameras.
Figure 1. Architecture of the IoT system with multiple breeding cameras.
Engproc 115 00002 g001
Figure 2. Monitoring and control system.
Figure 2. Monitoring and control system.
Engproc 115 00002 g002
Figure 3. Measured with absolute error (a) temperature (b) humidity.
Figure 3. Measured with absolute error (a) temperature (b) humidity.
Engproc 115 00002 g003
Figure 4. Consistency Test: Temperature and Humidity over Time.
Figure 4. Consistency Test: Temperature and Humidity over Time.
Engproc 115 00002 g004
Table 1. Comparison of temperature readings between thermohygrometer and SHT32 sensor with respect to the reference value.
Table 1. Comparison of temperature readings between thermohygrometer and SHT32 sensor with respect to the reference value.
Set Point °CThermohygrometer °CSensor SHT32 °C
33.53.4/3.2
55.55.4/5.24
1010.510.4/10.29
1515.515.38/15.27
2020.520.37/20.25
2525.524.36/22.4
3030.530.45/30.17
Table 2. Comparison of relative humidity readings between thermohygrometer and SHT32 sensor with respect to the reference value.
Table 2. Comparison of relative humidity readings between thermohygrometer and SHT32 sensor with respect to the reference value.
Set Point °CThermohygrometer °CSensor SHT32 °C
4039.239.5
5049.249.5
6059.259.5
7069.269.5
8079.279.5
9089.289.5
10099.299.5
Table 3. Performance metrics of the IoT monitoring system.
Table 3. Performance metrics of the IoT monitoring system.
VariableAverage ValueStandard DeviationRangeUnit
MQTT response time18025150–220ms
Total energy consumption12.40.611.8–13.2Wh
Wi-Fi reconnection time3.50.82.1–4.7s
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Freire, L.O.; Castillo, J.N.; Robalino, E.F.; Flores, L.A.; Trujillo, D.F. IoT System for Monitoring and Controlling Microclimates in a Fruit Fly Breeding Chamber. Eng. Proc. 2025, 115, 2. https://doi.org/10.3390/engproc2025115002

AMA Style

Freire LO, Castillo JN, Robalino EF, Flores LA, Trujillo DF. IoT System for Monitoring and Controlling Microclimates in a Fruit Fly Breeding Chamber. Engineering Proceedings. 2025; 115(1):2. https://doi.org/10.3390/engproc2025115002

Chicago/Turabian Style

Freire, Luigi O., Jessica N. Castillo, E. Freddy Robalino, Luis Antonio Flores, and Danilo Fabricio Trujillo. 2025. "IoT System for Monitoring and Controlling Microclimates in a Fruit Fly Breeding Chamber" Engineering Proceedings 115, no. 1: 2. https://doi.org/10.3390/engproc2025115002

APA Style

Freire, L. O., Castillo, J. N., Robalino, E. F., Flores, L. A., & Trujillo, D. F. (2025). IoT System for Monitoring and Controlling Microclimates in a Fruit Fly Breeding Chamber. Engineering Proceedings, 115(1), 2. https://doi.org/10.3390/engproc2025115002

Article Metrics

Back to TopTop