KambingPRO is an ESP32-based IoT system for intelligent livestock barn management. Designed to support traceable, efficient, and sustainable animal waste and environment monitoring, this project integrates real-time data streaming to Arduino Cloud, automated flushing systems, and data logging to Google Sheets.
- 🌡️ Sensor Monitoring: Tracks temperature, humidity (DHT22), ammonia (MQ-137), and water level (ultrasonic sensor).
- ⏱️ Scheduled and Reactive Flushing: Activates barn pumps at intervals or when ammonia exceeds a threshold.
- 🧠 Real-Time Decision Making: ESP32 automates relays based on sensor logic and cloud input.
- 📊 Cloud Sync:
- Streams live data to Arduino Cloud IoT.
- Sends hourly-averaged data to Google Sheets via Google Apps Script.
- 📟 Local LCD Display: Shows current sensor readings for on-site operators.
- ⏰ NTP Time Sync: Keeps logs and control operations time-accurate.
- ESP32 Dev Board
- DHT22 / DHT21 Sensor
- MQ-137 Ammonia Gas Sensor
- Ultrasonic Sensor (HC-SR04 or JSN-SR04T)
- 4-channel relay module (for pump, CCTV, siren)
- I2C 16x2 or 20x4 LCD Display
- Water storage tank with pump
- Optional: Buzzer or LED indicators
- Arduino IDE
- Arduino Cloud-connected
.inosketch thingProperties.h(auto-generated from Arduino IoT Cloud)- Google Apps Script Web App for Sheets logging
Required Libraries:
ArduinoIoTCloudDHT sensor libraryLiquidCrystal_I2CWiFi.h,HTTPClient.h, etc.
- Main Loop: Continuously sends sensor data to Arduino Cloud.
- 10-Min Interval Task: Aggregates readings, sends cleaned data to Google Sheets.
- Flushing System:
- Time-controlled flush every X minutes
- OR automatic flush if ammonia > threshold
This project is licensed under the MIT License.
Pull requests are welcome! Whether you're improving hardware setup, refactoring code, or extending cloud functionality — your contribution is appreciated.
Maintained by Fathurrahman Lananan
This project is part of the R.A.Barn initiative toward sustainable, IoT-enabled agriculture and animal waste management.