A Self-Configurable IoT-Based Monitoring Approach for Environmental Variables in Rotational Grazing Systems
Abstract
1. Introduction
2. Related Work
3. Theoretical Framework
3.1. Precision Livestock Farming
3.2. Properties of Self-* Systems
- Self-configuration:The ability to automatically configure and reconfigure components based on the current context or operational state. In IoT applications, this might include adjusting the sampling frequency, modifying communication protocols, or enabling energy-saving modes depending on sensor readings and energy levels.
- Self-optimization: The ability to monitor performance metrics and proactively make adjustments to improve operational efficiency. In the case of IoT devices in livestock systems, this may involve optimizing energy consumption while maintaining reliable data acquisition.
- Self-healing: The capability to detect, diagnose, and recover from faults automatically. Although not a primary focus of this study, self-healing is essential for long-term autonomous deployments in rural and hard-to-access environments.
- Self-protection: The ability to detect and defend against malicious attacks or unexpected disturbances that may compromise the system’s functionality or data integrity.
- Self-awareness: The ability of the system to be aware of its internal state and surrounding environment, enabling context-aware decision-making. This property supports all other self-* capabilities by serving as the foundation for adaptive behavior.
3.3. Environmental Stress Indicators in Cattle
4. The Proposed Approach
4.1. Hardware-Agnostic Self-Configuration Design
- Abstract Interfaces: Each node exposes a minimal set of functions—read() for data acquisition, predict() for on-node inference, and tx(mode) for data transmission. These interfaces allow the adaptation logic to remain independent of the underlying hardware.
- Operational Profiles: Three generic profiles govern system behavior: (i) Normal for stable conditions, (ii) Critical for detected risk situations, and (iii) Energy-Saving when battery levels are low. Each profile specifies sampling rate, communication mode, and transmission priority, but does not prescribe a specific technology.
- Adaptation Logic: The Random Forest classifier provides a binary state (normal/critical). Combined with battery status, the adaptation engine transitions between operational profiles. Transitions are governed by hysteresis rules to avoid oscillations.
- Deployment Flexibility: Because the system is defined through abstract layers and not through specific hardware, it can be deployed with different sensing modules (e.g., various temperature or CO2 sensors), communication technologies (WiFi, LoRa, Zigbee, etc.), and energy sources (battery, solar), without altering the self-configuration mechanism.
4.2. System Architecture
- Sensing Layer: This layer includes multiple sensor nodes deployed in the field. Each node measures key environmental variables such as temperature, humidity, and CO2 concentration. The sensors operate autonomously and generate time-stamped observations. These nodes are deployed in strategic zones, such as shaded resting areas or holding corrals, where animals rest and environmental conditions are prone to stress events.
- Autonomous Configuration Layer: This layer integrates a machine learning-based anomaly detection component, specifically a Random Forest classifier trained to predict critical conditions from sensor inputs. Each sensor node embeds this model and applies it in real time to incoming data. Based on the prediction (critical vs. normal), an adaptation engine modifies the sensor’s configuration:
- -
- In critical conditions (e.g., high temperature and low humidity), the sampling frequency is increased (e.g., from 10 s to 2 s), and a low-latency communication protocol such as LoRaWAN is selected.
- -
- In low-risk or low-battery scenarios, the sensor switches to energy-saving modes (e.g., longer sampling intervals or reduced bandwidth protocols like LoRa).
For implementation purposes, a binary variable named critical_zone is defined, which indicates whether the system is operating under critical environmental conditions (1) or normal conditions (0). This variable is used internally to trigger adaptive configuration decisions at the sensor node. This adaptive behavior reduces energy consumption and extends device lifespan while ensuring that dangerous conditions are captured with high temporal resolution. - Data Management Layer: Once data is captured and classified, it is transmitted to an edge gateway, which acts as a local processing hub. This layer handles aggregation, storage, and visualization of incoming data. The gateway may forward data to a remote dashboard or cloud-based analytics platform, where long-term trends can be monitored and alarms issued when sustained environmental stress is detected.
4.3. Synthetic Data Generation
4.3.1. Dataset Composition
4.3.2. Environmental Patterns
- Temperature: Modeled with a sinusoidal diurnal cycle peaking at midday, plus Gaussian noise (, ) to emulate sensor inaccuracies.
- Humidity: Initialized at 65% and modeled with a slow downward daily trend and stochastic variations ().
- CO2: Centered at 420 ppm with random noise () and occasional spikes to mimic accumulation due to crowding.
- Pressure: Simulated around 1012 hPa (), representing ambient atmospheric conditions.
4.3.3. Critical Events
- Temperature exceeding 34 °C;
- Humidity falling below 50%;
- CO2 concentration rising above 500 ppm.
4.3.4. Noise and Missingness
- 5% of values were set as missing at random to mimic packet loss or sensor downtime.
- 10% of labels were flipped to simulate annotation uncertainty, reflecting imperfect ground truth.
- Timestamps were jittered by ±5 s to reproduce asynchronous sensor clocks.
4.4. Model Training and Adaptive Feedback Loop
4.4.1. Model Training Procedure
4.4.2. Adaptive Feedback Loop
Algorithm 1 Adaptive Feedback Loop in Self-Configurable Sensor |
|
4.5. Study Assumptions and Limitations
4.5.1. Assumptions for the Study
4.5.2. Limitations
5. Experiments and Results
5.1. Experimental Setup
- Ambient temperature (°C).
- CO2 concentration (ppm).
5.2. Scenario Description
5.3. Model Evaluation Metrics
5.4. Critical Event Visualization
6. Conclusions and Future Work
Author Contributions
Funding
Conflicts of Interest
References
- Silva, W.C.d.; Silva, J.A.R.d.; Camargo-Júnior, R.N.C.; Silva, É.B.R.d.; Santos, M.R.P.d.; Viana, R.B.; Silva, A.G.M.e.; Silva, C.M.G.d.; Lourenço-Júnior, J.d.B. Animal welfare and effects of per-female stress on male and cattle reproduction—A review. Front. Vet. Sci. 2023, 10, 1083469. [Google Scholar] [CrossRef]
- Karvatte, N.; Miyagi, E.S.; Carvalho de Oliveira, C.; Mastelaro, A.P.; de Aguiar Coelho, F.; Bayma, G.; Bungenstab, D.J.; Alves, F.V. Spatiotemporal variations on infrared temperature as a thermal comfort indicator for cattle under agroforestry systems. J. Therm. Biol. 2021, 97, 102871. [Google Scholar] [CrossRef]
- Chang-Fung-Martel, J.; Harrison, M.T.; Brown, J.N.; Rawnsley, R.; Smith, A.P.; Meinke, H. Negative relationship between dry matter intake and the temperature-humidity index with increasing heat stress in cattle: A global meta-analysis. Int. J. Biometeorol. 2021, 65, 2099–2109. [Google Scholar] [CrossRef]
- Fynn, R.; Jackson, J. Grazing management on commercial cattle ranches: Incorporating foraging ecology and biodiversity conservation principles. Rangelands 2022, 44, 136–147. [Google Scholar] [CrossRef]
- Alawad, F. Adaptive Sampling for Efficient Acoustic Noise Monitoring: An Incremental Learning Approach. In Proceedings of the 2022 IEEE International Conferences on Internet of Things (iThings) and IEEE Green Computing & Communications (GreenCom) and IEEE Cyber, Physical & Social Computing (CPSCom) and IEEE Smart Data (SmartData) and IEEE Congress on Cybermatics (Cybermatics), Espoo, Finland, 22–25 August 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 176–184. [Google Scholar] [CrossRef]
- Modak, M.; Pritom, M.M.; Banik, S.C.; Rabbi, M.S. Internet of Things-Based Health Surveillance Systems for Livestock: A Review of Recent Advances and Challenges. IET Wirel. Sens. Syst. 2025, 15, e70013. [Google Scholar] [CrossRef]
- Neculai-Valeanu, A.S.; Sanduleanu, C.; Porosnicu, I. From tradition to precision: Leveraging digital tools to improve cattle health and welfare. Front. Vet. Sci. 2025, 12, 1549512. [Google Scholar] [CrossRef] [PubMed]
- Santolini, E.; Bovo, M.; Barbaresi, A.; Agrusti, M.; Tassinari, P.; Pezzuolo, A.; Torreggiani, D. Monitoring and Analysis of the Gaseous Emissions Collected in a Livestock Farm. In Proceedings of the 2022 IEEE Workshop on Metrology for Agriculture and Forestry (MetroAgriFor), Perugia, Italy, 3–5 November 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 28–32. [Google Scholar] [CrossRef]
- Li, B.; Wang, Y.; Rong, L.; Zheng, W. Research progress on animal environment and welfare. Anim. Res. ONE Health 2023, 1, 78–91. [Google Scholar] [CrossRef]
- Pereira, W.F.; Fonseca, L.d.S.; Putti, F.F.; Góes, B.C.; Naves, L.d.P. Environmental monitoring in a poultry farm using an instrument developed with the internet of things concept. Comput. Electron. Agric. 2020, 170, 105257. [Google Scholar] [CrossRef]
- Mohan, K.; Kannan, M.N.; Mohan, M.; Nathan, S.S. Animo—Animal Monitoring System Based on Internet of Things. In Proceedings of the 2024 IEEE 15th Control and System Graduate Research Colloquium (ICSGRC), Shah Alam, Malaysia, 17 August 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 337–341. [Google Scholar] [CrossRef]
- Pillewan, M.; Agrawal, R.; Wyawahare, N.; Thakare, L. Development of Domestic Animals Shelter Environment Monitoring System using Internet of Things (IoT). In Proceedings of the 2023 International Conference on Sustainable Computing and Smart Systems (ICSCSS), Coimbatore, India, 14–16 June 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 972–976. [Google Scholar] [CrossRef]
- Unold, O.; Nikodem, M.; Piasecki, M.; Szyc, K.; Maciejewski, H.; Bawiec, M.; Dobrowolski, P.; Zdunek, M. IoT-Based Cow Health Monitoring System. In Computational Science—ICCS 2020, Proceedings of the 20th International Conference; Amsterdam, The Netherlands, 3–5 June 2020, Springer International Publishing: Berlin/Heidelberg, Germany, 2020; pp. 344–356. [Google Scholar] [CrossRef]
- Tangorra, F.M.; Buoio, E.; Calcante, A.; Bassi, A.; Costa, A. Internet of Things (IoT): Sensors Application in Dairy Cattle Farming. Animals 2024, 14, 3071. [Google Scholar] [CrossRef]
- Provolo, G.; Brandolese, C.; Grotto, M.; Marinucci, A.; Fossati, N.; Ferrari, O.; Beretta, E.; Riva, E. An Internet of Things Framework for Monitoring Environmental Conditions in Livestock Housing to Improve Animal Welfare and Assess Environmental Impact. Animals 2025, 15, 644. [Google Scholar] [CrossRef]
- Schulthess, L.; Longchamp, F.; Vogt, C.; Magno, M. A Lora-Based and Maintenance-Free Cattle Monitoring System for Alpine Pastures and Remote Locations. In Proceedings of the 11th International Workshop on Energy Harvesting & Energy-Neutral Sensing Systems, Istanbul, Turkey, 12 November 2023; ACM: New York, NY, USA, 2023; pp. 44–50. [Google Scholar] [CrossRef]
- Berckmans, D. General introduction to precision livestock farming. Anim. Front. 2017, 7, 6–11. [Google Scholar] [CrossRef]
- Mancuso, D.; Castagnolo, G.; Porto, S.M.C. Cow Behavioural Activities in Extensive Farms: Challenges of Adopting Automatic Monitoring Systems. Sensors 2023, 23, 3828. [Google Scholar] [CrossRef]
- Lemes, A.P.; Garcia, A.R.; Pezzopane, J.R.M.; Brandão, F.Z.; Watanabe, Y.F.; Cooke, R.F.; Sponchiado, M.; de Paz, C.C.P.; Camplesi, A.C.; Binelli, M.; et al. Silvopastoral system is an alternative to improve animal welfare and productive performance in meat production systems. Sci. Rep. 2021, 11, 14092. [Google Scholar] [CrossRef]
- Ozger, Z.B.; Cihan, P.; Gokce, E. A Systematic Review of IoT Technology and Applications in Animals. Kafkas Univ. Vet. Fak. Derg. 2024, 30, 411–431. [Google Scholar] [CrossRef]
- García, R.; Aguilar, J.; Toro, M.; Pinto, A.; Rodríguez, P. A systematic literature review on the use of machine learning in precision livestock farming. Comput. Electron. Agric. 2020, 179, 105826. [Google Scholar] [CrossRef]
- Jiménez, M.; García, R.; Aguilar, J. A many-objective optimization approach for weight gain and animal welfare in rotational grazing of cattle. Eng. Appl. Artif. Intell. 2024, 133, 108264. [Google Scholar] [CrossRef]
- Garcia, R.; Benitez, C.; Aguilar, J. Management System for the Fattening Process of Bovines in Rotational Grazing using Diagnosis and Recommendation Systems. CLEI Electron. J. 2023, 26. [Google Scholar] [CrossRef]
- Cong Vinh, P. Concurrency of self-* in autonomic systems. Future Gener. Comput. Syst. 2016, 56, 140–152. [Google Scholar] [CrossRef]
- Ganesh Rajendran, J.; Alagarsamy, M.; Seva, V.; Mani Dinesh, P.; Rajangam, B.; Suriyan, K. IoT based tracking cattle healthmonitoring system using wireless sensors. Bull. Electr. Eng. Inform. 2023, 12, 3086–3094. [Google Scholar] [CrossRef]
- Dobson, S.; Sterritt, R.; Nixon, P.; Hinchey, M. Fulfilling the Vision of Autonomic Computing. Computer 2010, 43, 35–41. [Google Scholar] [CrossRef]
- Shephard, R.; Maloney, S. A review of thermal stress in cattle. Aust. Vet. J. 2023, 101, 417–429. [Google Scholar] [CrossRef] [PubMed]
- Collier, R.J.; Baumgard, L.H.; Zimbelman, R.B.; Xiao, Y. Heat stress: Physiology of acclimation and adaptation. Anim. Front. 2018, 9, 12–19. [Google Scholar] [CrossRef] [PubMed]
- Vecellio, D.J.; Cottle, R.M.; Wolf, S.T.; Kenney, W.L. Critical Environmental Limits for Human Thermoregulation in the Context of a Changing Climate. Exerc. Sport Mov. 2023, 1, e00008. [Google Scholar] [CrossRef] [PubMed]
- Habeeb, A.A.M.; Osman, S.F.; Gad, A.E. Signs of heat stress and some steps to reduce the negative effects on animals. GSC Adv. Res. Rev. 2020, 4, 46–58. [Google Scholar] [CrossRef]
- Bernabucci, U.; Lacetera, N.; Baumgard, L.; Rhoads, R.; Ronchi, B.; Nardone, A. Metabolic and hormonal acclimation to heat stress in domesticated ruminants. Animal 2010, 4, 1167–1183. [Google Scholar] [CrossRef]
- Chauhan, S.S.; Rashamol, V.P.; Bagath, M.; Sejian, V.; Dunshea, F.R. Impacts of heat stress on immune responses and oxidative stress in farm animals and nutritional strategies for amelioration. Int. J. Biometeorol. 2021, 65, 1231–1244. [Google Scholar] [CrossRef]
- Zazueta Gutierrez, A.C.; Romo Valdez, A.M.; Castro Perez, B.I.; Ríos Ríncon, F.G. Heat stress mitigation strategies for beef cattle under intensive finishing in the Mexican dry tropics. Agro Product. 2021, 14, 23–30. [Google Scholar] [CrossRef]
- Damtew, A. The Effect of long Distance Transportation Stress on Cattle: A Review. Biomed. J. Sci. Tech. Res. 2018, 3, 3304–3308. [Google Scholar] [CrossRef][Green Version]
Step | Description |
---|---|
1 | Remove incomplete rows with missing values from D |
2 | Normalize or standardize features in |
3 | Split dataset D into (80%) and (20%) |
4 | Train Random Forest classifier f using |
5 | Evaluate f on using accuracy, precision, recall, and F1-score |
6 | Save the trained model f for deployment on sensor nodes |
Class | Precision | Recall | F1-Score | Support |
---|---|---|---|---|
Non-Critical (0) | 0.98 | 1.00 | 0.99 | 2084 |
Critical (1) | 0.98 | 0.85 | 0.91 | 316 |
Accuracy | 0.98 | |||
Macro Avg | 0.98 | 0.92 | 0.95 | 2400 |
Weighted Avg | 0.98 | 0.98 | 0.98 | 2400 |
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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Garcia, R.; Macea, M.; Castaño, S.; Guevara, P. A Self-Configurable IoT-Based Monitoring Approach for Environmental Variables in Rotational Grazing Systems. Informatics 2025, 12, 102. https://doi.org/10.3390/informatics12040102
Garcia R, Macea M, Castaño S, Guevara P. A Self-Configurable IoT-Based Monitoring Approach for Environmental Variables in Rotational Grazing Systems. Informatics. 2025; 12(4):102. https://doi.org/10.3390/informatics12040102
Chicago/Turabian StyleGarcia, Rodrigo, Mario Macea, Samir Castaño, and Pedro Guevara. 2025. "A Self-Configurable IoT-Based Monitoring Approach for Environmental Variables in Rotational Grazing Systems" Informatics 12, no. 4: 102. https://doi.org/10.3390/informatics12040102
APA StyleGarcia, R., Macea, M., Castaño, S., & Guevara, P. (2025). A Self-Configurable IoT-Based Monitoring Approach for Environmental Variables in Rotational Grazing Systems. Informatics, 12(4), 102. https://doi.org/10.3390/informatics12040102