Through Cowdy, we aim to detect precise estrus periods, potential diseases, and abnormalities among cattle to ensure high production yield in livestock farms. The system uses MPU6050 sensors with ESP32 microcontrollers to collect and analyze movement data for accurate estrus detection.
This project implements a sophisticated estrus detection system using motion sensors and machine learning. The system continuously monitors cow behavior patterns through accelerometer and gyroscope data to identify estrus periods with high accuracy.
- Real-time motion data collection using MPU6050 sensors
- Wireless data transmission via MQTT and ESP-NOW protocols
- Machine learning-based behavior classification
- MongoDB integration for data storage
- Automated estrus period detection
- ESP32 microcontroller
- MPU6050 accelerometer and gyroscope sensor
- Power supply unit
- Mounting equipment for sensor attachment
- Arduino IDE with ESP32 board support
- Python 3.x
- Required Python packages:
- scikit-learn
- pandas
- numpy
- pymongo
- Clone this repository
- Upload the appropriate firmware to ESP32:
- Use
emqx_sending.ino
for MQTT implementation - Use
sender_espNOW.ino
/receiver_espNOW.ino
for ESP-NOW implementation
- Use
- Install Python dependencies:
pip install scikit-learn pandas numpy pymongo
The system classifies three main behavioral patterns from the sensor data:
- Feeding
- Rumination
- Resting
Data is collected using iFarmer devices:
24-hour monitoring provides comprehensive behavioral data:
The system has demonstrated successful estrus detection over 6 months (August-December 2019), with only one missed detection due to a power outage.
The project includes several data processing scripts:
dataset_labeling.py
: For labeling collected sensor datadt.py
: Decision tree implementation for classificationrfe.py
: Feature selection and engineering
Data is collected at different sampling rates (1s, 3s, 5s) and processed accordingly, as seen in the dataset files:
- filtered_gyro1s.csv
- filtered_gyro3s.csv
- filtered_gyro5s.csv
The system supports two communication methods:
- MQTT Protocol (
emqx_sending.ino
,mqtt_to_mongoDB.ino
) - ESP-NOW Protocol (
sender_espNOW.ino
,receiver_espNOW.ino
)
For any additional queries, please contact: Email: [email protected]
This project is licensed under the terms of the LICENSE file included in the repository.