IoT and Machine Learning-Based Framework for Real-Time Methane Gas Detection and Bovine Health Monitoring in Dairy Farms

Uncategorized

Authors: Dr. Deepika, Abhinav K G, Adithya Verma M A, Chiranth S Shetty, G Suhas Kartik

Abstract: Dairy farms generate substantial quantities of methane gas through enteric fermentation and manure decomposition. Elevated methane concentrations in enclosed or poorly ventilated cowsheds adversely affect cattle health, reduce milk productivity, and pose safety hazards to farm workers. Conventional gas-monitoring systems are reactive and threshold-based, generating alerts only after dangerous concentrations have already been reached. This paper presents an IoT and Machine Learning (ML)-based framework for real-time methane detection and bovine health risk classification. MQ-4 (methane), MQ-135 (air quality/ammonia), and DHT22 (temperature and humidity) sensors interface with an ESP32 microcontroller to collect continuous environmental readings that are transmitted to Firebase cloud storage via Wi-Fi using MQTT/HTTP protocols. Five supervised ML classifiers — Random Forest, Decision Tree, Support Vector Machine (SVM), Logistic Regression, and K-Nearest Neighbors (KNN) — are trained and evaluated for three-class bovine health risk classification (Low, Moderate, High). Random Forest achieved the highest performance with 96.8% accuracy, 96.5% precision, 96.8% recall, and an F1-score of 96.6% at the 90-10 train-test split, outperforming SVM (91.3%), Decision Tree (84.1%), KNN (79.6%), and Logistic Regression (76.9%). Automated alerts are delivered to farmers via a real-time Arduino IoT Cloud dashboard, email, and mobile push notifications. The proposed system is scalable and cost-effective.

DOI: https://doi.org/10.5281/zenodo.20321084

× How can I help you?